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

Commit

Permalink
[NF] Add Clock constructor tests.
Browse files Browse the repository at this point in the history
Belonging to [master]:
  - OpenModelica/OMCompiler#2737
  - #1059
  • Loading branch information
perost authored and OpenModelica-Hudson committed Oct 24, 2018
1 parent 56d43b7 commit aa010e9
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
35 changes: 35 additions & 0 deletions flattening/modelica/scodeinst/ClockConstructor1.mo
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// name: ClockConstructor1
// keywords:
// status: correct
// cflags: -d=newInst
//

model ClockConstructor1
Clock c1 = Clock();
Clock c2 = Clock(1);
Clock c3 = Clock(1, 2);
Clock c4 = Clock(intervalCounter = 1, resolution = 2);
Clock c5 = Clock(1.0);
Clock c6 = Clock(interval = 2.0);
Clock c7 = Clock(time < 1);
Clock c8 = Clock(time < 1, 1.0);
Clock c9 = Clock(condition = time < 1, startInterval = 0.5);
Clock c10 = Clock(c2, "ImplicitTrapezoid");
Clock c11 = Clock(c = c3, solverMethod = "");
end ClockConstructor1;

// Result:
// class ClockConstructor1
// Clock c1 = Clock();
// Clock c2 = Clock(1, 1);
// Clock c3 = Clock(1, 2);
// Clock c4 = Clock(1, 2);
// Clock c5 = Clock(1.0);
// Clock c6 = Clock(2.0);
// Clock c7 = Clock(time < 1.0, 0.0);
// Clock c8 = Clock(time < 1.0, 1.0);
// Clock c9 = Clock(time < 1.0, 0.5);
// Clock c10 = Clock(c2, "ImplicitTrapezoid");
// Clock c11 = Clock(c3, "");
// end ClockConstructor1;
// endResult
1 change: 1 addition & 0 deletions flattening/modelica/scodeinst/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ ClassMod3.mo \
ClassMod4.mo \
ClassMod5.mo \
ClassMod6.mo \
ClockConstructor1.mo \
Comment1.mo \
CompAsFunc.mo \
ComponentAsTypeError.mo \
Expand Down

0 comments on commit aa010e9

Please sign in to comment.