Skip to content
This repository was archived by the owner on May 18, 2019. It is now read-only.

Commit 9489b47

Browse files
sjoelundOpenModelica-Hudson
authored andcommitted
Handle stack overflow for compliance suite test
Belonging to [master]: - #2595
1 parent 6bfa734 commit 9489b47

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

Examples/ComplianceSuite.mos

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,22 @@ algorithm
6262
out := OpenModelica.Scripting.stringReplace(OpenModelica.Scripting.stringReplace(OpenModelica.Scripting.stringReplace(str,\\\"'\\\",\\\"\\\"),\\\"\\\\\\\"\\\",\\\"\\\"),\\\"\\\\\\\\\\\",\\\"\\\");
6363
end fixName;
6464
\");
65-
resultFile := rec.resultFile;
65+
if length(err) >= 21 then
66+
print(substring(err, 1, 21));
67+
b := \"Error: Stack overflow\" <> substring(err, 1, 21);
68+
else
69+
b := true;
70+
end if;
71+
resultFile := \"\";
72+
if b then
73+
resultFile := rec.resultFile;
74+
end if;
6675
shouldPass := OpenModelica.Scripting.getBooleanClassAnnotation("+OpenModelica.Scripting.typeNameString(cl)+",__ModelicaAssociation.TestCase.shouldPass);
6776
success := if shouldPass then resultFile<>\"\" else resultFile==\"\";
68-
messages := rec.messages;
77+
messages := \"\";
78+
if b then
79+
messages := rec.messages;
80+
end if;
6981
messages := messages + err;
7082
messages := messages + (if not success and not shouldPass /* This is correct; try to figure out why (hint: success is a poor name) */ then \"\nSucceeded, but expected failure\" else \"\");
7183
messages := firstPart(messages);

0 commit comments

Comments
 (0)