Skip to content

Commit

Permalink
test for ticket:3783
Browse files Browse the repository at this point in the history
  • Loading branch information
adrpo committed Apr 20, 2016
1 parent 6a1618d commit 131a472
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 1 deletion.
5 changes: 5 additions & 0 deletions openmodelica/interactive-API/Bug3783.mo
@@ -0,0 +1,5 @@
model Bug3783
replaceable package liquid = Modelica.Media.Water.StandardWater;
Modelica.Fluid.Sources.FixedBoundary boundary(redeclare package Medium = liquid, p=100) annotation(Placement(visible = true, transformation(origin = {-26, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
annotation(uses(Modelica(version = "3.2.1")));
end Bug3783;
46 changes: 46 additions & 0 deletions openmodelica/interactive-API/Bug3783.mos
@@ -0,0 +1,46 @@
// name: Bug3783.mos [BUG #3783]
// keywords: check that we keep the redeclare modifiers!
// status: correct
//

loadFile("Bug3783.mo"); getErrorString();
list(Bug3783); getErrorString();
"remove modifiers except redeclares";
removeComponentModifiers(Bug3783,"boundary",true); getErrorString();
list(Bug3783); getErrorString();
setComponentModifierValue(Bug3783, boundary.p, $Code(=10e5)); getErrorString();
getComponentModifierNames(Bug3783,"boundary"); getErrorString();
getComponentModifierValue(Bug3783,boundary.p); getErrorString();
list(Bug3783); getErrorString();

// Result:
// true
// ""
// "model Bug3783
// replaceable package liquid = Modelica.Media.Water.StandardWater;
// Modelica.Fluid.Sources.FixedBoundary boundary(redeclare package Medium = liquid, p = 100) annotation(Placement(visible = true, transformation(origin = {-26, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
// annotation(uses(Modelica(version = \"3.2.1\")));
// end Bug3783;"
// ""
// "remove modifiers except redeclares"
// true
// ""
// "model Bug3783
// replaceable package liquid = Modelica.Media.Water.StandardWater;
// Modelica.Fluid.Sources.FixedBoundary boundary(redeclare package Medium = liquid) annotation(Placement(visible = true, transformation(origin = {-26, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
// annotation(uses(Modelica(version = \"3.2.1\")));
// end Bug3783;"
// ""
// Ok
// ""
// {"p"}
// ""
// 10e5
// ""
// "model Bug3783
// replaceable package liquid = Modelica.Media.Water.StandardWater;
// Modelica.Fluid.Sources.FixedBoundary boundary(redeclare package Medium = liquid, p = 10e5) annotation(Placement(visible = true, transformation(origin = {-26, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
// annotation(uses(Modelica(version = \"3.2.1\")));
// end Bug3783;"
// ""
// endResult
1 change: 1 addition & 0 deletions openmodelica/interactive-API/Makefile
Expand Up @@ -10,6 +10,7 @@ Bug3269_deleteFile.mos \
Bug3282.mos \
Bug3417.mos \
Bug3520.mos \
Bug3783.mos \
ConvertUnits.mos \
CopyClass.mos \
choicesAllMatching.mos \
Expand Down
4 changes: 3 additions & 1 deletion rtest
Expand Up @@ -285,7 +285,9 @@ sub dofile
s/[ \t]+/ /;
if (/^\/\/ /) {
print OUT substr($_,3);
} elsif (/^\/\/$/) {
} elsif (/^\/\/$/) { # on msys2 perl the $ does not match so we use . below
print OUT substr($_,2);
} elsif (/^\/\/./) { # on msys2 perl the $ does not match, use .
print OUT substr($_,2);
} elsif ($tc_err == 0) {
print "Error in testcase: $f\n";
Expand Down

0 comments on commit 131a472

Please sign in to comment.