Skip to content

Commit

Permalink
[NF] Update tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
perost authored and OpenModelica-Hudson committed Feb 5, 2019
1 parent be9c750 commit f44d943
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 9 deletions.
39 changes: 39 additions & 0 deletions flattening/modelica/scodeinst/IfEquation7.mo
@@ -0,0 +1,39 @@
// name: IfEquation7
// keywords:
// status: correct
// cflags: -d=newInst
//

model IfEquation7
Real x;
Real y;
equation
if time > 1 then
x = 1.0;
y = 2.0;
elseif time > 2 then
x = 2.0;
y = 3.0;
else
x = 3.0;
y = 4.0;
end if;
end IfEquation7;

// Result:
// class IfEquation7
// Real x;
// Real y;
// equation
// if time > 1.0 then
// x = 1.0;
// y = 2.0;
// elseif time > 2.0 then
// x = 2.0;
// y = 3.0;
// else
// x = 3.0;
// y = 4.0;
// end if;
// end IfEquation7;
// endResult
1 change: 1 addition & 0 deletions flattening/modelica/scodeinst/Makefile
Expand Up @@ -503,6 +503,7 @@ IfEquation3.mo \
IfEquation4.mo \
IfEquation5.mo \
IfEquation6.mo \
IfEquation7.mo \
IfEquationEval1.mo \
IfEquationEval2.mo \
IfEquationEval3.mo \
Expand Down
2 changes: 1 addition & 1 deletion flattening/modelica/scodeinst/TestSampleNoClock.mos
Expand Up @@ -320,8 +320,8 @@ instantiateModel(Modelica.Blocks.Examples.BooleanNetwork1); getErrorString();
// set1.y = if set1.firstActiveIndex == 0 then if set1.use_pre_as_default then pre(set1.y) else set1.y_default else set1.expr[set1.firstActiveIndex];
// falling.y = edge(falling.not_u);
// changing.y = change(changing.u);
// triggeredAdd.local_reset = false;
// triggeredAdd.local_set = 0;
// triggeredAdd.local_reset = false;
// when {triggeredAdd.trigger, triggeredAdd.local_reset} then
// triggeredAdd.y = if triggeredAdd.local_reset then triggeredAdd.local_set else pre(triggeredAdd.y) + triggeredAdd.u;
// end when;
Expand Down
16 changes: 8 additions & 8 deletions openmodelica/cppruntime/testVectorizedPowerSystem.mos
Expand Up @@ -153,8 +153,8 @@ val(fixedVoltageSource1.p[1], 1.0);
// Equations (5, 5)
// ========================================
// 1/1 (1): system.thetaRef / time = system.omega_internal [dynamic |0|0|0|0|]
// 2/2 (1): system.omega = 314.1592653589793 [dynamic |0|0|0|0|]
// 3/3 (1): system.thetaRef = system.omega * time [dynamic |0|0|0|0|]
// 2/2 (1): system.thetaRef = system.omega * time [dynamic |0|0|0|0|]
// 3/3 (1): system.omega = 314.1592653589793 [dynamic |0|0|0|0|]
// 4/4 (1): 0.0 = -system.thetaRel [unknown |0|0|0|0|]
// 5/5 (1): system.thetaRef = system.theta [binding |0|0|0|0|]
//
Expand Down Expand Up @@ -687,8 +687,8 @@ val(fixedVoltageSource1.p[1], 1.0);
// Equations (5, 5)
// ========================================
// 1/1 (1): system.omega_internal = system.thetaRef / time [dynamic |0|0|0|0|]
// 2/2 (1): system.omega = 314.1592653589793 [dynamic |0|0|0|0|]
// 3/3 (1): system.thetaRef = system.omega * time [dynamic |0|0|0|0|]
// 2/2 (1): system.thetaRef = system.omega * time [dynamic |0|0|0|0|]
// 3/3 (1): system.omega = 314.1592653589793 [dynamic |0|0|0|0|]
// 4/4 (1): system.thetaRel = 0.0 [unknown |0|0|0|0|]
// 5/5 (1): system.theta = system.thetaRef [binding |0|0|0|0|]
//
Expand All @@ -705,17 +705,17 @@ val(fixedVoltageSource1.p[1], 1.0);
// ========================================
// 5 variables and equations
// var 1 is solved in eqn 1
// var 2 is solved in eqn 2
// var 3 is solved in eqn 3
// var 2 is solved in eqn 3
// var 3 is solved in eqn 2
// var 4 is solved in eqn 4
// var 5 is solved in eqn 5
//
//
// StrongComponents
// ========================================
// {4:4}
// {2:2}
// {3:3}
// {3:2}
// {2:3}
// {5:5}
// {1:1}
//
Expand Down

0 comments on commit f44d943

Please sign in to comment.