Jump to content

SOM_Expect

From EDM2
Revision as of 01:52, 6 May 2020 by Ak120 (talk | contribs)
(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).

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