Skip to content

Commit

Permalink
Added test for ticket 3477
Browse files Browse the repository at this point in the history
  • Loading branch information
lochel committed Sep 26, 2015
1 parent 8c1ea11 commit 535508d
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
1 change: 1 addition & 0 deletions simulation/modelica/algorithms_functions/Makefile
Expand Up @@ -29,6 +29,7 @@ LocalVariableInit.mos \
ModelicaTest.Fluid.Dissipation.Verifications.HeatTransfer.Channel.kc_evenGapLaminar.mos \
SimplePeriodicSampler.mos \
SumSeriesWhile.mos \
ticket-3477.mos \
TupleReturn.mos \
val.mos \
whenDiscreteForLoop.mos \
Expand Down
2 changes: 1 addition & 1 deletion simulation/modelica/algorithms_functions/algorithms.mos
Expand Up @@ -2,7 +2,7 @@
// keywords: Simulate, readSimulationData
// status: correct
// teardown_command: rm -rf Alg1 Alg1.* Alg1_* Alg2 Alg2.* Alg2_* Alg3 Alg3.* Alg3_* output.log
//
//
// Simulate model containing algortithms and read in data.
//

Expand Down
29 changes: 29 additions & 0 deletions simulation/modelica/algorithms_functions/ticket-3477.mos
@@ -0,0 +1,29 @@
// name: ticket-3477
// keywords: algorithm, #3477
// status: correct

loadString("
model ticket_3477
Real x(start=0.1);
algorithm
if initial() then
x := cos(time);
end if;
end ticket_3477;
"); getErrorString();

simulate(ticket_3477); getErrorString();
val(x, 0.5); getErrorString();

// Result:
// true
// ""
// record SimulationResult
// resultFile = "ticket_3477_res.mat",
// simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'ticket_3477', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
// messages = ""
// end SimulationResult;
// ""
// 0.1
// ""
// endResult

0 comments on commit 535508d

Please sign in to comment.