Skip to content

Commit

Permalink
Update nfinst tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
perost authored and OpenModelica-Hudson committed Nov 29, 2017
1 parent 4e49f31 commit e2f94fe
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
4 changes: 4 additions & 0 deletions flattening/modelica/scodeinst/FuncBuiltinChange.mo
Expand Up @@ -9,11 +9,15 @@
model FuncBuiltinChange
discrete Real x;
Boolean y = change(x);
Boolean b;
Boolean z = change(b);
end FuncBuiltinChange;

// Result:
// class FuncBuiltinChange
// discrete Real x;
// Boolean y = change(x);
// Boolean b;
// Boolean z = change(b);
// end FuncBuiltinChange;
// endResult
4 changes: 4 additions & 0 deletions flattening/modelica/scodeinst/FuncBuiltinPre.mo
Expand Up @@ -9,11 +9,15 @@
model FuncBuiltinPre
discrete Real x;
Real y = pre(x);
Integer i;
Real z = pre(i);
end FuncBuiltinPre;

// Result:
// class FuncBuiltinPre
// discrete Real x;
// Real y = pre(x);
// Integer i;
// Real z = pre(i);
// end FuncBuiltinPre;
// endResult
8 changes: 4 additions & 4 deletions flattening/modelica/scodeinst/ReinitInvalid1.mo
Expand Up @@ -5,16 +5,16 @@
//

class ReinitInvalid1
Boolean b(start = false);
discrete Real x = 1.0;
equation
when b then
reinit(b, true);
when time > 1.0 then
reinit(x, 2.0);
end when;
end ReinitInvalid1;

// Result:
// Error processing file: ReinitInvalid1.mo
// [flattening/modelica/scodeinst/ReinitInvalid1.mo:11:5-11:20:writable] Error: The first argument to reinit must be a subtype of Real, but b has type Boolean.
// [flattening/modelica/scodeinst/ReinitInvalid1.mo:11:5-11:19:writable] Error: The first argument to reinit must be a continuous time variable, but x is discrete.
//
// # Error encountered! Exiting...
// # Please check the error message and the flags.
Expand Down

0 comments on commit e2f94fe

Please sign in to comment.