Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
699e373
commit 297f7c6
Showing
41 changed files
with
587 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// name: Assert1 | ||
// keywords: | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
|
||
model Assert1 | ||
equation | ||
assert(false, "test"); | ||
end Assert1; | ||
|
||
// Result: | ||
// class Assert1 | ||
// equation | ||
// assert(false, "test"); | ||
// end Assert1; | ||
// endResult |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// name: Assert2 | ||
// keywords: | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
|
||
model Assert2 | ||
Boolean b; | ||
String s; | ||
equation | ||
assert(b, s); | ||
end Assert2; | ||
|
||
// Result: | ||
// class Assert2 | ||
// Boolean b; | ||
// String s; | ||
// equation | ||
// assert(b, s); | ||
// end Assert2; | ||
// endResult |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// name: Assert3 | ||
// keywords: | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
|
||
model Assert3 | ||
equation | ||
assert(false, "message", AssertionLevel.warning); | ||
end Assert3; | ||
|
||
// Result: | ||
// class Assert3 | ||
// equation | ||
// assert(false, "message", AssertionLevel.warning); | ||
// end Assert3; | ||
// endResult |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// name: AssertInvalid1 | ||
// keywords: | ||
// status: incorrect | ||
// cflags: -d=newInst | ||
// | ||
|
||
model AssertInvalid1 | ||
equation | ||
assert("true", "message"); | ||
end AssertInvalid1; | ||
|
||
// Result: | ||
// Error processing file: AssertInvalid1.mo | ||
// [flattening/modelica/scodeinst/AssertInvalid1.mo:9:3-9:28:writable] Error: Type mismatch for positional argument 1 in assert(condition="true"). The argument has type: | ||
// String | ||
// expected type: | ||
// Boolean | ||
// | ||
// # Error encountered! Exiting... | ||
// # Please check the error message and the flags. | ||
// | ||
// Execution failed! | ||
// endResult |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// name: AssertInvalid2 | ||
// keywords: | ||
// status: incorrect | ||
// cflags: -d=newInst | ||
// | ||
|
||
model AssertInvalid2 | ||
equation | ||
assert(false, 1); | ||
end AssertInvalid2; | ||
|
||
// Result: | ||
// Error processing file: AssertInvalid2.mo | ||
// [flattening/modelica/scodeinst/AssertInvalid2.mo:9:3-9:19:writable] Error: Type mismatch for positional argument 2 in assert(message=1). The argument has type: | ||
// Integer | ||
// expected type: | ||
// String | ||
// | ||
// # Error encountered! Exiting... | ||
// # Please check the error message and the flags. | ||
// | ||
// Execution failed! | ||
// endResult |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// name: AssertInvalid3 | ||
// keywords: | ||
// status: incorrect | ||
// cflags: -d=newInst | ||
// | ||
|
||
model AssertInvalid3 | ||
equation | ||
assert(false, "message", 1); | ||
end AssertInvalid3; | ||
|
||
// Result: | ||
// Error processing file: AssertInvalid3.mo | ||
// [flattening/modelica/scodeinst/AssertInvalid3.mo:9:3-9:30:writable] Error: Type mismatch for positional argument 3 in assert(level=1). The argument has type: | ||
// Integer | ||
// expected type: | ||
// enumeration AssertionLevel(error, warning) | ||
// | ||
// # Error encountered! Exiting... | ||
// # Please check the error message and the flags. | ||
// | ||
// Execution failed! | ||
// endResult |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// name: ComponentAttr1 | ||
// keywords: extends visibility | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
|
||
model A | ||
Real x; | ||
end A; | ||
|
||
model ComponentAttr1 | ||
protected A a; | ||
end ComponentAttr1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// name: EquationInvalidType1 | ||
// keywords: | ||
// status: incorrect | ||
// cflags: -d=newInst | ||
// | ||
|
||
model EquationInvalidType1 | ||
Real x; | ||
String s; | ||
equation | ||
x = s; | ||
end EquationInvalidType1; | ||
|
||
// Result: | ||
// Error processing file: EquationInvalidType1.mo | ||
// [flattening/modelica/scodeinst/EquationInvalidType1.mo:11:3-11:8:writable] Error: Type mismatch in equation x = s of type Real = String. | ||
// | ||
// # Error encountered! Exiting... | ||
// # Please check the error message and the flags. | ||
// | ||
// Execution failed! | ||
// endResult |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// name: FunctionMultiOutput2 | ||
// keywords: | ||
// status: correct | ||
// cflags: -d=newInst | ||
// | ||
|
||
function f | ||
input Real x; | ||
output Real a = x * 2; | ||
output Real b = x * 3; | ||
output Real c = x * 4; | ||
end f; | ||
|
||
model FunctionMultiOutput2 | ||
Real x; | ||
algorithm | ||
x := f(x); | ||
end FunctionMultiOutput2; | ||
|
||
// Result: | ||
// function f | ||
// input Real x; | ||
// output Real a = x * 2.0; | ||
// output Real b = x * 3.0; | ||
// output Real c = x * 4.0; | ||
// end f; | ||
// | ||
// class FunctionMultiOutput2 | ||
// Real x; | ||
// algorithm | ||
// x := f(x)[1]; | ||
// end FunctionMultiOutput2; | ||
// endResult |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// name: FunctionMultiOutput3 | ||
// keywords: | ||
// status: correct | ||
// | ||
|
||
function f | ||
input Real x; | ||
output Real y; | ||
output Real z; | ||
algorithm | ||
y := x * 2; | ||
z := x * 3; | ||
end f; | ||
|
||
model FunctionMultiOutput3 | ||
Real x = f(3); | ||
Real y; | ||
equation | ||
y = f(4); | ||
end FunctionMultiOutput3; | ||
|
||
// Result: | ||
// function f | ||
// input Real x; | ||
// output Real y; | ||
// output Real z; | ||
// algorithm | ||
// y := 2.0 * x; | ||
// z := 3.0 * x; | ||
// end f; | ||
// | ||
// class FunctionMultiOutput3 | ||
// Real x = 6.0; | ||
// Real y; | ||
// equation | ||
// y = 8.0; | ||
// end FunctionMultiOutput3; | ||
// endResult |
Oops, something went wrong.