From: Eric Haszlakiewicz Date: Mon, 30 May 2022 15:39:54 +0000 (+0000) Subject: Unset NDEBUG so assert() is enabled in all tests. One more fix there when building... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=49c3721a5a1b7e561f27e7cfcfac250a9d9b6f8b;p=json-c Unset NDEBUG so assert() is enabled in all tests. One more fix there when building with -DCMAKE_BUILD_TYPE=release. --- diff --git a/tests/parse_flags.c b/tests/parse_flags.c index d0a71bc..6224ca3 100644 --- a/tests/parse_flags.c +++ b/tests/parse_flags.c @@ -1,3 +1,6 @@ +#ifdef NDEBUG +#undef NDEBUG +#endif #include "config.h" #include diff --git a/tests/test1.c b/tests/test1.c index 4d29601..01796ab 100644 --- a/tests/test1.c +++ b/tests/test1.c @@ -1,3 +1,6 @@ +#ifdef NDEBUG +#undef NDEBUG +#endif #include #include #include diff --git a/tests/test2.c b/tests/test2.c index 209fa26..0a5f315 100644 --- a/tests/test2.c +++ b/tests/test2.c @@ -1,3 +1,6 @@ +#ifdef NDEBUG +#undef NDEBUG +#endif #include #include #include diff --git a/tests/test4.c b/tests/test4.c index 288cec1..749459d 100644 --- a/tests/test4.c +++ b/tests/test4.c @@ -2,6 +2,9 @@ * gcc -o utf8 utf8.c -I/home/y/include -L./.libs -ljson */ +#ifdef NDEBUG +#undef NDEBUG +#endif #include "config.h" #include #include diff --git a/tests/testReplaceExisting.c b/tests/testReplaceExisting.c index ee3cae0..60a194a 100644 --- a/tests/testReplaceExisting.c +++ b/tests/testReplaceExisting.c @@ -1,3 +1,6 @@ +#ifdef NDEBUG +#undef NDEBUG +#endif #include #include #include diff --git a/tests/test_cast.c b/tests/test_cast.c index fc769f5..276b461 100644 --- a/tests/test_cast.c +++ b/tests/test_cast.c @@ -3,6 +3,9 @@ * Also checks the json_object_get_type and json_object_is_type functions. */ +#ifdef NDEBUG +#undef NDEBUG +#endif #include "config.h" #include #include diff --git a/tests/test_charcase.c b/tests/test_charcase.c index 208a782..c6e783e 100644 --- a/tests/test_charcase.c +++ b/tests/test_charcase.c @@ -1,3 +1,6 @@ +#ifdef NDEBUG +#undef NDEBUG +#endif #include #include #include diff --git a/tests/test_compare.c b/tests/test_compare.c index 6708445..ed697cd 100644 --- a/tests/test_compare.c +++ b/tests/test_compare.c @@ -2,6 +2,9 @@ * Tests if json_object_equal behaves correct. */ +#ifdef NDEBUG +#undef NDEBUG +#endif #include "config.h" #include #include diff --git a/tests/test_double_serializer.c b/tests/test_double_serializer.c index 65c7028..59e95c2 100644 --- a/tests/test_double_serializer.c +++ b/tests/test_double_serializer.c @@ -2,6 +2,9 @@ * Tests if the format string for double serialization is handled correctly */ +#ifdef NDEBUG +#undef NDEBUG +#endif #include "config.h" #include diff --git a/tests/test_float.c b/tests/test_float.c index 99b2b1c..68a763d 100644 --- a/tests/test_float.c +++ b/tests/test_float.c @@ -1,5 +1,8 @@ /* Copyright (C) 2016 by Rainer Gerhards * Released under ASL 2.0 */ +#ifdef NDEBUG +#undef NDEBUG +#endif #include "config.h" #include "json_object.h" #include "json_tokener.h" diff --git a/tests/test_int_add.c b/tests/test_int_add.c index 644aed9..142feac 100644 --- a/tests/test_int_add.c +++ b/tests/test_int_add.c @@ -1,3 +1,6 @@ +#ifdef NDEBUG +#undef NDEBUG +#endif #include #include diff --git a/tests/test_locale.c b/tests/test_locale.c index 55c9cc6..7299ee2 100644 --- a/tests/test_locale.c +++ b/tests/test_locale.c @@ -1,3 +1,6 @@ +#ifdef NDEBUG +#undef NDEBUG +#endif #include #include #include diff --git a/tests/test_null.c b/tests/test_null.c index 0a2275b..d2a0ddc 100644 --- a/tests/test_null.c +++ b/tests/test_null.c @@ -2,6 +2,9 @@ * Tests if binary strings are supported. */ +#ifdef NDEBUG +#undef NDEBUG +#endif #include "config.h" #include #include diff --git a/tests/test_object_iterator.c b/tests/test_object_iterator.c index da5192a..4928088 100644 --- a/tests/test_object_iterator.c +++ b/tests/test_object_iterator.c @@ -1,3 +1,6 @@ +#ifdef NDEBUG +#undef NDEBUG +#endif #include "config.h" #include #include diff --git a/tests/test_parse.c b/tests/test_parse.c index 34dd594..6ddb201 100644 --- a/tests/test_parse.c +++ b/tests/test_parse.c @@ -1,3 +1,6 @@ +#ifdef NDEBUG +#undef NDEBUG +#endif #include #include #include @@ -42,6 +45,7 @@ static void single_incremental_parse(const char *test_string, int clear_serializ json_object *all_at_once_obj, *new_obj; const char *all_at_once_str, *new_str; + new_obj = NULL; assert(chunksize > 0); all_at_once_obj = json_tokener_parse(test_string); if (clear_serializer) diff --git a/tests/test_parse_int64.c b/tests/test_parse_int64.c index 446cc3d..5710b08 100644 --- a/tests/test_parse_int64.c +++ b/tests/test_parse_int64.c @@ -1,4 +1,7 @@ +#ifdef NDEBUG +#undef NDEBUG +#endif #include #include diff --git a/tests/test_printbuf.c b/tests/test_printbuf.c index d0fb918..2a2ccc0 100644 --- a/tests/test_printbuf.c +++ b/tests/test_printbuf.c @@ -1,3 +1,6 @@ +#ifdef NDEBUG +#undef NDEBUG +#endif #include #include #include diff --git a/tests/test_set_serializer.c b/tests/test_set_serializer.c index 06afdf2..27598f4 100644 --- a/tests/test_set_serializer.c +++ b/tests/test_set_serializer.c @@ -1,3 +1,6 @@ +#ifdef NDEBUG +#undef NDEBUG +#endif #include #include #include diff --git a/tests/test_set_value.c b/tests/test_set_value.c index 157e64f..f51a2a5 100644 --- a/tests/test_set_value.c +++ b/tests/test_set_value.c @@ -1,3 +1,6 @@ +#ifdef NDEBUG +#undef NDEBUG +#endif #include #include #include diff --git a/tests/test_strerror.c b/tests/test_strerror.c index 1780564..57b051f 100644 --- a/tests/test_strerror.c +++ b/tests/test_strerror.c @@ -1,3 +1,6 @@ +#ifdef NDEBUG +#undef NDEBUG +#endif #include "strerror_override.h" #include "strerror_override_private.h" diff --git a/tests/test_util_file.c b/tests/test_util_file.c index 9150586..d0cb8a1 100644 --- a/tests/test_util_file.c +++ b/tests/test_util_file.c @@ -1,3 +1,6 @@ +#ifdef NDEBUG +#undef NDEBUG +#endif #include "strerror_override.h" #include "strerror_override_private.h" #ifdef WIN32 diff --git a/tests/test_visit.c b/tests/test_visit.c index eee469e..3283a55 100644 --- a/tests/test_visit.c +++ b/tests/test_visit.c @@ -1,3 +1,6 @@ +#ifdef NDEBUG +#undef NDEBUG +#endif #include #include #include