Skip to content

Commit

Permalink
- fix #2419
Browse files Browse the repository at this point in the history
- getMessagesStringInternal will now return 
  unique messages if (unique = false) is not given
- added test for this in intractive_api_calls.mos
- update test


git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@17657 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adrpo committed Oct 12, 2013
1 parent 699c8ad commit 175c72f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
4 changes: 3 additions & 1 deletion Compiler/FrontEnd/ModelicaBuiltin.mo
Expand Up @@ -1454,7 +1454,9 @@ annotation(preferredView="text");
end ErrorMessage;

function getMessagesStringInternal
"{{[file.mo:n:n-n:n:b] Error: message, TRANSLATION, Error, code}}"
"{{[file.mo:n:n-n:n:b] Error: message, TRANSLATION, Error, code}}
if unique = true (the default) only unique messages will be shown"
input Boolean unique := true;
output ErrorMessage[:] messagesString;
external "builtin";
annotation(preferredView="text");
Expand Down
12 changes: 10 additions & 2 deletions Compiler/Script/CevalScript.mo
Expand Up @@ -883,6 +883,7 @@ algorithm
list<String> names, namesPublic, namesChanged, fileNames;
HashSetString.HashSet hashSetString;
list<Boolean> blst;
list<Error.TotalMessage> messages;

Real stoptime,starttime,tol,stepsize;
Integer interval;
Expand Down Expand Up @@ -1826,9 +1827,16 @@ algorithm
then
(cache,Values.BOOL(true),st);

case (cache,env,"getMessagesStringInternal",{},st,_)
case (cache,env,"getMessagesStringInternal",{Values.BOOL(true)},st,_)
equation
v = ValuesUtil.makeArray(List.map(Error.getMessages(),errorToValue));
messages = List.unique(Error.getMessages());
v = ValuesUtil.makeArray(List.map(messages, errorToValue));
then
(cache,v,st);

case (cache,env,"getMessagesStringInternal",{Values.BOOL(false)},st,_)
equation
v = ValuesUtil.makeArray(List.map(Error.getMessages(), errorToValue));
then
(cache,v,st);

Expand Down

0 comments on commit 175c72f

Please sign in to comment.