File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed
Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -124,6 +124,40 @@ TEST_CASE("Simulate SBML multiple times", "[copasijs][multiple]")
124124
125125}
126126
127+
128+ TEST_CASE (" Test stepsize in multiple runs" , " [copasijs][multiple]" )
129+ {
130+ Instance instance;
131+ std::string model = loadFromFile (getTestFile (" ../example_files/oscli.xml" ));
132+
133+
134+ nlohmann::ordered_json yaml;
135+ yaml[" problem" ][" OutputStartTime" ] = 0 ;
136+ yaml[" problem" ][" Duration" ] = 10 ;
137+ yaml[" problem" ][" StepSize" ] = 1 ;
138+
139+ auto data = simulateJSON (yaml);
140+ CAPTURE (data);
141+ CAPTURE (getTimeCourseSettings ());
142+ auto json = nlohmann::json::parse (data);
143+ REQUIRE (json[" recorded_steps" ].get <int >() == 11 );
144+
145+ yaml[" problem" ][" OutputStartTime" ] = 10 ;
146+ yaml[" problem" ][" Duration" ] = 20 ;
147+ data = simulateJSON (yaml);
148+ CAPTURE (data);
149+ CAPTURE (getTimeCourseSettings ());
150+ json = nlohmann::json::parse (data);
151+ REQUIRE (json[" recorded_steps" ].get <int >() == 11 );
152+
153+ yaml[" problem" ][" StepSize" ] = 0.1 ;
154+ data = simulateJSON (yaml);
155+ CAPTURE (data);
156+ CAPTURE (getTimeCourseSettings ());
157+ json = nlohmann::json::parse (data);
158+ REQUIRE (json[" recorded_steps" ].get <int >() == 101 );
159+ }
160+
127161TEST_CASE (" Load SBML Model" , " [copasijs][sbml]" )
128162{
129163 Instance instance;
You can’t perform that action at this time.
0 commit comments