Skip to content

Commit

Permalink
Windows fmt fs::path formatting errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmarrec committed Jul 20, 2023
1 parent 8888241 commit 8279335
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
16 changes: 6 additions & 10 deletions src/ConvertInputFormat/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,12 +329,7 @@ bool processInput(fs::path const &inputFilePath,
}

if (!EnergyPlus::FileSystem::fileExists(inputFilePath)) {
#ifdef _WIN32
displayMessage("Input file path {} not found", inputFilePath.string());
#else
displayMessage("Input file path {} not found", inputFilePath);
#endif

displayMessage("Input file path {} not found", inputFilePath.generic_string());
return false;
}

Expand Down Expand Up @@ -548,9 +543,10 @@ Select one (case insensitive):
#pragma omp atomic
++fileCount;
if (successful) {
displayMessage("Input file converted to {} successfully | {}/{} | {}", outputTypeStr, fileCount, number_files, files[i]);
displayMessage(
"Input file converted to {} successfully | {}/{} | {}", outputTypeStr, fileCount, number_files, files[i].generic_string());
} else {
displayMessage("Input file conversion failed: | {}/{} | {}", fileCount, number_files, files[i]);
displayMessage("Input file conversion failed: | {}/{} | {}", fileCount, number_files, files[i].generic_string());
}
}
}
Expand All @@ -565,9 +561,9 @@ Select one (case insensitive):
bool successful = processInput(file, schema, outputType, outputDirectoryPath, outputTypeStr, convertHVACTemplate);
++fileCount;
if (successful) {
displayMessage("Input file converted to {} successfully | {}/{} | {}", outputTypeStr, fileCount, number_files, file);
displayMessage("Input file converted to {} successfully | {}/{} | {}", outputTypeStr, fileCount, number_files, file.generic_string());
} else {
displayMessage("Input file conversion failed: | {}/{} | {}", fileCount, number_files, file);
displayMessage("Input file conversion failed: | {}/{} | {}", fileCount, number_files, file.generic_string());
}
}
#endif
Expand Down
7 changes: 4 additions & 3 deletions src/EnergyPlus/CommandLineInterface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,8 @@ state.dataStrGlobals->inputFilePath='{}',
state.dataGlobal->outputEpJSONConversionOnly,
suffixType,
state.dataGlobal->numThread,
state.files.inputWeatherFilePath.filePath,
state.dataStrGlobals->inputFilePath);
state.files.inputWeatherFilePath.filePath.generic_string(),
state.dataStrGlobals->inputFilePath.generic_string());
exit(0);
}

Expand Down Expand Up @@ -337,7 +337,8 @@ state.dataStrGlobals->inputFilePath='{}',
break;
default:
DisplayString(state,
fmt::format("ERROR: Input file must have IDF, IMF, or epJSON extension: {}", state.dataStrGlobals->inputFilePath));
fmt::format("ERROR: Input file must have IDF, IMF, or epJSON extension: {}",
state.dataStrGlobals->inputFilePath.generic_string()));
if (eplusRunningViaAPI) {
return static_cast<int>(ReturnCodes::Failure);
} else {
Expand Down
2 changes: 1 addition & 1 deletion tst/EnergyPlus/unit/CommandLineInterface.unit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ TEST_F(CommandLineInterfaceFixture, IdfDoesNotExist)
EXPECT_EQ(static_cast<int>(ReturnCodes::Failure), exitcode);
compare_cout_stream("");
compare_cerr_stream(delimited_string({
fmt::format("input_file: File does not exist: {}", FileSystem::makeNativePath(expectedParams.inputFilePath).string()),
fmt::format("input_file: File does not exist: {}", expectedParams.inputFilePath.generic_string()),
"Run with --help for more information.",
}));
}
Expand Down

5 comments on commit 8279335

@nrel-bot-2b
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

9825_CLI (jmarrec) - x86_64-Linux-Ubuntu-22.04-gcc-11.3: OK (3491 of 3501 tests passed, 0 test warnings)

Failures:\n

integration Test Summary

  • Passed: 768
  • Failed: 10

Build Badge Test Badge

@nrel-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

9825_CLI (jmarrec) - Win64-Windows-10-VisualStudio-16: OK (2677 of 2687 tests passed, 0 test warnings)

Failures:\n

energyplus Test Summary

  • Passed: 3
  • Failed: 1

integration Test Summary

  • Passed: 766
  • Failed: 9

Build Badge Test Badge

@nrel-bot-3
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

9825_CLI (jmarrec) - x86_64-MacOS-10.17-clang-13.0.0: OK (3451 of 3460 tests passed, 0 test warnings)

Failures:\n

integration Test Summary

  • Passed: 766
  • Failed: 9

Build Badge Test Badge

@nrel-bot-2c
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

9825_CLI (jmarrec) - x86_64-Linux-Ubuntu-22.04-gcc-11.3-IntegrationCoverage-Debug: OK (766 of 776 tests passed, 0 test warnings)

Failures:\n

integration Test Summary

  • Passed: 766
  • Failed: 10

Build Badge Test Badge Coverage Badge

@nrel-bot-2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

9825_CLI (jmarrec) - x86_64-Linux-Ubuntu-22.04-gcc-11.3-UnitTestsCoverage-Debug: OK (1914 of 1914 tests passed, 0 test warnings)

Build Badge Test Badge Coverage Badge

Please sign in to comment.