Skip to content

Commit

Permalink
Updated nfinst test cases.
Browse files Browse the repository at this point in the history
  • Loading branch information
perost authored and OpenModelica-Hudson committed Sep 15, 2017
1 parent 0905287 commit d85ad38
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 20 deletions.
7 changes: 3 additions & 4 deletions flattening/modelica/scodeinst/ClassExtends4.mo
Expand Up @@ -39,16 +39,15 @@ end ClassExtends4;

// Result:
// function SingleGasNasa.specificEnthalpy
// input Real state.p;
// input Real state.T;
// input ThermodynamicState state;
// output Real h;
// algorithm
// h := state.T;
// end SingleGasNasa.specificEnthalpy;
//
// class M
// class ClassExtends4
// Real state.p = 1.0;
// Real state.T = 2.0;
// Real x = SingleGasNasa.specificEnthalpy(state);
// end M;
// end ClassExtends4;
// endResult
14 changes: 7 additions & 7 deletions flattening/modelica/scodeinst/Makefile
Expand Up @@ -26,6 +26,7 @@ ClassAsComponentError.mo \
ClassExtends1.mo \
ClassExtends2.mo \
ClassExtends3.mo \
ClassExtends4.mo \
ClassExtendsBuiltin1.mo \
ClassExtendsBuiltin2.mo \
ClassExtendsMissing1.mo \
Expand Down Expand Up @@ -188,13 +189,17 @@ mod1.mo \
mod10.mo \
mod11.mo \
mod12.mo \
mod13.mo \
mod4.mo \
mod5.mo \
mod6.mo \
mod8.mo \
mod9.mo \
ModClass1.mo \
ModClass2.mo \
ModClass3.mo \
ModClass4.mo \
ModClass5.mo \
ModClass6.mo \
NonexistentRedeclareModifier1.mo \
NonexistentRedeclareModifier2.mo \
Expand All @@ -214,10 +219,12 @@ RedeclareElementComp1.mo \
RedeclareElementMissing1.mo \
RedeclareElementMissing2.mo \
redeclare1.mo \
redeclare10.mo \
redeclare11.mo \
redeclare12.mo \
redeclare13.mo \
redeclare2.mo \
redeclare4.mo \
redeclare6.mo \
redeclare7.mo \
redeclare9.mo \
Expand Down Expand Up @@ -251,10 +258,6 @@ DuplicateElements6.mo \
DuplicateElements7.mo \
DuplicateElements8.mo \
DuplicateElementsValid2.mo \
ClassExtends4.mo \
ModClass2.mo \
ModClass4.mo \
ModClass5.mo \
DuplicateElementsCond1.mo \
ceval4.mo \
cond1.mo \
Expand Down Expand Up @@ -355,17 +358,14 @@ InvalidVariability1.mo \
InvalidVariability2.mo \
loop4.mo \
MissingRedeclare1.mo \
mod13.mo \
MultiInheritanceRedeclare1.mo \
MultiInheritanceRedeclare2.mo \
noretcall1.mo \
PartialInst.mo \
PropagateRedeclareMod1.mo \
Range1.mo \
RecursiveExtends2.mo \
redeclare10.mo \
redeclare3.mo \
redeclare4.mo \
redeclare5.mo \
redeclare8.mo \
RedeclaredFunction1.mo \
Expand Down
5 changes: 3 additions & 2 deletions flattening/modelica/scodeinst/ModClass4.mo
Expand Up @@ -3,6 +3,7 @@
// status: correct
// cflags: -d=newInst
//
//

model A
model B
Expand Down Expand Up @@ -30,7 +31,7 @@ end ModClass4;
// class ModClass4
// Real a1.c.x = 1.0;
// Real a1.b.c.x = 1.0;
// Real a2.c.x = 1.0;
// Real a2.b.c.x = 1.0;
// Real a2.c.x;
// Real a2.b.c.x;
// end ModClass4;
// endResult
16 changes: 9 additions & 7 deletions flattening/modelica/scodeinst/redeclare10.mo
@@ -1,29 +1,31 @@
// name: redeclare10.mo
// name: redeclare10
// keywords:
// status: correct
// cflags: -d=newInst
// cflags: -d=newInst
//
//

package B
constant Real x = 1.0;
constant Real y = 3.0;
constant Integer x = 1;
constant Integer y = 3;
end B;

model C
replaceable package A
constant Real x = 2.0;
constant Integer x = 2;
end A;
end C;

model D
extends C(redeclare package A = B);

Real x = A.y;
Real x[A.y];
end D;

// Result:
// class D
// Real x = 3.0;
// Real x[1];
// Real x[2];
// Real x[3];
// end D;
// endResult

0 comments on commit d85ad38

Please sign in to comment.