Skip to content

Commit 40798b6

Browse files
author
Arnd R. Strube
committed
Document more assertion macros
1 parent f77054e commit 40798b6

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

manual.markdown

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,15 +137,26 @@ The failure of one of these macros causes the current test to immediately exit:
137137

138138
* CHECK(boolean condition) - checks any boolean result.
139139
* CHECK_TEXT(boolean condition, text) - checks any boolean result and prints text on failure.
140+
* CHECK_FALSE(condition) - checks any boolean result
141+
* CHECK_FALSE_TEXT(condition, text) - checks any boolean result and prints text on failure.
140142
* CHECK_EQUAL(expected, actual) - checks for equality between entities using ==. So if you have a class that supports operator==() you can use this macro to compare two instances. You will also need to add a StringFrom() function like those found in SimpleString. This is for printing the objects when the check failed.
141143
* CHECK_THROWS(expected_exception, expression) - checks if expression throws expected_exception (e.g. std::exception). CHECK_THROWS is only available if CppUTest is built with the Standard C++ Library (default).
142-
* STRCMP_EQUAL(expected, actual) - check const char* strings for equality using strcmp().
143-
* LONGS_EQUAL(expected, actual) - Compares two numbers.
144-
* BYTES_EQUAL(expected, actual) - Compares two numbers, eight bits wide.
145-
* POINTERS_EQUAL(expected, actual) - Compares two pointers.
146-
* DOUBLES_EQUAL(expected, actual, tolerance) - Compares two doubles within some tolerance
144+
* STRCMP_EQUAL(expected, actual) - checks const char* strings for equality using strcmp().
145+
* STRNCMP_EQUAL(expected, actual, length) - checks const char* strings for equality using strncmp().
146+
* STRCMP_NOCASE_EQUAL(expected, actual) - checks const char* strings for equality, not considering case.
147+
* STRCMP_CONTAINS(expected, actual) - checks whether const char* actual contains const char* expected.
148+
* LONGS_EQUAL(expected, actual) - compares two numbers.
149+
* UNSIGNED_LONGS_EQUAL(expected, actual) - compares two positive numbers.
150+
* BYTES_EQUAL(expected, actual) - compares two numbers, eight bits wide.
151+
* POINTERS_EQUAL(expected, actual) - compares two pointers.
152+
* DOUBLES_EQUAL(expected, actual, tolerance) - compares two floating point numbers within some tolerance
153+
* FUNCTIONPOINTERS_EQUAL_TEXT(expected, actual, text) - compares two void (*)() function pointers
154+
* MEMCMP_EQUAL(expected, actual, size) - compares two areas of memory
155+
* BITS_EQUAL(expected, actual, mask) - compares expected to actual bit by bit, applying mask
147156
* FAIL(text) - always fails
148157

158+
*NOTE* Many macros have _TEXT() equivalents, which are not explicitly listed here.
159+
149160
<a id="setup_teardown"> </a>
150161

151162
*CHECK_EQUAL Warning:*

0 commit comments

Comments
 (0)