From 85c5e556013f5a780821759772adfc148e4111bb Mon Sep 17 00:00:00 2001 From: philippun Date: Wed, 2 Aug 2023 13:19:33 +0200 Subject: [PATCH] fixed a bug that returned the wrong grid to the test method --- include/tug/Simulation.hpp | 6 +++--- src/Simulation.cpp | 4 +++- test/testSimulation.cpp | 4 +--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/tug/Simulation.hpp b/include/tug/Simulation.hpp index f7cbfd3..bf6cbdc 100644 --- a/include/tug/Simulation.hpp +++ b/include/tug/Simulation.hpp @@ -103,11 +103,11 @@ class Simulation { void printConcentrationsCSV(string filename); /** - * @brief Start the simulation with all of the previously set parameters. + * @brief * - * @return auto + * @return Grid */ - void run(); + Grid run(); private: diff --git a/src/Simulation.cpp b/src/Simulation.cpp index 07e27a4..d984bb0 100644 --- a/src/Simulation.cpp +++ b/src/Simulation.cpp @@ -146,7 +146,7 @@ void Simulation::printConcentrationsCSV(string filename) { file.close(); } -void Simulation::run() { +Grid Simulation::run() { string filename; if (this->console_output > CONSOLE_OUTPUT_OFF) { printConcentrationsConsole(); @@ -191,4 +191,6 @@ void Simulation::run() { if (this->csv_output > CSV_OUTPUT_OFF) { printConcentrationsCSV(filename); } + + return grid; } diff --git a/test/testSimulation.cpp b/test/testSimulation.cpp index c0810ee..59ae8f6 100644 --- a/test/testSimulation.cpp +++ b/test/testSimulation.cpp @@ -50,9 +50,7 @@ static Grid setupSimulation() { // RUN - sim.run(); - - return grid; + return sim.run(); } TEST_CASE("equality to reference matrix") {