Examples: print error rather than assert

This commit is contained in:
Shahram Najm 2021-03-21 17:27:14 +00:00
parent d1ae16ae15
commit 9e52edd4a3
1 changed files with 4 additions and 2 deletions

View File

@ -62,8 +62,10 @@ int main(int argc, char* argv[])
}
is_missing = codes_is_missing(h, "relativeHumidity", &err);
assert(!err);
assert(is_missing == 1);
if (err || !is_missing) {
fprintf(stderr, "Error: relativeHumidity should be 'missing'\n");
return 1;
}
/* Set some other keys to be missing */
CODES_CHECK(codes_set_missing(h, "blockNumber"), 0);