SOM Expect: Difference between revisions
Appearance
mNo edit summary |
mNo edit summary |
||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:SOM_Expect}} | |||
This macro asserts that a boolean condition is expected to be true. | This macro asserts that a boolean condition is expected to be true. | ||
==Syntax== | ==Syntax== | ||
boolean condition; | |||
boolean condition; | SOM_Expect(condition); | ||
SOM_Expect(condition); | |||
==Parameters== | ==Parameters== | ||
; condition(boolean) : A boolean expression that is expected to be TRUE (nonzero). | ;condition(boolean): A boolean expression that is expected to be TRUE (nonzero). | ||
==Remarks== | ==Remarks== | ||
Line 26: | Line 26: | ||
* [[SOM_TestC]] | * [[SOM_TestC]] | ||
[[Category:SOM | [[Category:SOM macro]] |
Latest revision as of 01:52, 6 May 2020
This macro asserts that a boolean condition is expected to be true.
Syntax
boolean condition; SOM_Expect(condition);
Parameters
- condition(boolean)
- A boolean expression that is expected to be TRUE (nonzero).
Remarks
The SOM_Expect macro is used to place boolean assertions that are expected to be true into a program:
- If condition is FALSE and SOM_WarnLevel is set to be greater than zero, then a warning message is output.
- If condition is TRUE and SOM_AssertLevel is set to be greater than zero, then an informational message is output.
Expansion
If condition is FALSE and SOM_WarnLevel is set to be greater than zero, then a warning message is output. If condition is TRUE and SOM_AssertLevel is set to be greater than zero, then an information message is output.
Example Code
SOM_Expect(2==2);