Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonMarechal25 committed Oct 24, 2023
1 parent 8673034 commit bb3768d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/cpp/lpnamer/main/RunProblemGeneration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,12 @@ std::vector<std::shared_ptr<Problem>> getXpansionProblems(
problem_names);
return adapter->provideProblems(solver_name, solver_log_manager);
}
void CreateDirectories(const std::filesystem::path& xpansion_output_path,
void CreateDirectories(const std::filesystem::path& output_path,
ProblemGenerationLog::ProblemGenerationLogger* logger) {
if (!std::filesystem::exists(xpansion_output_path)) {
std::filesystem::create_directories(xpansion_output_path);
if (!std::filesystem::exists(output_path)) {
std::filesystem::create_directories(output_path);
}
auto lp_path = xpansion_output_path / LP_DIRNAME;
auto lp_path = output_path / LP_DIRNAME;
if (!std::filesystem::exists(lp_path)) {
std::filesystem::create_directories(lp_path);
}
Expand Down
7 changes: 3 additions & 4 deletions tests/cpp/lp_namer/ProblemGenerationTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,15 @@
TEST(InitializationTest, FoldersAreCreated) {
auto workingDirectory =
std::filesystem::temp_directory_path() / std::tmpnam(nullptr);
auto simulationDirectory = workingDirectory / "output" / "simulation";
auto simulationDirectory =
workingDirectory / "output" / "simulation-Xpansion";
auto logger = emptyLogger();
std::filesystem::create_directories(simulationDirectory);
EXPECT_THROW(
RunProblemGeneration(simulationDirectory, "integer", "", "", logger,
simulationDirectory / "logs.txt", "", false),
ArchiveIOGeneralException);
auto lp = (simulationDirectory.parent_path() /
(simulationDirectory.filename().string() + "-Xpansion")) /
"lp";
auto lp = (simulationDirectory) / "lp";
EXPECT_TRUE(std::filesystem::exists(lp));
}

Expand Down

0 comments on commit bb3768d

Please sign in to comment.