Testing: Comparison of accessors

This commit is contained in:
Shahram Najm 2023-07-24 16:10:55 +01:00
parent 033a1d8d6e
commit d92f2b01d5
2 changed files with 6 additions and 7 deletions

View File

@ -17,7 +17,6 @@ int main(int argc, char* argv[])
grib_handle* h1 = NULL;
grib_handle* h2 = NULL;
int err = 0;
int failed = 0;
size_t count = 0;
Assert(argc == 3);
@ -40,7 +39,6 @@ int main(int argc, char* argv[])
err = codes_compare_key(h1, h2, name, 0);
if (err) {
fprintf(stderr, "key: %s (%s)\n", name, grib_get_error_message(err));
failed = 1;
++count;
}
}
@ -51,8 +49,9 @@ int main(int argc, char* argv[])
}
fclose(f1);
fclose(f2);
if (failed) {
fprintf(stderr, "\nComparison failed: %zu key(s) are different\n", count);
if (count > 0) {
fprintf(stderr, "\nComparison failed: %zu differences\n", count);
return 1;
}
return failed;
return 0;
}

View File

@ -38,7 +38,7 @@ key: minutesAfterDataCutoff (Long values are different)
key: numberOfValues (Long values are different)
key: referenceValue (Double values are different)
Comparison failed: 13 key(s) are different
Comparison failed: 13 differences
EOF
diff $tempRef $tempLog
@ -58,7 +58,7 @@ cat > $tempRef <<EOF
key: referenceValue (Double values are different)
key: codedValues (Double values are different)
Comparison failed: 2 key(s) are different
Comparison failed: 2 differences
EOF
diff $tempRef $tempLog