Skip to content

Commit

Permalink
add test for ticket:5340
Browse files Browse the repository at this point in the history
  • Loading branch information
adrpo authored and OpenModelica-Hudson committed Feb 15, 2019
1 parent a6d7282 commit 70e6d3a
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
2 changes: 2 additions & 0 deletions simulation/modelica/initialization/Makefile
Expand Up @@ -84,6 +84,8 @@ OverdeterminedInitialization.Fluid.TwoVolumesFullSteadyStatePressureAndTemperatu
redundantInitialEquations.mos \
conflictingStartValues.mos \
conflictingStartValues2.mos \
Ticket5340.mos \


# test that currently fail. Move up when fixed.
# Run make failingtest
Expand Down
38 changes: 38 additions & 0 deletions simulation/modelica/initialization/Ticket5340.mos
@@ -0,0 +1,38 @@
// name: Ticket5340.mos
// keywords: initialization, if equations, terminate
// status: correct
// cflags:
// teardown_command: rm -rf output.log TestInitialTerminate*
//


loadString("
model TestInitialTerminate
Real x(start = 1, fixed=true);
initial equation
if x > 0 then
terminate(\"Terminate should be called at initialization.\");
end if;
equation
der(x) = 1*x;
end TestInitialTerminate;
"); getErrorString();

simulate(TestInitialTerminate); getErrorString();


// Result:
// true
// ""
// record SimulationResult
// resultFile = "TestInitialTerminate_res.mat",
// simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-006, method = 'dassl', fileNamePrefix = 'TestInitialTerminate', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
// messages = "LOG_SUCCESS | info | The initialization finished successfully without homotopy method.
// [<interactive>:6:5-6:63:writable]
// stdout | info | Simulation call terminate() at initialization (time 0.000000)
// | | | | Message : Terminate should be called at initialization.
// LOG_SUCCESS | info | The simulation finished successfully.
// "
// end SimulationResult;
// ""
// endResult

0 comments on commit 70e6d3a

Please sign in to comment.