You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2021/07/09 08:42:55 UTC

[GitHub] [nifi-minifi-cpp] fgerlits commented on a change in pull request #1128: MINIFICPP-1602 upgrade Catch2 to v2.13.6

fgerlits commented on a change in pull request #1128:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1128#discussion_r666742986



##########
File path: extensions/windows-event-log/tests/ConsumeWindowsEventLogTests.cpp
##########
@@ -66,16 +66,9 @@ TEST_CASE("ConsumeWindowsEventLog constructor works", "[create]") {
   TestController test_controller;
   std::shared_ptr<TestPlan> test_plan = test_controller.createPlan();
 
-  REQUIRE_NOTHROW(ConsumeWindowsEventLog processor_one("one"));
-
-  REQUIRE_NOTHROW(
-    utils::Identifier uuid = utils::IdGenerator::getIdGenerator()->generate();
-    ConsumeWindowsEventLog processor_two("two", uuid);
-  );  // NOLINT
-
-  REQUIRE_NOTHROW(
-    auto processor = test_plan->addProcessor("ConsumeWindowsEventLog", "cwel");
-  );  // NOLINT
+  REQUIRE_NOTHROW(ConsumeWindowsEventLog("one"));
+  REQUIRE_NOTHROW(ConsumeWindowsEventLog("two", utils::IdGenerator::getIdGenerator()->generate()));  // NOLINT
+  REQUIRE_NOTHROW(test_plan->addProcessor("ConsumeWindowsEventLog", "cwel"));  // NOLINT

Review comment:
       are the NOLINTs still needed?

##########
File path: libminifi/test/persistence-tests/PersistenceTests.cpp
##########
@@ -233,11 +233,8 @@ TEST_CASE("Processors Can Store FlowFiles", "[TestP1]") {
     REQUIRE(expired.empty());
 
     auto content = flow.read(file);
-    auto isOneOfPossibleResults =
-        Catch::Equals("_Header_one_Demarcator_two_Demarcator_three_Footer_")
-        || Catch::Equals("_Header_two_Demarcator_one_Demarcator_three_Footer_");
-
-    REQUIRE_THAT(content, isOneOfPossibleResults);
+    // See important note about matchers at: https://github.com/catchorg/Catch2/blob/e8cdfdca87ebacd993befdd08ea6aa7e8068ef3d/docs/matchers.md#using-matchers

Review comment:
       that's useful info, thanks!

##########
File path: libminifi/test/keyvalue-tests/PersistableKeyValueStoreServiceTest.cpp
##########
@@ -33,17 +33,14 @@
 
 static std::string config_yaml; // NOLINT
 
-static inline void configYamlHandler(Catch::ConfigData&, const std::string& path) {
-  config_yaml = path;
-}
-
 int main(int argc, char* argv[]) {
   Catch::Session session;
 
-  auto& cli = const_cast<Catch::Clara::CommandLine<Catch::ConfigData>&>(session.cli());
-  cli["--config-yaml"]
-      .describe("path to the config.yaml containing the PersistableKeyValueStoreService controller service configuration")
-      .bind(&configYamlHandler, "path");
+  const auto& const_cli = session.cli();
+  auto& cli = const_cast<minifi::utils::remove_cvref_t<decltype(const_cli)>&>(const_cli);

Review comment:
       Is it worth all this code just to avoid a copy (in a test?)  The example at https://github.com/catchorg/Catch2/blob/devel/docs/own-main.md#adding-your-own-command-line-options has
   ```c++
   auto cli = session.cli() | ...;
   session.cli(cli);
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@nifi.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org