From 84df13ad70d799b0b5dec87b1fc4edb4952b50c5 Mon Sep 17 00:00:00 2001 From: Dimitri Baron Date: Mon, 18 Nov 2024 13:25:14 +0100 Subject: [PATCH] #428 Addition of unit test on outputIIDM Signed-off-by: Dimitri Baron --- .../DYNRobustnessAnalysisLauncher.cpp | 2 +- .../test/TestRobustnessAnalysisLauncher.cpp | 3 + sources/Launcher/test/res/fic_DYD.xml | 119 +++++++ sources/Launcher/test/res/fic_IIDM.xml | 236 ++++++++++++++ sources/Launcher/test/res/fic_JOB.xml | 27 ++ sources/Launcher/test/res/fic_PAR.xml | 294 ++++++++++++++++++ 6 files changed, 680 insertions(+), 1 deletion(-) create mode 100644 sources/Launcher/test/res/fic_DYD.xml create mode 100644 sources/Launcher/test/res/fic_IIDM.xml create mode 100644 sources/Launcher/test/res/fic_JOB.xml create mode 100644 sources/Launcher/test/res/fic_PAR.xml diff --git a/sources/Launcher/DYNRobustnessAnalysisLauncher.cpp b/sources/Launcher/DYNRobustnessAnalysisLauncher.cpp index 93945a98..c89283be 100644 --- a/sources/Launcher/DYNRobustnessAnalysisLauncher.cpp +++ b/sources/Launcher/DYNRobustnessAnalysisLauncher.cpp @@ -455,7 +455,7 @@ RobustnessAnalysisLauncher::storeOutputs(const SimulationResult& result, std::ma if (!result.getOutputIIDMStreamStr().empty()) { std::stringstream outputIIDMName; - outputIIDMName << "outputIIDM/outputIIDM_" << result.getUniqueScenarioId() << ".xml"; + outputIIDMName << "finalState/outputIIDM_" << result.getUniqueScenarioId() << ".xml"; mapData[outputIIDMName.str()] = result.getOutputIIDMStreamStr(); } diff --git a/sources/Launcher/test/TestRobustnessAnalysisLauncher.cpp b/sources/Launcher/test/TestRobustnessAnalysisLauncher.cpp index 72394db6..9607ba46 100644 --- a/sources/Launcher/test/TestRobustnessAnalysisLauncher.cpp +++ b/sources/Launcher/test/TestRobustnessAnalysisLauncher.cpp @@ -66,16 +66,19 @@ class MyLauncher : public RobustnessAnalysisLauncher { ASSERT_FALSE(exists("res/constraints/constraints_MyScenario.xml")); ASSERT_FALSE(exists("res/timeLine/timeline_MyScenario.log")); ASSERT_FALSE(exists("res/timeLine/timeline_MyScenario.xml")); + ASSERT_FALSE(exists("res/finalState/outputIIDM_MyScenario.xml")); ASSERT_TRUE(exists("res/logs/log_MyScenario.log")); result_.getConstraintsStream() << "Test Constraints"; result_.getTimelineStream() << "Test Timeline"; + result_.getOutputIIDMStream() << "Test final state"; writeResults(); ASSERT_TRUE(exists("res/MyOutputFile.zip")); ASSERT_TRUE(exists("res/constraints/constraints_MyScenario.xml")); ASSERT_TRUE(exists("res/timeLine/timeline_MyScenario.log")); ASSERT_FALSE(exists("res/timeLine/timeline_MyScenario.xml")); + ASSERT_TRUE(exists("res/finalState/outputIIDM_MyScenario.xml")); ASSERT_TRUE(exists("res/logs/log_MyScenario.log")); } diff --git a/sources/Launcher/test/res/fic_DYD.xml b/sources/Launcher/test/res/fic_DYD.xml new file mode 100644 index 00000000..1aca30e4 --- /dev/null +++ b/sources/Launcher/test/res/fic_DYD.xml @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sources/Launcher/test/res/fic_IIDM.xml b/sources/Launcher/test/res/fic_IIDM.xml new file mode 100644 index 00000000..8ecba546 --- /dev/null +++ b/sources/Launcher/test/res/fic_IIDM.xml @@ -0,0 +1,236 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sources/Launcher/test/res/fic_JOB.xml b/sources/Launcher/test/res/fic_JOB.xml new file mode 100644 index 00000000..896bad8b --- /dev/null +++ b/sources/Launcher/test/res/fic_JOB.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + diff --git a/sources/Launcher/test/res/fic_PAR.xml b/sources/Launcher/test/res/fic_PAR.xml new file mode 100644 index 00000000..3f1be3dc --- /dev/null +++ b/sources/Launcher/test/res/fic_PAR.xml @@ -0,0 +1,294 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +