Opened 10 years ago
Last modified 7 years ago
#3235 closed defect
Fix test cases with error messages that include line numbers from the compiler — at Version 5
Reported by: | Per Östlund | Owned by: | somebody |
---|---|---|---|
Priority: | high | Milestone: | Future |
Component: | *unknown* | Version: | trunk |
Keywords: | Cc: | Lennart Ochel, Willi Braun, Volker Waurich |
Description (last modified by )
I have disabled some test cases that have error messages in them which include line numbers from the compiler. This means that the test cases needs to be updated every time the corresponding source files are changed in the compiler, which is not acceptable. Internal errors should really only be used for things which shouldn't fail, and not used as failtraces.
So either the compiler needs to be fixed so it doesn't print out internal errors for these models, or the models needs to be fixed. The models are:
simulation/modelica/indexreduction/ImplicitStateCoupling.mos simulation/libraries/3rdParty/MathematicalAspects/01_AlgebraicLoopBoolean.mos openmodelica/typed-API/SolveLinearSystem.mos simulation/modelica/algorithms_functions/algorithms.mos
Change History (5)
comment:1 by , 10 years ago
follow-up: 4 comment:2 by , 10 years ago
Thanks for adressing this issue. I appreciate these recommendation to get a more consistent coding style. Could you add this to the style guide?
comment:3 by , 10 years ago
I will just note that a lot of the addInternalError calls were added by me; they were often replacing print statements (which is worse than just failtrace).
Also, the following pattern is often used in the front end:
I.e. only print an internal error if the called code fails without printing an error of its own. This is probably a pattern which should be used more in the backend, considering that getNumErrorMessages is used five times in the whole backend, while internal errors are used in ~250 places.