Skip to content

Commit

Permalink
Added failing test for state machines
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhard-thiele authored and OpenModelica-Hudson committed Sep 12, 2017
1 parent 91a80a7 commit 8aeeac1
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
22 changes: 22 additions & 0 deletions simulation/modelica/statemachines/ConferenceTut1DeadEnd.mo
@@ -0,0 +1,22 @@
model ConferenceTut1DeadEnd "ConferenceTut1 example but without returning transition"
inner Integer i(start=0);
model State1
outer output Integer i;
equation
i = previous(i) + 2;
end State1;
State1 state1;
model State2
outer output Integer i;
equation
i = previous(i) - 1;
end State2;
State2 state2;
equation
initialState(state1);
transition(
state1,
state2,
i > 10,
immediate=false);
end ConferenceTut1DeadEnd;
16 changes: 16 additions & 0 deletions simulation/modelica/statemachines/ConferenceTut1DeadEnd.mos
@@ -0,0 +1,16 @@
// name: ConferenceTut1DeadEnd
// keywords: state machines
// status: correct
//

loadFile("ConferenceTut1DeadEnd.mo");
echo(false);
simulate(ConferenceTut1DeadEnd, startTime=0, stopTime=30, numberOfIntervals = 0); getErrorString();
echo(true);
val(i,30.0);

// Result:
// true
// true
// -13.0
// endResult
1 change: 1 addition & 0 deletions simulation/modelica/statemachines/Makefile
Expand Up @@ -16,6 +16,7 @@ EnteringByReset.mos \
FAILINGTESTFILES = \
SingleState.mos \
AccessFromOutside.mos \
ConferenceTut1DeadEnd.mos \

# Dependency files that are not .mo .mos or Makefile
# Add them here or they will be cleaned.
Expand Down

0 comments on commit 8aeeac1

Please sign in to comment.