X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=test%2Fsanitytest.c;h=c1c51a2b9a6a93ebea4afe97f0dc9c21b98304af;hp=5a9e6bbdb47287ad5206d43fd2f3372c755120a8;hb=1b3e2bbf64b96f636277ca29b31ba152c1831e74;hpb=a9c6d221055c3a85edb23b1364cd60baafed4b9f diff --git a/test/sanitytest.c b/test/sanitytest.c index 5a9e6bbdb4..c1c51a2b9a 100644 --- a/test/sanitytest.c +++ b/test/sanitytest.c @@ -8,7 +8,7 @@ */ #include -#include +#include "internal/numbers.h" #include "testutil.h" @@ -75,12 +75,24 @@ static int test_sanity_unsigned_convertion(void) return 1; } -void register_tests(void) +static int test_sanity_range(void) +{ + /* This isn't possible to check using the framework functions */ + if (SIZE_MAX < INT_MAX) { + TEST_error("int must not be wider than size_t"); + return 0; + } + return 1; +} + +int setup_tests(void) { ADD_TEST(test_sanity_null_zero); ADD_TEST(test_sanity_enum_size); ADD_TEST(test_sanity_twos_complement); ADD_TEST(test_sanity_sign); ADD_TEST(test_sanity_unsigned_convertion); + ADD_TEST(test_sanity_range); + return 1; }