diff --git a/tests/lam_bf.c b/tests/lam_bf.c index 280c02077..d242c51fa 100644 --- a/tests/lam_bf.c +++ b/tests/lam_bf.c @@ -717,11 +717,14 @@ int main (int argc, char * argv[]) char f[128]; FILE * fp; size_t size; - char * buffer; - sprintf (f, "lam_bf_%s.grib", grids[igrid]); + const void * buffer = NULL; + sprintf (f, "lam_bf_%s.grib", grids[igrid]); fp = fopen (f, "w"); GRIB_CHECK (grib_get_message (h, &buffer, &size), 0); - fwrite (buffer, 1, size, fp); + if (fwrite (buffer, 1, size, fp) != size) { + perror(f); + return 1; + } fclose (fp); } diff --git a/tests/lam_bf.sh b/tests/lam_bf.sh index d3d7a15f3..8f285636b 100755 --- a/tests/lam_bf.sh +++ b/tests/lam_bf.sh @@ -10,5 +10,8 @@ . ./include.sh - exec $test_dir/lam_bf -#xterm -e gdb $test_dir/lam_bf +${test_dir}/lam_bf + +${tools_dir}/grib_dump -O lam_bf_lambert_bf.grib +${tools_dir}/grib_dump -O lam_bf_mercator_bf.grib +${tools_dir}/grib_dump -O lam_bf_polar_stereographic_bf.grib diff --git a/tests/lam_gp.c b/tests/lam_gp.c index ec6fc590c..f85babb57 100644 --- a/tests/lam_gp.c +++ b/tests/lam_gp.c @@ -920,11 +920,14 @@ int main (int argc, char * argv[]) char f[128]; FILE * fp; size_t size; - char * buffer; - sprintf (f, "lam_gp_%s.grib", grids[igrid]); + const void * buffer = NULL; + sprintf (f, "lam_gp_%s.grib", grids[igrid]); fp = fopen (f, "w"); GRIB_CHECK (grib_get_message (h, &buffer, &size), 0); - fwrite (buffer, 1, size, fp); + if (fwrite (buffer, 1, size, fp) != size) { + perror(f); + return 1; + } fclose (fp); } diff --git a/tests/lam_gp.sh b/tests/lam_gp.sh index 692b93371..17aa6d9a8 100755 --- a/tests/lam_gp.sh +++ b/tests/lam_gp.sh @@ -10,5 +10,8 @@ . ./include.sh - exec $test_dir/lam_gp -#xterm -e gdb $test_dir/lam_gp +${test_dir}/lam_gp + +${tools_dir}/grib_dump -O lam_gp_lambert_lam.grib +${tools_dir}/grib_dump -O lam_gp_mercator_lam.grib +${tools_dir}/grib_dump -O lam_gp_polar_stereographic_lam.grib