The ASSERT_CMP macros like ASSERT_CMPINT use the arguments that are being compared directly in the error message.
For example, the ASSERT_CMPINT approximately looks like:
#define ASSERT_CMPINT(a, b) \ if (a != b) { \ printf("assert failure: %d != %d", a, b); \ abort(); \ }
The caveat is that if a or b are function calls (that aren't idempotent), the error message might be misleading.
Here's an example of one such case:
ASSERT_CMPINT ( 0, ==, bson_json_reader_read (reader, &bson_out, &error));
Since b is substituted for that function call, that function gets called twice, and the error message could produce something confusing like "0 != 0".