Skip to content

Commit

Permalink
another test
Browse files Browse the repository at this point in the history
  • Loading branch information
AlysonStahl-NOAA committed May 8, 2024
1 parent 055825d commit 61b281e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
1 change: 1 addition & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions tests/data/ref_sec_len.simple_packing.grib2.txt
Original file line number Diff line number Diff line change
@@ -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
17 changes: 10 additions & 7 deletions tests/run_wgrib2_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 61b281e

Please sign in to comment.