mirror of https://github.com/ecmwf/eccodes.git
Testing: Use Assert because if NDEBUG was defined the assert macro is disabled
This commit is contained in:
parent
9271a60777
commit
b50ced1b45
|
@ -10,9 +10,8 @@
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <assert.h>
|
|
||||||
|
|
||||||
#include "grib_api.h"
|
#include "grib_api_internal.h"
|
||||||
|
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
|
@ -25,23 +24,23 @@ int main(int argc, char** argv)
|
||||||
grib_iterator* iter = NULL;
|
grib_iterator* iter = NULL;
|
||||||
|
|
||||||
h = grib_handle_new_from_samples(0, sample_filename);
|
h = grib_handle_new_from_samples(0, sample_filename);
|
||||||
assert(h);
|
Assert(h);
|
||||||
|
|
||||||
iter = grib_iterator_new(h, 0, &err);
|
iter = grib_iterator_new(h, 0, &err);
|
||||||
assert(!err);
|
Assert(!err);
|
||||||
assert(iter);
|
Assert(iter);
|
||||||
|
|
||||||
assert(grib_iterator_has_next(iter));
|
Assert(grib_iterator_has_next(iter));
|
||||||
n = 0;
|
n = 0;
|
||||||
|
|
||||||
while (grib_iterator_next(iter, &lat, &lon, &value)) {
|
while (grib_iterator_next(iter, &lat, &lon, &value)) {
|
||||||
if (n < numberOfDataPoints - 1)
|
if (n < numberOfDataPoints - 1)
|
||||||
assert(grib_iterator_has_next(iter));
|
Assert(grib_iterator_has_next(iter));
|
||||||
n++;
|
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);
|
grib_iterator_delete(iter);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue