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 May 22, 2018
1 parent bc4d228 commit adbecab
Show file tree
Hide file tree
Showing 21 changed files with 88 additions and 82 deletions.
10 changes: 6 additions & 4 deletions flattening/modelica/scodeinst/CevalAcos2.mo
@@ -1,6 +1,6 @@
// name: CevalAcos2
// keywords:
// status: correct
// status: incorrect
// cflags: -d=newInst
//
//
Expand All @@ -10,9 +10,11 @@ model CevalAcos2
end CevalAcos2;

// Result:
// class CevalAcos2
// constant Real r1 = acos(1.3);
// end CevalAcos2;
// Error processing file: CevalAcos2.mo
// [flattening/modelica/scodeinst/CevalAcos2.mo:9:3-9:31:writable] Error: Argument 1.3 of acos is out of range (-1 <= x <= 1)
//
// # Error encountered! Exiting...
// # Please check the error message and the flags.
//
// Execution failed!
// endResult
10 changes: 6 additions & 4 deletions flattening/modelica/scodeinst/CevalLog102.mo
@@ -1,6 +1,6 @@
// name: CevalLog102
// keywords:
// status: correct
// status: incorrect
// cflags: -d=newInst
//
//
Expand All @@ -10,9 +10,11 @@ model CevalLog102
end CevalLog102;

// Result:
// class CevalLog102
// constant Real r1 = log10(-1.0);
// end CevalLog102;
// Error processing file: CevalLog102.mo
// [flattening/modelica/scodeinst/CevalLog102.mo:9:3-9:31:writable] Error: Argument -1 of log10 is out of range (x > 0)
//
// # Error encountered! Exiting...
// # Please check the error message and the flags.
//
// Execution failed!
// endResult
10 changes: 6 additions & 4 deletions flattening/modelica/scodeinst/CevalLog2.mo
@@ -1,6 +1,6 @@
// name: CevalLog2
// keywords:
// status: correct
// status: incorrect
// cflags: -d=newInst
//
//
Expand All @@ -10,9 +10,11 @@ model CevalLog2
end CevalLog2;

// Result:
// class CevalLog2
// constant Real r1 = log(-1.0);
// end CevalLog2;
// Error processing file: CevalLog2.mo
// [flattening/modelica/scodeinst/CevalLog2.mo:9:3-9:29:writable] Error: Argument -1 of log is out of range (x > 0)
//
// # Error encountered! Exiting...
// # Please check the error message and the flags.
//
// Execution failed!
// endResult
4 changes: 2 additions & 2 deletions flattening/modelica/scodeinst/FuncBuiltinAbs.mo
Expand Up @@ -14,8 +14,8 @@ end FuncBuiltinAbs;

// Result:
// class FuncBuiltinAbs
// Real r1 = abs(-2.0);
// Integer r2 = abs(3);
// Real r1 = 2.0;
// Integer r2 = 3;
// Real r3 = abs(r1 - /*Real*/(r2));
// end FuncBuiltinAbs;
// endResult
4 changes: 2 additions & 2 deletions flattening/modelica/scodeinst/FuncBuiltinCeil.mo
Expand Up @@ -14,8 +14,8 @@ end FuncBuiltinCeil;

// Result:
// class FuncBuiltinCeil
// Real r1 = ceil(4.25);
// Real r2 = ceil(-7.9);
// Real r1 = 5.0;
// Real r2 = -7.0;
// Real r3 = ceil(r1 / r2);
// end FuncBuiltinCeil;
// endResult
6 changes: 3 additions & 3 deletions flattening/modelica/scodeinst/FuncBuiltinDiv.mo
Expand Up @@ -14,8 +14,8 @@ end FuncBuiltinDiv;

// Result:
// class FuncBuiltinDiv
// Integer r1 = div(6, 2);
// Real r2 = div(8.0, 1.5);
// Real r3 = div(25.0, 4.0);
// Integer r1 = 3;
// Real r2 = 5.0;
// Real r3 = 6.0;
// end FuncBuiltinDiv;
// endResult
4 changes: 2 additions & 2 deletions flattening/modelica/scodeinst/FuncBuiltinFloor.mo
Expand Up @@ -14,8 +14,8 @@ end FuncBuiltinFloor;

// Result:
// class FuncBuiltinFloor
// Real r1 = floor(4.25);
// Real r2 = floor(-7.9);
// Real r1 = 4.0;
// Real r2 = -8.0;
// Real r3 = floor(r1 / r2);
// end FuncBuiltinFloor;
// endResult
4 changes: 2 additions & 2 deletions flattening/modelica/scodeinst/FuncBuiltinInteger.mo
Expand Up @@ -14,8 +14,8 @@ end FuncBuiltinInteger;

// Result:
// class FuncBuiltinInteger
// Integer r1 = integer(4.25);
// Integer r2 = integer(-9.9);
// Integer r1 = 4;
// Integer r2 = -10;
// Integer r3 = integer(/*Real*/(r1) / /*Real*/(r2));
// end FuncBuiltinInteger;
// endResult
22 changes: 11 additions & 11 deletions flattening/modelica/scodeinst/FuncBuiltinMath.mo
Expand Up @@ -24,18 +24,18 @@ end FuncBuiltinMath;

// Result:
// class FuncBuiltinMath
// Real r1 = sin(4.0);
// Real r2 = cos(-2.0);
// Real r3 = tan(1.0);
// Real r1 = -0.7568024953079282;
// Real r2 = -0.4161468365471424;
// Real r3 = 1.557407724654902;
// Real r4 = asin(r1);
// Real r5 = acos(r2 * r3);
// Real r6 = atan(2.0);
// Real r7 = atan2(3.0, 2.0);
// Real r8 = sinh(4.0);
// Real r9 = cosh(23.0);
// Real r10 = tanh(3.0);
// Real r11 = exp(4.5);
// Real r12 = log(1024.0);
// Real r13 = log10(250.0);
// Real r6 = 1.10714871779409;
// Real r7 = 0.9827937232473291;
// Real r8 = 27.28991719712775;
// Real r9 = 4872401723.124452;
// Real r10 = 0.9950547536867305;
// Real r11 = 90.01713130052181;
// Real r12 = 6.931471805599453;
// Real r13 = 2.397940008672037;
// end FuncBuiltinMath;
// endResult
16 changes: 8 additions & 8 deletions flattening/modelica/scodeinst/FuncBuiltinMax.mo
Expand Up @@ -28,17 +28,17 @@ end FuncBuiltinMax;

// Result:
// class FuncBuiltinMax
// Real r1 = max(4.0, 2.0);
// Real r2 = max({3.0, 1.0, 2.0});
// Real r1 = 4.0;
// Real r2 = 3.0;
// Real r3 = max(r1, r2);
// Integer i1 = max(5, 6);
// Integer i2 = max({4, 2, 1});
// Integer i1 = 6;
// Integer i2 = 4;
// Integer i3 = max(i2, i1);
// Boolean b1 = max(true, false);
// Boolean b2 = max({false, true});
// Boolean b1 = true;
// Boolean b2 = true;
// Boolean b3 = max(b1, b2);
// enumeration(one, two, three) e1 = max(E.one, E.three);
// enumeration(one, two, three) e2 = max({E.one, E.two, E.three});
// enumeration(one, two, three) e1 = E.three;
// enumeration(one, two, three) e2 = E.three;
// enumeration(one, two, three) e3 = max(e1, e2);
// end FuncBuiltinMax;
// endResult
16 changes: 8 additions & 8 deletions flattening/modelica/scodeinst/FuncBuiltinMin.mo
Expand Up @@ -28,17 +28,17 @@ end FuncBuiltinMin;

// Result:
// class FuncBuiltinMin
// Real r1 = min(4.0, 2.0);
// Real r2 = min({3.0, 1.0, 2.0});
// Real r1 = 2.0;
// Real r2 = 1.0;
// Real r3 = min(r1, r2);
// Integer i1 = min(5, 6);
// Integer i2 = min({4, 2, 1});
// Integer i1 = 5;
// Integer i2 = 1;
// Integer i3 = min(i2, i1);
// Boolean b1 = min(true, false);
// Boolean b2 = min({false, true});
// Boolean b1 = false;
// Boolean b2 = false;
// Boolean b3 = min(b1, b2);
// enumeration(one, two, three) e1 = min(E.one, E.three);
// enumeration(one, two, three) e2 = min({E.one, E.two, E.three});
// enumeration(one, two, three) e1 = E.one;
// enumeration(one, two, three) e2 = E.one;
// enumeration(one, two, three) e3 = min(e1, e2);
// end FuncBuiltinMin;
// endResult
6 changes: 3 additions & 3 deletions flattening/modelica/scodeinst/FuncBuiltinMod.mo
Expand Up @@ -14,8 +14,8 @@ end FuncBuiltinMod;

// Result:
// class FuncBuiltinMod
// Integer r1 = mod(7, 3);
// Real r2 = mod(8.0, 3.0);
// Real r3 = mod(12.0, 4.5);
// Integer r1 = 1;
// Real r2 = 2.0;
// Real r3 = 3.0;
// end FuncBuiltinMod;
// endResult
6 changes: 3 additions & 3 deletions flattening/modelica/scodeinst/FuncBuiltinProduct.mo
Expand Up @@ -15,9 +15,9 @@ end FuncBuiltinProduct;

// Result:
// class FuncBuiltinProduct
// Real r1 = /*Real*/(product({1, 2, 3}));
// Real r2 = /*Real*/(product({{1}, {2}, {3}}));
// Real r3 = /*Real*/(product({{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}));
// Real r1 = 6.0;
// Real r2 = 6.0;
// Real r3 = 362880.0;
// Real r4 = /*Real*/(product(1:0));
// end FuncBuiltinProduct;
// endResult
6 changes: 3 additions & 3 deletions flattening/modelica/scodeinst/FuncBuiltinRem.mo
Expand Up @@ -14,8 +14,8 @@ end FuncBuiltinRem;

// Result:
// class FuncBuiltinRem
// Real r1 = /*Real*/(rem(5, 2));
// Real r2 = rem(5.0, 2.0);
// Real r3 = rem(8.0, 3.0);
// Real r1 = 1.0;
// Real r2 = 1.0;
// Real r3 = 2.0;
// end FuncBuiltinRem;
// endResult
6 changes: 3 additions & 3 deletions flattening/modelica/scodeinst/FuncBuiltinScalar.mo
Expand Up @@ -14,8 +14,8 @@ end FuncBuiltinScalar;

// Result:
// class FuncBuiltinScalar
// Real r1 = /*Real*/(scalar({{1}}));
// Real r2 = /*Real*/(scalar(4));
// Real r3 = /*Real*/(scalar({{{{5}}}}));
// Real r1 = 1.0;
// Real r2 = 4.0;
// Real r3 = 5.0;
// end FuncBuiltinScalar;
// endResult
4 changes: 2 additions & 2 deletions flattening/modelica/scodeinst/FuncBuiltinSign.mo
Expand Up @@ -14,8 +14,8 @@ end FuncBuiltinSign;

// Result:
// class FuncBuiltinSign
// Integer r1 = sign(-6.0);
// Integer r2 = sign(4.0);
// Integer r1 = -1;
// Integer r2 = 1;
// Integer r3 = sign(/*Real*/(r1 + r2));
// end FuncBuiltinSign;
// endResult
2 changes: 1 addition & 1 deletion flattening/modelica/scodeinst/FuncBuiltinSize.mo
Expand Up @@ -31,6 +31,6 @@ end FuncBuiltinSize;
// Integer i5[2];
// Integer i5[3];
// equation
// i5 = size(x);
// i5 = {1, 2, 3};
// end FuncBuiltinSize;
// endResult
4 changes: 2 additions & 2 deletions flattening/modelica/scodeinst/FuncBuiltinSqrt.mo
Expand Up @@ -14,8 +14,8 @@ end FuncBuiltinSqrt;

// Result:
// class FuncBuiltinSqrt
// Real r1 = sqrt(25.0);
// Real r2 = sqrt(15.4);
// Real r1 = 5.0;
// Real r2 = 3.924283374069717;
// Real r3 = sqrt(r1 + r2);
// end FuncBuiltinSqrt;
// endResult
14 changes: 7 additions & 7 deletions flattening/modelica/scodeinst/FuncBuiltinSum.mo
Expand Up @@ -6,18 +6,18 @@
// Tests the builtin sum operator.
//

model FuncBuiltinMax
model FuncBuiltinSum
Real r1 = sum({1, 2, 3});
Real r2 = sum({{1}, {2}, {3}});
Real r3 = sum({{1, 2, 3}, {4, 5, 6}, {7, 8, 9}});
Real r4 = sum(1:0);
end FuncBuiltinMax;
end FuncBuiltinSum;

// Result:
// class FuncBuiltinMax
// Real r1 = /*Real*/(sum({1, 2, 3}));
// Real r2 = /*Real*/(sum({{1}, {2}, {3}}));
// Real r3 = /*Real*/(sum({{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}));
// class FuncBuiltinSum
// Real r1 = 6.0;
// Real r2 = 6.0;
// Real r3 = 45.0;
// Real r4 = /*Real*/(sum(1:0));
// end FuncBuiltinMax;
// end FuncBuiltinSum;
// endResult
2 changes: 1 addition & 1 deletion flattening/modelica/scodeinst/FuncInteger.mo
Expand Up @@ -17,7 +17,7 @@ end FuncInteger;
// Result:
// class FuncInteger
// enumeration(one, two, three) e = E.two;
// Integer i = Integer(E.one);
// Integer i = 1;
// Integer j = Integer(e);
// end FuncInteger;
// endResult
14 changes: 7 additions & 7 deletions flattening/modelica/scodeinst/FuncString.mo
Expand Up @@ -20,12 +20,12 @@ end FuncString;

// Result:
// class FuncString
// String s1 = String(1, 0, true);
// String s2 = String(E.one, 0, true);
// String s3 = String(true, 0, true);
// String s4 = String(1.0, 6, 0, true);
// String s5 = String(1.0, 3, 0, true);
// String s6 = String(1.0, "-0.4g");
// String s7 = String(1, 3, false);
// String s1 = "1";
// String s2 = "one";
// String s3 = "true";
// String s4 = "1";
// String s5 = "1";
// String s6 = "-0.4g";
// String s7 = " 1";
// end FuncString;
// endResult

0 comments on commit adbecab

Please sign in to comment.