szaszm commented on a change in pull request #731: MINIFICPP-1096 fix
BackTrace, OOB indexing, tests, appveyor reporting
URL: https://github.com/apache/nifi-minifi-cpp/pull/731#discussion_r385693436
##########
File path: extensions/standard-processors/tests/unit/ProcessorTests.cpp
##########
@@ -180,19 +184,37 @@ TEST_CASE("Test GetFile Ignore", "[getfileCreate3]") {
auto records = reporter->getEvents();
record = session->get();
REQUIRE(record == nullptr);
- REQUIRE(records.size() == 0);
+ REQUIRE(records.empty());
- std::fstream file;
- std::stringstream ss;
- ss << dir << utils::file::FileUtils::get_separator() << ".filewithoutanext";
- file.open(ss.str(), std::ios::out);
- file << "tempFile";
- file.close();
+ const std::string hidden_file_name = [&] {
+ std::stringstream ss;
+ ss << dir << utils::file::FileUtils::get_separator() <<
".filewithoutanext";
+ return ss.str();
+ }();
+ {
+ std::ofstream file{ hidden_file_name };
+ file << "tempFile";
+ }
+
+#ifdef WIN32
+ {
Review comment:
This is inherently specific to Windows, since on windows "hidden" is a file
system attribute while on unix it's a filename prefix. Because of the wildly
different semantics, I would only add it inside an `#ifdef WIN32`/`#endif /*
WIN32 */` there as well.
Would that be good in your opinion?
----------------------------------------------------------------
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