acutest icon indicating copy to clipboard operation
acutest copied to clipboard

Allow TEST_CHECK for non-int conditions

Open rittneje opened this issue 4 years ago • 0 comments

Since acutest_check_ specifically expects an int for the condition, we cannot currently do a truthiness check with TEST_CHECK/TEST_ASSERT without a compiler warning.

For example, the following will emit a warning:

struct foo x* = ...;
TEST_CHECK(x);

Instead, we have to write it this way:

struct foo x* = ...;
TEST_CHECK(x != NULL);

I think this can be easily fixed by modifying the four macros to pass !!(cond) to acutest_check_.

rittneje avatar Jun 24 '21 04:06 rittneje