From b50ced1b45fe8b2c9ffa1b7704f612400d37d40e Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Mon, 27 Jun 2022 11:23:34 +0100 Subject: [PATCH] Testing: Use Assert because if NDEBUG was defined the assert macro is disabled --- tests/grib_geo_iter.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/tests/grib_geo_iter.c b/tests/grib_geo_iter.c index c19044aa4..fb8482632 100644 --- a/tests/grib_geo_iter.c +++ b/tests/grib_geo_iter.c @@ -10,9 +10,8 @@ #include #include -#include -#include "grib_api.h" +#include "grib_api_internal.h" int main(int argc, char** argv) { @@ -25,23 +24,23 @@ int main(int argc, char** argv) grib_iterator* iter = NULL; h = grib_handle_new_from_samples(0, sample_filename); - assert(h); + Assert(h); iter = grib_iterator_new(h, 0, &err); - assert(!err); - assert(iter); + Assert(!err); + Assert(iter); - assert(grib_iterator_has_next(iter)); + Assert(grib_iterator_has_next(iter)); n = 0; while (grib_iterator_next(iter, &lat, &lon, &value)) { if (n < numberOfDataPoints - 1) - assert(grib_iterator_has_next(iter)); + Assert(grib_iterator_has_next(iter)); n++; } - assert(n == numberOfDataPoints); + Assert(n == numberOfDataPoints); - assert(grib_iterator_has_next(iter) == 0); + Assert(grib_iterator_has_next(iter) == 0); grib_iterator_delete(iter);