From: Pauli Date: Sun, 9 Apr 2017 21:13:59 +0000 (+1000) Subject: Make test marcos for true/false checks reliable for all integral types. X-Git-Tag: OpenSSL_1_1_1-pre1~1820 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=298f40e1f14981e535f82edf407718680ad7f86a;p=oweals%2Fopenssl.git Make test marcos for true/false checks reliable for all integral types. Reviewed-by: Richard Levitte Reviewed-by: Rich Salz (Merged from https://github.com/openssl/openssl/pull/3154) --- diff --git a/test/testutil.h b/test/testutil.h index 1ca295cc16..a83323b9e8 100644 --- a/test/testutil.h +++ b/test/testutil.h @@ -291,8 +291,8 @@ void test_info_c90(const char *desc, ...) PRINTF_FORMAT(1, 2); # define TEST_mem_eq(a, m, b, n) test_mem_eq(__FILE__, __LINE__, #a, #b, a, m, b, n) # define TEST_mem_ne(a, m, b, n) test_mem_ne(__FILE__, __LINE__, #a, #b, a, m, b, n) -# define TEST_true(a) test_true(__FILE__, __LINE__, #a, a) -# define TEST_false(a) test_false(__FILE__, __LINE__, #a, a) +# define TEST_true(a) test_true(__FILE__, __LINE__, #a, (a) != 0) +# define TEST_false(a) test_false(__FILE__, __LINE__, #a, (a) != 0) /* * TEST_error(desc, ...) prints an informative error message in the standard