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
Showing
95 changed files
with
8,219 additions
and
9,475 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
Binary file modified
BIN
-55.7 KB
(14%)
ReferenceFiles/msl32/Modelica.Media.Examples.Tests.MediaTestModels.Air.SimpleAir.mat.xz
Binary file not shown.
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: ArrayOuterParamExpand | ||
// keywords: array inner outer parameter | ||
// status: correct | ||
// | ||
// Checks that outer parameters are expanded correctly. | ||
// | ||
|
||
model A | ||
outer parameter Real[3] p1; | ||
parameter Real[3] p2; | ||
Real v; | ||
equation | ||
v = p1 * p2; | ||
end A; | ||
|
||
model ArrayOuterParamExpand | ||
inner parameter Real[3] p1; | ||
A a; | ||
end ArrayOuterParamExpand; | ||
|
||
// Result: | ||
// class ArrayOuterParamExpand | ||
// parameter Real p1[1]; | ||
// parameter Real p1[2]; | ||
// parameter Real p1[3]; | ||
// parameter Real a.p2[1]; | ||
// parameter Real a.p2[2]; | ||
// parameter Real a.p2[3]; | ||
// Real a.v; | ||
// equation | ||
// a.v = p1[1] * a.p2[1] + p1[2] * a.p2[2] + p1[3] * a.p2[3]; | ||
// end ArrayOuterParamExpand; | ||
// 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// name: EnumArrayMod1 | ||
// keywords: enumeration enum array mod | ||
// status: correct | ||
// | ||
// Tests that enumeration arrays with modifiers work correctly. | ||
// | ||
|
||
|
||
model EnumArrayMod1 | ||
record R | ||
E e; | ||
end R; | ||
|
||
type E = enumeration(a, b, c); | ||
|
||
R[E] re(e = {i for i in E}); | ||
end EnumArrayMod1; | ||
|
||
// Result: | ||
// function EnumArrayMod1.R "Automatically generated record constructor for EnumArrayMod1.R" | ||
// input enumeration(a, b, c) e; | ||
// output R res; | ||
// end EnumArrayMod1.R; | ||
// | ||
// function EnumArrayMod1.R$re "Automatically generated record constructor for EnumArrayMod1.R$re" | ||
// input enumeration(a, b, c) e; | ||
// output R$re res; | ||
// end EnumArrayMod1.R$re; | ||
// | ||
// class EnumArrayMod1 | ||
// enumeration(a, b, c) re[EnumArrayMod1.E.a].e = EnumArrayMod1.E.a; | ||
// enumeration(a, b, c) re[EnumArrayMod1.E.b].e = EnumArrayMod1.E.b; | ||
// enumeration(a, b, c) re[EnumArrayMod1.E.c].e = EnumArrayMod1.E.c; | ||
// end EnumArrayMod1; | ||
// 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,30 @@ | ||
// name: EnumInnerOuterDim | ||
// keywords: enumeration enum inner outer dimension | ||
// status: correct | ||
// | ||
// Tests that inner outer arrays with enumeration dimensions are handled | ||
// correctly. | ||
// | ||
|
||
type E = enumeration (A, B, C); | ||
|
||
block Model1 | ||
outer parameter Real[E] p1; | ||
parameter Real[E] p2 = p1; | ||
end Model1; | ||
|
||
block Model2 | ||
inner parameter Real[E] p1; | ||
Model1 m1; | ||
end Model2; | ||
|
||
// Result: | ||
// class Model2 | ||
// parameter Real p1[E.A]; | ||
// parameter Real p1[E.B]; | ||
// parameter Real p1[E.C]; | ||
// parameter Real m1.p2[E.A] = p1[E.A]; | ||
// parameter Real m1.p2[E.B] = p1[E.B]; | ||
// parameter Real m1.p2[E.C] = p1[E.C]; | ||
// end Model2; | ||
// 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# relative path to rtest | ||
TEST = ../../../rtest -v | ||
|
||
# Tests to run. | ||
TESTFILES = testExternalObject.mo | ||
|
||
# test that currently fail. Move up when fixed. | ||
FAILINGTESTFILES= \ | ||
|
||
# Dependency files that are not .mo .mos or Makefile | ||
# Add them here or they will be cleaned. | ||
DEPENDENCIES = \ | ||
*.mo \ | ||
*.mos \ | ||
Makefile | ||
|
||
CLEAN = `ls | grep -w -v -f deps.tmp` | ||
|
||
.PHONY : test clean getdeps | ||
|
||
test : | ||
@echo | ||
@echo Running tests... | ||
@echo | ||
@echo OPENMODELICAHOME=" $(OPENMODELICAHOME) " | ||
@$(TEST) $(TESTFILES) | ||
|
||
# Cleans all files that are not listed as dependencies | ||
clean : | ||
@echo $(DEPENDENCIES) | sed 's/ /\\|/g' > deps.tmp | ||
@rm -f $(CLEAN) | ||
|
||
# Run this if you want to list out the files (dependencies). | ||
# do it after cleaning and updating the folder | ||
# then you can get a list of file names (which must be dependencies | ||
# since you got them from repository + your own new files) | ||
# then add them to the DEPENDENCIES. You can find the | ||
# list in deps.txt | ||
getdeps: | ||
@echo $(DEPENDENCIES) | sed 's/ /\\|/g' > deps.tmp | ||
@echo $(CLEAN) | sed -r 's/deps.txt|deps.tmp//g' | sed 's/ / \\\n/g' > deps.txt | ||
@echo Dependency list saved in deps.txt. | ||
@echo Copy the list from deps.txt and add it to the Makefile @DEPENDENCIES | ||
|
||
failingtest : | ||
@echo | ||
@echo Running failing tests... | ||
@echo | ||
@$(TEST) $(FAILINGTESTFILES) |
45 changes: 45 additions & 0 deletions
45
flattening/modelica/external-objects/testExternalObject.mo
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,45 @@ | ||
// name: testExternalObject | ||
// keywords: external object | ||
// cflags: +i=ExtObjectTest.Ex | ||
// status: correct | ||
// | ||
// description: External object in extended class | ||
|
||
package ExtObjectTest | ||
model Ex | ||
package ExtPackage1 = ExtPackage; | ||
ExtPackage1.ExtObj mapping = ExtPackage1.ExtObj(); | ||
end Ex; | ||
|
||
package ExtPackage | ||
class ExtObj | ||
extends ExternalObject; | ||
function constructor | ||
output ExtObj mapping; | ||
external "C" mapping = initMapping(); | ||
end constructor; | ||
function destructor | ||
input ExtObj mapping; | ||
external "C" destroyMapping(mapping); | ||
end destructor; | ||
end ExtObj; | ||
end ExtPackage; | ||
end ExtObjectTest; | ||
|
||
// Result: | ||
// function ExtObjectTest.Ex.ExtPackage1.ExtObj.constructor | ||
// output ExtObjectTest.Ex.ExtPackage1.ExtObj mapping; | ||
// | ||
// external "C" mapping = initMapping(); | ||
// end ExtObjectTest.Ex.ExtPackage1.ExtObj.constructor; | ||
// | ||
// function ExtObjectTest.Ex.ExtPackage1.ExtObj.destructor | ||
// input ExtObjectTest.Ex.ExtPackage1.ExtObj mapping; | ||
// | ||
// external "C" destroyMapping(mapping); | ||
// end ExtObjectTest.Ex.ExtPackage1.ExtObj.destructor; | ||
// | ||
// class ExtObjectTest.Ex | ||
// ExtObjectTest.Ex.ExtPackage1.ExtObj mapping = ExtObjectTest.Ex.ExtPackage1.ExtObj.constructor(); | ||
// end ExtObjectTest.Ex; | ||
// 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// name: UsertypeArrayMod | ||
// keywords: modification array type | ||
// status: correct | ||
// | ||
|
||
model UsertypeArrayMod | ||
type T = Real[3, 2](start = {{1, 2}, {3, 4}, {5, 6}}); | ||
T x[4, 1]; | ||
end UsertypeArrayMod; | ||
|
||
// Result: | ||
// class UsertypeArrayMod | ||
// Real x[1,1,1,1](start = 1.0); | ||
// Real x[1,1,1,2](start = 2.0); | ||
// Real x[1,1,2,1](start = 3.0); | ||
// Real x[1,1,2,2](start = 4.0); | ||
// Real x[1,1,3,1](start = 5.0); | ||
// Real x[1,1,3,2](start = 6.0); | ||
// Real x[2,1,1,1](start = 1.0); | ||
// Real x[2,1,1,2](start = 2.0); | ||
// Real x[2,1,2,1](start = 3.0); | ||
// Real x[2,1,2,2](start = 4.0); | ||
// Real x[2,1,3,1](start = 5.0); | ||
// Real x[2,1,3,2](start = 6.0); | ||
// Real x[3,1,1,1](start = 1.0); | ||
// Real x[3,1,1,2](start = 2.0); | ||
// Real x[3,1,2,1](start = 3.0); | ||
// Real x[3,1,2,2](start = 4.0); | ||
// Real x[3,1,3,1](start = 5.0); | ||
// Real x[3,1,3,2](start = 6.0); | ||
// Real x[4,1,1,1](start = 1.0); | ||
// Real x[4,1,1,2](start = 2.0); | ||
// Real x[4,1,2,1](start = 3.0); | ||
// Real x[4,1,2,2](start = 4.0); | ||
// Real x[4,1,3,1](start = 5.0); | ||
// Real x[4,1,3,2](start = 6.0); | ||
// end UsertypeArrayMod; | ||
// endResult |
Oops, something went wrong.