Skip to content

Commit

Permalink
Add a test case for Ticket:5994.
Browse files Browse the repository at this point in the history
  • Loading branch information
mahge committed Jun 3, 2020
1 parent 6f04225 commit dc70d57
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
1 change: 1 addition & 0 deletions testsuite/simulation/modelica/arrays/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ PolynomialEvaluator2.mos \
PolynomialEvaluator3.mos \
ticket2336.mos \
ticket5114.mos \
ticket5994.mos \
VariableRangeSubscript.mos \
VectorizeOneReturnValue.mos \
Xpowers1.mos \
Expand Down
13 changes: 13 additions & 0 deletions testsuite/simulation/modelica/arrays/ticket_5994.mo
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package Ticket_5994
function modifyArray
input Real values[:];
output Real result[size(values, 1)];
algorithm
result[size(values, 1)] := 42.0;
end modifyArray;

model Test
Real sample[:] = {1.0, 2.0, 3.0};
Real modified[:] = modifyArray(values = sample);
end Test;
end Ticket_5994;
27 changes: 27 additions & 0 deletions testsuite/simulation/modelica/arrays/ticket_5994.mos
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// name: Ticket_5994
// status: correct
// teardown_command: rm -f Ticket_5994.Test*

loadFile("ticket_5994.mo");
getErrorString();

simulate(Ticket_5994.Test);
getErrorString();

val(modified[3],0);
getErrorString();


// Result:
// true
// ""
// record SimulationResult
// resultFile = "Ticket_5994.Test_res.mat",
// simulationOptions = "startTime = 0.0, stopTime = 1.0, numberOfIntervals = 500, tolerance = 1e-006, method = 'dassl', fileNamePrefix = 'Ticket_5994.Test', options = '', outputFormat = 'mat', variableFilter = '.*', cflags = '', simflags = ''",
// messages = "LOG_SUCCESS | info | The initialization finished successfully without homotopy method.
// LOG_SUCCESS | info | The simulation finished successfully.
// "
// end SimulationResult;
// ""
// 42.0
// ""

0 comments on commit dc70d57

Please sign in to comment.