Skip to content
This repository was archived by the owner on Apr 3, 2019. It is now read-only.

Commit 3c40164

Browse files
perostOpenModelica-Hudson
authored andcommitted
[NF] Add more when tests.
Belonging to [master]: - OpenModelica/OMCompiler#3009 - #1150
1 parent cd7e516 commit 3c40164

2 files changed

Lines changed: 54 additions & 0 deletions

File tree

flattening/modelica/scodeinst/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -818,6 +818,7 @@ When2.mo \
818818
When3.mo \
819819
When4.mo \
820820
When5.mo \
821+
When6.mo \
821822
WhenClocked1.mo \
822823
WhenClockedElse1.mo \
823824
WhenClockedElse2.mo \
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
// name: When6
2+
// keywords:
3+
// status: correct
4+
// cflags: -d=newInst
5+
//
6+
//
7+
8+
model When6
9+
Real a, b, c, d, e, f;
10+
equation
11+
when time > 0 then
12+
a = 1;
13+
b = 2;
14+
c = 3;
15+
d = 4;
16+
e = 5;
17+
f = 6;
18+
elsewhen time > 1 then
19+
c = 1;
20+
e = 2;
21+
a = 3;
22+
b = 4;
23+
f = 5;
24+
d = 6;
25+
end when;
26+
end When6;
27+
28+
// Result:
29+
// class When6
30+
// Real a;
31+
// Real b;
32+
// Real c;
33+
// Real d;
34+
// Real e;
35+
// Real f;
36+
// equation
37+
// when time > 0.0 then
38+
// a = 1.0;
39+
// b = 2.0;
40+
// c = 3.0;
41+
// d = 4.0;
42+
// e = 5.0;
43+
// f = 6.0;
44+
// elsewhen time > 1.0 then
45+
// c = 1.0;
46+
// e = 2.0;
47+
// a = 3.0;
48+
// b = 4.0;
49+
// f = 5.0;
50+
// d = 6.0;
51+
// end when;
52+
// end When6;
53+
// endResult

0 commit comments

Comments
 (0)