Skip to content

Commit

Permalink
Add CHECK_ZERO macros
Browse files Browse the repository at this point in the history
These are useful when working with error code return values, where one
often compares to zero which means no error has happened.
  • Loading branch information
rnestler committed Sep 16, 2020
1 parent e6e050b commit 88ee47a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/CppUTest/UtestMacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@
UtestShell::getCurrent()->assertLongsEqual((long)0, (long)0, NULLPTR, file, line); \
} } while(0)

#define CHECK_ZERO(actual) CHECK_EQUAL(0, (actual))

#define CHECK_ZERO_TEXT(actual, text) CHECK_EQUAL_TEXT(0, (actual), (text))

#define CHECK_COMPARE(first, relop, second)\
CHECK_COMPARE_TEXT(first, relop, second, NULLPTR)

Expand Down

0 comments on commit 88ee47a

Please sign in to comment.