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 Sep 7, 2018
1 parent 03dba6e commit ba6ffa5
Show file tree
Hide file tree
Showing 25 changed files with 36 additions and 40 deletions.
2 changes: 1 addition & 1 deletion flattening/modelica/scodeinst/CevalRecordArray2.mo
Expand Up @@ -35,6 +35,6 @@ end CevalRecordArray2;
// end P.f;
//
// class CevalRecordArray2
// Real x = P.f(1.0);
// Real x = 2.0;
// end CevalRecordArray2;
// endResult
2 changes: 1 addition & 1 deletion flattening/modelica/scodeinst/DimSize3.mo
@@ -1,7 +1,7 @@
// name: DimSize3
// keywords:
// status: correct
// cflags: -d=newInst
// cflags: -d=newInst,-nfEvalConstArgFuncs
//

function f
Expand Down
2 changes: 1 addition & 1 deletion flattening/modelica/scodeinst/ExtendsShort2.mo
Expand Up @@ -38,6 +38,6 @@ end ExtendsShort2;
// end P.f2;
//
// class ExtendsShort2
// Real x = ExtendsShort2.f(2.0);
// Real x = 4.0;
// end ExtendsShort2;
// endResult
2 changes: 1 addition & 1 deletion flattening/modelica/scodeinst/ExtendsVisibility5.mo
Expand Up @@ -31,6 +31,6 @@ end ExtendsVisibility5;
// end ExtendsVisibility5.c.f;
//
// class ExtendsVisibility5
// Real x = ExtendsVisibility5.c.f();
// Real x = 1.0;
// end ExtendsVisibility5;
// endResult
6 changes: 3 additions & 3 deletions flattening/modelica/scodeinst/FuncDefaultArg1.mo
Expand Up @@ -16,7 +16,7 @@ end f;

model FuncDefaultArg1
Real x = f(1.0, 2.0, 3.0);
Real y = f(1.0, z = 2.0);
Real y = f(4.0, z = 2.0);
end FuncDefaultArg1;

// Result:
Expand All @@ -28,7 +28,7 @@ end FuncDefaultArg1;
// end f;
//
// class FuncDefaultArg1
// Real x = f(1.0, 2.0, 3.0);
// Real y = f(1.0, 1.0, 2.0);
// Real x = 6.0;
// Real y = 7.0;
// end FuncDefaultArg1;
// endResult
2 changes: 1 addition & 1 deletion flattening/modelica/scodeinst/FuncExtends.mo
Expand Up @@ -24,6 +24,6 @@ end M;
// end f2;
//
// class M
// Real x = f2(1.0);
// Real x = 1.0;
// end M;
// endResult
2 changes: 1 addition & 1 deletion flattening/modelica/scodeinst/FuncLocals.mo
Expand Up @@ -29,6 +29,6 @@ end FuncLocals;
// end f;
//
// class FuncLocals
// Real x = f(4.0);
// Real x = 8.0;
// end FuncLocals;
// endResult
6 changes: 3 additions & 3 deletions flattening/modelica/scodeinst/FuncOverloadMulti.mo
Expand Up @@ -48,8 +48,8 @@ end FuncOverloadMulti;
// end FuncOverloadMulti.real_string;
//
// class FuncOverloadMulti
// String x = FuncOverloadMulti.bool_string(true);
// String y = FuncOverloadMulti.int_string(1);
// String z = FuncOverloadMulti.real_string(1.0);
// String x = "Boolean";
// String y = "Integer";
// String z = "Real";
// end FuncOverloadMulti;
// endResult
2 changes: 1 addition & 1 deletion flattening/modelica/scodeinst/FuncSimple.mo
Expand Up @@ -22,6 +22,6 @@ end FuncSimple;
// end f;
//
// class FuncSimple
// Real x = f(1.0);
// Real x = 1.0;
// end FuncSimple;
// endResult
2 changes: 1 addition & 1 deletion flattening/modelica/scodeinst/FuncUnknownDim2.mo
Expand Up @@ -28,6 +28,6 @@ end FuncUnknownDim2;
// Real x[2];
// Real x[3];
// equation
// x = f(3);
// x = {1.0, 1.0, 1.0};
// end FuncUnknownDim2;
// endResult
4 changes: 2 additions & 2 deletions flattening/modelica/scodeinst/FuncViaComp.mo
Expand Up @@ -22,10 +22,10 @@ end FuncViaComp;
// Result:
// function FuncViaComp.a.f
// input Integer n;
// output Real x = 2;
// output Real x = 2.0;
// end FuncViaComp.a.f;
//
// class FuncViaComp
// Real x = FuncViaComp.a.f(1);
// Real x = 2.0;
// end FuncViaComp;
// endResult
2 changes: 1 addition & 1 deletion flattening/modelica/scodeinst/FuncWildcard.mo
Expand Up @@ -27,6 +27,6 @@ end FuncWildcard;
// end _;
//
// class FuncWildcard
// Real x = _(3.0);
// Real x = 3.0;
// end FuncWildcard;
// endResult
2 changes: 1 addition & 1 deletion flattening/modelica/scodeinst/FunctionExtends1.mo
Expand Up @@ -28,6 +28,6 @@ end M;
// end f2;
//
// class M
// Real x = f2(1.0);
// Real x = 1.0;
// end M;
// endResult
2 changes: 1 addition & 1 deletion flattening/modelica/scodeinst/FunctionMultiOutput1.mo
Expand Up @@ -30,6 +30,6 @@ end FunctionMultiOutput1;
// Real y;
// Real z;
// algorithm
// (x, y, z) := f(2.0);
// (x, y, z) := (4.0, 6.0, 8.0);
// end FunctionMultiOutput1;
// endResult
4 changes: 0 additions & 4 deletions flattening/modelica/scodeinst/FunctionNoOutput1.mo
Expand Up @@ -21,9 +21,5 @@ end FunctionNoOutput1;
// end f;
//
// class FunctionNoOutput1
// equation
// f(2.0);
// algorithm
// f(1.0);
// end FunctionNoOutput1;
// endResult
12 changes: 6 additions & 6 deletions flattening/modelica/scodeinst/FunctionNonInputOutputParameter.mo
@@ -1,4 +1,4 @@
// name: FunctionNoOutput1
// name: FunctionNonInputOutputParameter
// keywords:
// status: correct
// cflags: -d=newInst
Expand All @@ -13,9 +13,9 @@ algorithm
y := a + b + z;
end f;

model M
model FunctionNonInputOutputParameter
parameter Real p = f(1, 2);
end M;
end FunctionNonInputOutputParameter;


// Result:
Expand All @@ -28,9 +28,9 @@ end M;
// y := a + b + z;
// end f;
//
// class M
// parameter Real p = f(1.0, 2.0);
// end M;
// class FunctionNonInputOutputParameter
// parameter Real p = 4.0;
// end FunctionNonInputOutputParameter;
// [flattening/modelica/scodeinst/FunctionNonInputOutputParameter.mo:11:3-11:23:writable] Warning: Invalid public variable z, function variables that are not input/output must be protected.
//
// endResult
2 changes: 1 addition & 1 deletion flattening/modelica/scodeinst/FunctionRecordArg2.mo
Expand Up @@ -36,6 +36,6 @@ end M;
// end f;
//
// class M
// Real x = f();
// Real x = 1.0;
// end M;
// endResult
2 changes: 1 addition & 1 deletion flattening/modelica/scodeinst/FunctionRecursive1.mo
Expand Up @@ -32,6 +32,6 @@ end FunctionRecursive1;
// end fac;
//
// class FunctionRecursive1
// Integer x = fac(5);
// Integer x = 120;
// end FunctionRecursive1;
// endResult
6 changes: 3 additions & 3 deletions flattening/modelica/scodeinst/FunctionRecursive2.mo
Expand Up @@ -6,7 +6,7 @@

function fac
input Integer n;
output Integer o = if n <= 1 then 1 else fac(n - 1);
output Integer o = if n <= 1 then 1 else n * fac(n - 1);
end fac;

model FunctionRecursive2
Expand All @@ -16,10 +16,10 @@ end FunctionRecursive2;
// Result:
// function fac
// input Integer n;
// output Integer o = if n <= 1 then 1 else fac(n - 1);
// output Integer o = if n <= 1 then 1 else n * fac(n - 1);
// end fac;
//
// class FunctionRecursive2
// Integer x = fac(5);
// Integer x = 120;
// end FunctionRecursive2;
// endResult
2 changes: 1 addition & 1 deletion flattening/modelica/scodeinst/ImportUnqualified3.mo
Expand Up @@ -29,6 +29,6 @@ end ImportUnqualified3;
// end A.B.f;
//
// class ImportUnqualified3
// parameter Real x = A.B.f(100.0);
// parameter Real x = 100.0;
// end ImportUnqualified3;
// endResult
@@ -1,7 +1,7 @@
// name: OperatorOverloadConstructor1
// keywords: operator overload constructor
// status: correct
// cflags: -d=newInst
// cflags: -d=newInst,-nfEvalConstArgFuncs
//
//

Expand Down
@@ -1,7 +1,7 @@
// name: OperatorOverloadConstructorHideDefault
// keywords: operator overload constructor
// status: correct
// cflags: -d=newInst
// cflags: -d=newInst,-nfEvalConstArgFuncs
//
// Checks that overloaded constructor has precedence over deafault constructor
// which would otherwise cause ambiguity.
Expand Down
@@ -1,7 +1,7 @@
// name: OperatorOverloadConstructorSimple
// keywords: operator constructor overload
// status: correct
// cflags: -d=newInst
// cflags: -d=newInst,-nfEvalConstArgFuncs
//
// Tests simple overloaded construction.
//
Expand Down
2 changes: 1 addition & 1 deletion flattening/modelica/scodeinst/PackageConstant1.mo
@@ -1,7 +1,7 @@
// name: PackageConstant1
// keywords:
// status: correct
// cflags: -d=newInst
// cflags: -d=newInst,-nfEvalConstArgFuncs
//

package P
Expand Down
2 changes: 1 addition & 1 deletion flattening/modelica/scodeinst/Wild1.mo
Expand Up @@ -24,6 +24,6 @@ end Wild1;
// class Wild1
// Real x;
// algorithm
// (_, x) := f();
// (_, x) := (1.0, 2.0);
// end Wild1;
// endResult

0 comments on commit ba6ffa5

Please sign in to comment.