Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
lochel committed Apr 23, 2021
1 parent b4031d6 commit c1e77c1
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
1 change: 1 addition & 0 deletions testsuite/omsimulator/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ DualMassOscillator_me.mos \
DualMassOscillator.mos \
enumeration.mos \
enumeration2.mos \
enumeration3.mos \
initialization_omc.mos \
initialization.mos \
initialization2_omc.mos \
Expand Down
58 changes: 58 additions & 0 deletions testsuite/omsimulator/enumeration3.mos
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
// keywords: fmu export import
// status: correct
// teardown_command: rm -rf Enumeration3.lua Enum1.fmu Int1.fmu Enum1.log Int1.log Enumeration3_systemCall.log temp-Enumeration3/
// cflags: -d=-newInst

loadString("
model Enum1
type E = enumeration(one, two, three);
input E u;
end Enum1;
"); getErrorString();

loadString("
model Int1
output Integer y = 2;
end Int1;
"); getErrorString();

buildModelFMU(Enum1, version="2.0", fmuType="me", platforms={"static"}); getErrorString();
buildModelFMU(Int1, version="2.0", fmuType="me", platforms={"static"}); getErrorString();

writeFile("Enumeration3.lua", "
oms_setCommandLineOption(\"--suppressPath=true\")
oms_setTempDirectory(\"./temp-Enumeration3/\")

oms_newModel(\"test\")
oms_addSystem(\"test.root\", oms_system_sc)
oms_addSubModel(\"test.root.A\", \"Int1.fmu\")
oms_addSubModel(\"test.root.B\", \"Enum1.fmu\")
oms_addConnection(\"test.root.B.u\", \"test.root.A.y\")
oms_setResultFile(\"test\", \"\")

oms_instantiate(\"test\")
oms_initialize(\"test\")
oms_simulate(\"test\")
oms_terminate(\"test\")
oms_delete(\"test\")
"); getErrorString();

system(getInstallationDirectoryPath() + "/bin/OMSimulator Enumeration3.lua", "Enumeration3_systemCall.log");
readFile("Enumeration3_systemCall.log");

// Result:
// true
// ""
// true
// ""
// "Enum1.fmu"
// ""
// "Int1.fmu"
// ""
// true
// ""
// 0
// "info: model doesn't contain any continuous state
// info: No result file will be created
// "
// endResult

0 comments on commit c1e77c1

Please sign in to comment.