Skip to content

Commit 43c7a2d

Browse files
committed
[NF] Add unit checking test case for empty when.
1 parent 6b91544 commit 43c7a2d

File tree

3 files changed

+35
-1
lines changed

3 files changed

+35
-1
lines changed

testsuite/simulation/modelica/NFunitcheck/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ UnitCheck14.mos \
1818
UnitCheck15.mos \
1919
UnitCheck16.mos \
2020
UnitCheck17.mos \
21-
Unitcheck18.mos \
21+
UnitCheck18.mos \
22+
UnitCheck19.mos \
2223
ticket3631.mos \
2324

2425

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// name: UnitCheck19
2+
// keywords: initialization
3+
// status: correct
4+
5+
6+
loadString("
7+
model UnitCheck19
8+
equation
9+
when time > 0 then
10+
end when;
11+
end UnitCheck19;
12+
"); getErrorString();
13+
14+
setCommandLineOptions("-d=frontEndUnitCheck,dumpUnits,newInst");
15+
getErrorString();
16+
instantiateModel(UnitCheck19);
17+
getErrorString();
18+
19+
// Result:
20+
// true
21+
// ""
22+
// true
23+
// ""
24+
// HashTable:
25+
// ######## UnitCheck COMPLETED ########
26+
// "class UnitCheck19
27+
// equation
28+
// when time > 0.0 then
29+
// end when;
30+
// end UnitCheck19;
31+
// "
32+
// ""
33+
// endResult

0 commit comments

Comments
 (0)