Skip to content

Commit

Permalink
[NF] Add type input/output tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
perost authored and OpenModelica-Hudson committed Dec 10, 2018
1 parent e861b96 commit db3e5da
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
16 changes: 16 additions & 0 deletions flattening/modelica/scodeinst/ClassAttributes3.mo
@@ -0,0 +1,16 @@
// name: ClassAttributes3
// keywords:
// status: correct
// cflags: -d=newInst
//

model ClassAttributes3
type InputReal = input Real;
input InputReal x;
end ClassAttributes3;

// Result:
// class ClassAttributes3
// input Real x;
// end ClassAttributes3;
// endResult
20 changes: 20 additions & 0 deletions flattening/modelica/scodeinst/ClassAttributes4.mo
@@ -0,0 +1,20 @@
// name: ClassAttributes3
// keywords:
// status: incorrect
// cflags: -d=newInst
//

model ClassAttributes4
type InputReal = input Real;
output InputReal x;
end ClassAttributes4;

// Result:
// Error processing file: ClassAttributes4.mo
// [flattening/modelica/scodeinst/ClassAttributes4.mo:9:3-9:21:writable] Error: Invalid type prefix 'output' on component x, due to existing type prefix 'input'.
//
// # Error encountered! Exiting...
// # Please check the error message and the flags.
//
// Execution failed!
// endResult
2 changes: 2 additions & 0 deletions flattening/modelica/scodeinst/Makefile
Expand Up @@ -158,6 +158,8 @@ CevalZeros1.mo \
ClassAsComponentError.mo \
ClassAttributes1.mo \
ClassAttributes2.mo \
ClassAttributes3.mo \
ClassAttributes4.mo \
ClassExtends1.mo \
ClassExtends2.mo \
ClassExtends3.mo \
Expand Down

0 comments on commit db3e5da

Please sign in to comment.