Skip to content

Commit db3e5da

Browse files
perostOpenModelica-Hudson
authored andcommitted
[NF] Add type input/output tests.
Belonging to [master]: - OpenModelica/OMCompiler#2822 - OpenModelica/OpenModelica-testsuite#1088
1 parent e861b96 commit db3e5da

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// name: ClassAttributes3
2+
// keywords:
3+
// status: correct
4+
// cflags: -d=newInst
5+
//
6+
7+
model ClassAttributes3
8+
type InputReal = input Real;
9+
input InputReal x;
10+
end ClassAttributes3;
11+
12+
// Result:
13+
// class ClassAttributes3
14+
// input Real x;
15+
// end ClassAttributes3;
16+
// endResult
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// name: ClassAttributes3
2+
// keywords:
3+
// status: incorrect
4+
// cflags: -d=newInst
5+
//
6+
7+
model ClassAttributes4
8+
type InputReal = input Real;
9+
output InputReal x;
10+
end ClassAttributes4;
11+
12+
// Result:
13+
// Error processing file: ClassAttributes4.mo
14+
// [flattening/modelica/scodeinst/ClassAttributes4.mo:9:3-9:21:writable] Error: Invalid type prefix 'output' on component x, due to existing type prefix 'input'.
15+
//
16+
// # Error encountered! Exiting...
17+
// # Please check the error message and the flags.
18+
//
19+
// Execution failed!
20+
// endResult

flattening/modelica/scodeinst/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,8 @@ CevalZeros1.mo \
158158
ClassAsComponentError.mo \
159159
ClassAttributes1.mo \
160160
ClassAttributes2.mo \
161+
ClassAttributes3.mo \
162+
ClassAttributes4.mo \
161163
ClassExtends1.mo \
162164
ClassExtends2.mo \
163165
ClassExtends3.mo \

0 commit comments

Comments
 (0)