Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Henrik Tidefelt <henrikt@wolfram.com>
  • Loading branch information
HansOlsson and henrikt-ma authored Dec 16, 2020
1 parent daf036c commit ff907ba
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions chapters/annotations.tex
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ \section{Vendor-Specific Annotations}\label{vendor-specific-annotations}
\begin{example}
\begin{lstlisting}[language=modelica]
annotation (
Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}),<
Icon(coordinateSystem(extent = {{-100, -100}, {100, 100}}),
graphics = {__NameOfVendor(Circle(center = {0, 0}, radius = 10))}));
\end{lstlisting}
This introduces a new graphical primitive \lstinline!Circle! using the
Expand Down Expand Up @@ -483,8 +483,9 @@ \subsection{Annotation for Test Cases}\label{annotation-for-test-cases}
annotation "(" "TestCase" "(" "shouldPass" "=" ( false | true ) ")" ")"
\end{lstlisting}
If \lstinline!shouldPass! is \lstinline!false! it indicates that the translation or the simulation of the model should fail.
If a tools checks a package where classes have \lstinline!shouldPass=false! they should not generate errors - and testing them may even be skipped; if a model with \lstinline!shouldPass=false! translates and simulates without error that should generate a diagnostics.
Similarly as a class with obsolete-annotation a class with \lstinline!TestCase! annotation (regardless of the value of \lstinline!shouldPass!) shall not be used in other models, unless those models also have a \lstinline!TestCase! annotation.
If a tools checks a package where classes have \lstinline!shouldPass=false! they should not generate errors, and may even be skipped.
On the other hand, models with \lstinline!shouldPass=false! may be useful for creation of negative tests in tool-specific ways.
Similarly as a class with obsolete-annotation, a class with \lstinline!TestCase! annotation (regardless of the value of \lstinline!shouldPass!) shall not be used in other models, unless those models also have a \lstinline!TestCase! annotation.
\begin{nonnormative}
The intent of the test-case can be included in the documentation of the class.
This annotation can both be used for models intended as test-cases for implementations, and for models explaining detectable errors.
Expand Down

0 comments on commit ff907ba

Please sign in to comment.