Skip to content

Commit

Permalink
test for ticket:4365
Browse files Browse the repository at this point in the history
  • Loading branch information
adrpo authored and OpenModelica-Hudson committed Apr 21, 2017
1 parent 3be9952 commit 3c3326e
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 0 deletions.
1 change: 1 addition & 0 deletions flattening/modelica/algorithms-functions/Makefile
Expand Up @@ -96,6 +96,7 @@ Summation.mo \
SumSeriesWhile.mo \
SumVectorForIf.mo \
TestGravityAcceleration.mo \
Ticket4365.mos \
TupleError.mo \
TupleSingleAssign.mo \
TupleAssignmentMismatch1.mo \
Expand Down
24 changes: 24 additions & 0 deletions flattening/modelica/algorithms-functions/Ticket4365.mo
@@ -0,0 +1,24 @@
package Ticket4365
model Top
inner Real a;
Sub1 s1;

initial algorithm
a := 0;

algorithm
when time > 1 then
a := 1;
end when;
end Top;


model Sub1
outer Real a;
algorithm
when time > 2 then
a := 2;
end when;
end Sub1;

end Ticket4365;
29 changes: 29 additions & 0 deletions flattening/modelica/algorithms-functions/Ticket4365.mos
@@ -0,0 +1,29 @@
// name: Ticket4365.mos
// keywords: equation,when,inner/outer
// status: correct
//
// Test for handling of inner/outer in algorithms
//

loadFile("Ticket4365.mo"); getErrorString();
instantiateModel(Ticket4365.Top); getErrorString();

// Result:
// true
// ""
// "class Ticket4365.Top
// Real a;
// initial algorithm
// a := 0.0;
// algorithm
// when time > 2.0 then
// a := 2.0;
// end when;
// algorithm
// when time > 1.0 then
// a := 1.0;
// end when;
// end Ticket4365.Top;
// "
// ""
// endResult

0 comments on commit 3c3326e

Please sign in to comment.