Skip to content

Commit

Permalink
activate some NF inst tests
Browse files Browse the repository at this point in the history
- activate two class extends tests (classextends3.mo still has issues)
- add a new test PropagateExtends.mo (the NF does bad instantiation on it)
  • Loading branch information
adrpo authored and OpenModelica-Hudson committed Feb 22, 2017
1 parent 5ccc2d5 commit 2c4425c
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 3 deletions.
4 changes: 2 additions & 2 deletions flattening/modelica/scodeinst/Makefile
Expand Up @@ -17,6 +17,8 @@ dim3.mo \
dim8.mo \
dim13.mo \
ClassAsComponentError.mo \
classextends1.mo \
classextends2.mo \
ComponentAsTypeError.mo \
cond4.mo \
conn1.mo \
Expand Down Expand Up @@ -168,8 +170,6 @@ type1.mo \
type3.mo \
type4.mo \
type5.mo \
classextends1.mo \
classextends2.mo \
classextends3.mo \
inst1.mo \
PropagateRedeclareMod1.mo \
Expand Down
39 changes: 39 additions & 0 deletions flattening/modelica/scodeinst/PropagateExtends.mo
@@ -0,0 +1,39 @@
// name: PropagateExtends.mo
// keywords:
// status: correct
//

model A
Real x;
Real y;
end A;

model B
extends A;
end B;

model C
extends B;
end C;

model D
extends C(x(unit="kg"));
end D;

model E
extends D(x(start = 1), y(start=1));
end E;

model F
E e;
D d;
end F;

// Result:
// class F
// Real e.x(unit = "kg", start = 1.0);
// Real e.y(start = 1.0);
// Real d.x(unit = "kg");
// Real d.y;
// end F;
// endResult
1 change: 1 addition & 0 deletions flattening/modelica/scodeinst/classextends1.mo
Expand Up @@ -35,6 +35,7 @@ end B;
// Result:
// class B
// Real m1_a.x;
// Real m1_a.y;
// Real m2_a.x;
// Real m2_a.y;
// Real m1_b.x;
Expand Down
3 changes: 2 additions & 1 deletion flattening/modelica/scodeinst/classextends2.mo
Expand Up @@ -34,7 +34,8 @@ end B;

// Result:
// class B
// Real m1_a.x;
// Real m1_a.x = 2.0;
// Real m1_a.y;
// Real m2_a.x = 3.0;
// Real m2_a.y;
// Real m1_b.x = 2.0;
Expand Down

0 comments on commit 2c4425c

Please sign in to comment.