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 2019/11/13 20:03:48 UTC

[GitHub] [nifi-minifi-cpp] asdaraujo commented on a change in pull request #668: MINIFICPP-1072 - Fixed temporary path for GetFileTests on Windows

asdaraujo commented on a change in pull request #668: MINIFICPP-1072 - Fixed temporary path for GetFileTests on Windows
URL: https://github.com/apache/nifi-minifi-cpp/pull/668#discussion_r345974895
 
 

 ##########
 File path: extensions/standard-processors/tests/unit/GetFileTests.cpp
 ##########
 @@ -52,7 +52,7 @@ TEST_CASE("GetFile: MaxSize", "[getFileFifo]") {  // NOLINT
   std::string in_file = temp_path + utils::file::FileUtils::get_separator() + "testfifo";
 
   // Define test input file
-  std::string hidden_in_file(in_dir);
+  std::string hidden_in_file(temp_path);
 
 Review comment:
   Are you sure it's wrong? It seems right to me.
   
   If you look closely `in_dir` is just a template that is used by `createTempDirectory()` to generate a unique dir name, which is then assigned to `temp_path`.
   
   The `in_file` path was already built using `temp_path`, but `hidden_in_file` was using `in_dir` instead, which seems wrong to me and would cause both files to be at different locations.
   
   The test never failed because the Processor would not get the file either way since it ignores hidden files.
   
   There's one more improvement to be done here: both file paths are constructed in different ways, which just makes it confusing. I can make them consistent, following your suggestion above, but using `temp_path` instead:
   
   ```
   // Define test input files
   std::string in_file(temp_path + utils::file::FileUtils::get_separator() + "testfifo");
   std::string hidden_in_file(temp_path + utils::file::FileUtils::get_separator() + ".testfifo")
   ```
   
   @arpadboda Let me know your thoughts.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services