Jump to content

SOM Expect

From EDM2
Revision as of 22:58, 10 October 2017 by Martini (talk | contribs) (Created page with "This macro asserts that a boolean condition is expected to be true. ==Syntax== <PRE> boolean condition; SOM_Expect(condition); </PRE> ==Parameters== ; condition(boolean) ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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).

Return Code

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);

Related

Macros