This is an automated email from the ASF dual-hosted git repository.

phrocker pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git


The following commit(s) were added to refs/heads/master by this push:
     new 93420df  MINIFICPP-818 - Remove fileutils dependency from putfile tests
93420df is described below

commit 93420dfe1c30feed63ac7bbacb272a529ca7922a
Author: Arpad Boda <[email protected]>
AuthorDate: Wed Apr 24 12:11:46 2019 +0200

    MINIFICPP-818 - Remove fileutils dependency from putfile tests
    
    This closes #543.
    
    Signed-off-by: Marc Parisi <[email protected]>
---
 extensions/standard-processors/tests/unit/PutFileTests.cpp | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/extensions/standard-processors/tests/unit/PutFileTests.cpp 
b/extensions/standard-processors/tests/unit/PutFileTests.cpp
index cc34f4b..e21c6a7 100644
--- a/extensions/standard-processors/tests/unit/PutFileTests.cpp
+++ b/extensions/standard-processors/tests/unit/PutFileTests.cpp
@@ -369,11 +369,16 @@ TEST_CASE("PutFileMaxFileCountTest", 
"[getfileputpfilemaxcount]") {
   // Only 1 of the 2 files should make it to the target dir
   // Non-determistic, so let's just count them
   int files_in_dir = 0;
-  auto lambda = [&files_in_dir](const std::string&, const std::string&) -> 
bool {
-    return ++files_in_dir < 2;
-  };
 
-  utils::file::FileUtils::list_dir(putfiledir, lambda, 
testController.getLogger(), false);
+  for (int i = 0; i < 2; ++i) {
+    std::stringstream ss;
+    ss << putfiledir << "/" << "tstFile" << i << ".ext";
+    std::ifstream file(ss.str());
+    if (file.is_open() && file.good()) {
+      files_in_dir++;
+      file.close();
+    }
+  }
 
   REQUIRE(files_in_dir == 1);
 

Reply via email to