From d85ad3855d1ef88d2755a2fefbd0ddfdf6613383 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Per=20=C3=96stlund?= Date: Fri, 15 Sep 2017 16:16:59 +0200 Subject: [PATCH] Updated nfinst test cases. --- flattening/modelica/scodeinst/ClassExtends4.mo | 7 +++---- flattening/modelica/scodeinst/Makefile | 14 +++++++------- flattening/modelica/scodeinst/ModClass4.mo | 5 +++-- flattening/modelica/scodeinst/redeclare10.mo | 16 +++++++++------- 4 files changed, 22 insertions(+), 20 deletions(-) diff --git a/flattening/modelica/scodeinst/ClassExtends4.mo b/flattening/modelica/scodeinst/ClassExtends4.mo index 3acc1b8740b..ba9e3f0af3c 100644 --- a/flattening/modelica/scodeinst/ClassExtends4.mo +++ b/flattening/modelica/scodeinst/ClassExtends4.mo @@ -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 diff --git a/flattening/modelica/scodeinst/Makefile b/flattening/modelica/scodeinst/Makefile index f37bbfe0775..48a0b6eb1f8 100644 --- a/flattening/modelica/scodeinst/Makefile +++ b/flattening/modelica/scodeinst/Makefile @@ -26,6 +26,7 @@ ClassAsComponentError.mo \ ClassExtends1.mo \ ClassExtends2.mo \ ClassExtends3.mo \ +ClassExtends4.mo \ ClassExtendsBuiltin1.mo \ ClassExtendsBuiltin2.mo \ ClassExtendsMissing1.mo \ @@ -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 \ @@ -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 \ @@ -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 \ @@ -355,7 +358,6 @@ InvalidVariability1.mo \ InvalidVariability2.mo \ loop4.mo \ MissingRedeclare1.mo \ -mod13.mo \ MultiInheritanceRedeclare1.mo \ MultiInheritanceRedeclare2.mo \ noretcall1.mo \ @@ -363,9 +365,7 @@ PartialInst.mo \ PropagateRedeclareMod1.mo \ Range1.mo \ RecursiveExtends2.mo \ -redeclare10.mo \ redeclare3.mo \ -redeclare4.mo \ redeclare5.mo \ redeclare8.mo \ RedeclaredFunction1.mo \ diff --git a/flattening/modelica/scodeinst/ModClass4.mo b/flattening/modelica/scodeinst/ModClass4.mo index b63a53e43f7..efa29f5d0b7 100644 --- a/flattening/modelica/scodeinst/ModClass4.mo +++ b/flattening/modelica/scodeinst/ModClass4.mo @@ -3,6 +3,7 @@ // status: correct // cflags: -d=newInst // +// model A model B @@ -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 diff --git a/flattening/modelica/scodeinst/redeclare10.mo b/flattening/modelica/scodeinst/redeclare10.mo index 77d347200ca..4c964b28b1a 100644 --- a/flattening/modelica/scodeinst/redeclare10.mo +++ b/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