Skip to content

One-statement Asserts

Choose a tag to compare

@rpolitex rpolitex released this 29 Oct 16:11
bde09d1
  1. Previously the ASSERT() macro has been composed of several statements: variable define and two if statements.
    This is not always acceptable as the user sees only one simple macro call (ASSERT()) in the code and wants to treat it as a one statement or like a function call.
    So, all main macros (ASSERT, CHECK1, CHECK0) have been refactored in this release.
    ASSERT and CHECK1 become a one statement "if-based" macros.
    CHECK0 becomes a one statement nested "if-based" macro.

  2. CHECK1 now has synonym CHECKOK which seems to be more easy to read and understand.

  3. CHECK0 received new feature - error code retrieving. You can read the code, returned by function under the checking, by a special macro CHECK_RES. See Readme.md for examples.