Skip to content

Commit

Permalink
Add test for hideResult evaluation
Browse files Browse the repository at this point in the history
  • Loading branch information
ptaeuber authored and OpenModelica-Hudson committed Nov 15, 2016
1 parent 128f21d commit fffa3f0
Showing 1 changed file with 36 additions and 2 deletions.
38 changes: 36 additions & 2 deletions simulation/modelica/parameters/hideResult.mos
Expand Up @@ -14,7 +14,6 @@ protected
end hideResult;
"); getErrorString();

//setCommandLineOptions("-d=evalParameterDump"); getErrorString();
simulate(hideResult); getErrorString();

val(b, 0.0); getErrorString();
Expand All @@ -32,7 +31,6 @@ protected
end hideResult;
"); getErrorString();

//setCommandLineOptions("-d=evalParameterDump"); getErrorString();
simulate(hideResult); getErrorString();

val(b, 0.0); getErrorString();
Expand All @@ -51,6 +49,31 @@ simulate(hideResult); getErrorString();
val(b, 0.0); getErrorString();


loadString("
package HideResult
model hideResult1
parameter Real a = 2 annotation(HideResult = not hide_a and not hide_a2);
parameter Boolean hide_a = true annotation(Evaluate = true);
parameter Boolean hide_a2 = false annotation(Evaluate = true);
end hideResult1;

model hideResult2
hideResult1 b (hide_a=hide_b);
parameter Boolean hide_b = true;
end hideResult2;

model hideResult3
hideResult2 c (hide_b=hide_c);
parameter Boolean hide_c = false;
end hideResult3;
end HideResult;
"); getErrorString();

simulate(HideResult.hideResult3); getErrorString();

val(c.b.a, 0.0); getErrorString();


// Result:
// true
// ""
Expand Down Expand Up @@ -85,4 +108,15 @@ val(b, 0.0); getErrorString();
// NaN
// "Error: b not found in hideResult_res.mat
// "
// true
// ""
// record SimulationResult
// resultFile = "HideResult.hideResult3_res.mat",
// simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-06, method = 'dassl', fileNamePrefix = 'HideResult.hideResult3', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
// messages = ""
// end SimulationResult;
// ""
// NaN
// "Error: c.b.a not found in HideResult.hideResult3_res.mat
// "
// endResult

0 comments on commit fffa3f0

Please sign in to comment.