Skip to content

Commit

Permalink
Add test for ticket:4550 reduction type
Browse files Browse the repository at this point in the history
  • Loading branch information
sjoelund authored and OpenModelica-Hudson committed Oct 18, 2017
1 parent b0861d4 commit 6b70c75
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
1 change: 1 addition & 0 deletions simulation/modelica/functions_eval/Makefile
Expand Up @@ -11,6 +11,7 @@ functionTest5.mos \
functionTest7.mos \
functionTest8.mos \
functionTest9.mos \
NumberOfSymmetricBaseSystems.mos \
simplifyIf1.mos \
simplifyIf2.mos \
ticket2535.mos \
Expand Down
@@ -0,0 +1,38 @@
// status: correct
// Based on ticket:4550

loadString("function numberOfSymmetricBaseSystems
input Integer m=3;
output Integer n;
algorithm
n := if mod(m, 2) == 0 then product(if mod(m, i) == 0 then 2 else 1 for i in {2^j for j in 1:integer(log(m/2)/log(2))}) else 1;
end numberOfSymmetricBaseSystems;");getErrorString();
numberOfSymmetricBaseSystems(1);getErrorString();
numberOfSymmetricBaseSystems(2);getErrorString();
numberOfSymmetricBaseSystems(3);getErrorString();
numberOfSymmetricBaseSystems(4);getErrorString();
numberOfSymmetricBaseSystems(5);getErrorString();
numberOfSymmetricBaseSystems(6);getErrorString();
numberOfSymmetricBaseSystems(7);getErrorString();
numberOfSymmetricBaseSystems(8);getErrorString();

// Result:
// true
// ""
// 1
// ""
// 1
// ""
// 1
// ""
// 2
// ""
// 1
// ""
// 2
// ""
// 1
// ""
// 4
// ""
// endResult

0 comments on commit 6b70c75

Please sign in to comment.