phrocker commented on a change in pull request #596: MINIFICPP-925 - Fix 
TailFile hang on long lines
URL: https://github.com/apache/nifi-minifi-cpp/pull/596#discussion_r296845465
 
 

 ##########
 File path: extensions/standard-processors/tests/unit/TailFileTests.cpp
 ##########
 @@ -105,12 +111,127 @@ TEST_CASE("TailFileWithOutDelimiter", 
"[tailfiletest2]") {
 
   testController.runSession(plan, false);
   auto records = plan->getProvenanceRecords();
-  std::shared_ptr<core::FlowFile> record = plan->getCurrentFlowFile();
-  REQUIRE(record == nullptr);
   REQUIRE(records.size() == 2);
 
   testController.runSession(plan, false);
 
+  REQUIRE(LogTestController::getInstance().contains("Logged 1 flow files"));
+  REQUIRE(LogTestController::getInstance().contains("Size:" + 
std::to_string(NEWLINE_FILE.size()) + " Offset:0"));
+
+  LogTestController::getInstance().reset();
+
+  // Delete the test and state file.
+  remove(TMP_FILE);
+  remove(STATE_FILE);
+}
+
+TEST_CASE("TailFileLongWithDelimiter", "[tailfiletest2]") {
+  std::string line1("foo");
+  std::string line2(8050, 0);
+  std::mt19937 gen(std::random_device { }());
+  std::generate_n(line2.begin(), line2.size(), [&]() -> char {
 
 Review comment:
   can we not do something like this: https://stackoverflow.com/a/440240 
   
   and add it to the test library negating our need for hex conversion? I may 
be missing something here. 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to