mity / acutest

Simple header-only C/C++ unit testing facility.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow TEST_CHECK for non-int conditions

rittneje opened this issue · 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_.