From 61b281ee55eddad36dc8fdf46522927ff9bc90b9 Mon Sep 17 00:00:00 2001 From: AlysonStahl-NOAA <166434581+AlysonStahl-NOAA@users.noreply.github.com> Date: Wed, 8 May 2024 11:07:54 -0600 Subject: [PATCH] another test --- tests/CMakeLists.txt | 1 + tests/data/ref_sec_len.simple_packing.grib2.txt | 1 + tests/run_wgrib2_tests.sh | 17 ++++++++++------- 3 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 tests/data/ref_sec_len.simple_packing.grib2.txt diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 567c6d95..7df54be7 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -97,6 +97,7 @@ copy_test_data(ref_rpn.windspeed.gdas.t12z.pgrb2.1p00.anl.75r.grib2.txt) copy_test_data(ref_sec0.gdas.t12z.pgrb2.1p00.anl.75r.grib2) copy_test_data(ref_sec0.gdas.t12z.pgrb2.1p00.anl.75r.grib2.txt) copy_test_data(ref_sec_len.gdaswave.t00z.wcoast.0p16.f000.grib2.txt) +copy_test_data(ref_sec_len.simple_packing.grib2.txt) # Run these shell tests. shell_test(run_wgrib2_tests) diff --git a/tests/data/ref_sec_len.simple_packing.grib2.txt b/tests/data/ref_sec_len.simple_packing.grib2.txt new file mode 100644 index 00000000..ac1a624e --- /dev/null +++ b/tests/data/ref_sec_len.simple_packing.grib2.txt @@ -0,0 +1 @@ +1:0:Sec size msg=97922 id(1)=21 local(2)=0 grid(3)=72 product(4)=37 data-rep(5)=21 bitmap(6)=6 data(7)=97745 diff --git a/tests/run_wgrib2_tests.sh b/tests/run_wgrib2_tests.sh index 028ef86b..4f899e4f 100755 --- a/tests/run_wgrib2_tests.sh +++ b/tests/run_wgrib2_tests.sh @@ -45,18 +45,21 @@ cat sec0.txt cmp sec0.txt data/ref_sec0.gdas.t12z.pgrb2.1p00.anl.75r.grib2.txt echo "*** Testing checksum on section 0" -chksum0=`../wgrib2/wgrib2 sec0.grb -checksum -1` -chksum1=`../wgrib2/wgrib2 data/ref_sec0.gdas.t12z.pgrb2.1p00.anl.75r.grib2 -checksum 0` - -if [ "$cksum0" != "$cksum1" ] ; then - echo "checksum failed" - exit 1 -fi +../wgrib2/wgrib2 sec0.grb -checksum 0 > chksum1.txt +../wgrib2/wgrib2 data/ref_sec0.gdas.t12z.pgrb2.1p00.anl.75r.grib2 -checksum 0 > chksum2.txt +touch chksum1.txt +touch chksum2.txt +cmp chksum1.txt chksum2.txt echo "*** Testing sec_len" ../wgrib2/wgrib2 data/gdaswave.t00z.wcoast.0p16.f000.grib2 -Sec_len > sec_len.txt cat sec_len.txt cmp sec_len.txt data/ref_sec_len.gdaswave.t00z.wcoast.0p16.f000.grib2.txt +echo "*** Testing sec_len on a small file" +../wgrib2/wgrib2 data/ref_simple_packing.grib2 -Sec_len > sec_len_small.txt +cat sec_len_small.txt +cmp sec_len_small.txt data/ref_sec_len.simple_packing.grib2.txt + echo "*** SUCCESS!" exit 0