Skip to content

Documentation for CHECK_COMPARE() #38

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 4, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions manual.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ The failure of one of these macros causes the current test to immediately exit:
* CHECK(boolean condition) - checks any boolean result.
* CHECK_TEXT(boolean condition, text) - checks any boolean result and prints text on failure.
* CHECK_FALSE(condition) - checks any boolean result
* CHECK_FALSE_TEXT(condition, text) - checks any boolean result and prints text on failure.
* 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.
* CHECK_COMPARE(first, relop, second) - checks thats a relational operator holds between two entities. On failure, prints what both operands evaluate to.
* 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).
* STRCMP_EQUAL(expected, actual) - checks const char* strings for equality using strcmp().
* STRNCMP_EQUAL(expected, actual, length) - checks const char* strings for equality using strncmp().
Expand All @@ -150,12 +150,12 @@ The failure of one of these macros causes the current test to immediately exit:
* BYTES_EQUAL(expected, actual) - compares two numbers, eight bits wide.
* POINTERS_EQUAL(expected, actual) - compares two pointers.
* DOUBLES_EQUAL(expected, actual, tolerance) - compares two floating point numbers within some tolerance
* FUNCTIONPOINTERS_EQUAL_TEXT(expected, actual, text) - compares two void (*)() function pointers
* FUNCTIONPOINTERS_EQUAL(expected, actual) - compares two void (*)() function pointers
* MEMCMP_EQUAL(expected, actual, size) - compares two areas of memory
* BITS_EQUAL(expected, actual, mask) - compares expected to actual bit by bit, applying mask
* FAIL(text) - always fails

*NOTE* Many macros have _TEXT() equivalents, which are not explicitly listed here.
*NOTE* Most macros have _TEXT() equivalents like CHECK_TEXT(), which are not explicitly listed here.

<a id="setup_teardown"> </a>

Expand Down