Skip to content

Commit

Permalink
more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AlysonStahl-NOAA committed May 8, 2024
1 parent 8c964da commit 356b978
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
1 change: 1 addition & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ copy_test_data(ref_rh.gdas.t12z.pgrb2.1p00.anl.75r.grib2.txt)
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)

# Run these shell tests.
shell_test(run_wgrib2_tests)
Expand Down
19 changes: 19 additions & 0 deletions tests/data/ref_sec_len.gdaswave.t00z.wcoast.0p16.f000.grib2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
1:0:Sec size msg=15254 id(1)=21 local(2)=0 grid(3)=72 product(4)=34 data-rep(5)=23 bitmap(6)=4555 data(7)=10529
2:15254:Sec size msg=22643 id(1)=21 local(2)=0 grid(3)=72 product(4)=34 data-rep(5)=23 bitmap(6)=4555 data(7)=17918
3:37897:Sec size msg=15897 id(1)=21 local(2)=0 grid(3)=72 product(4)=34 data-rep(5)=23 bitmap(6)=4555 data(7)=11172
4:53794:Sec size msg=15270 id(1)=21 local(2)=0 grid(3)=72 product(4)=34 data-rep(5)=23 bitmap(6)=4555 data(7)=10545
5:69064:Sec size msg=10418 id(1)=21 local(2)=0 grid(3)=72 product(4)=34 data-rep(5)=23 bitmap(6)=4555 data(7)=5693
6:79482:Sec size msg=11826 id(1)=21 local(2)=0 grid(3)=72 product(4)=34 data-rep(5)=23 bitmap(6)=4555 data(7)=7101
7:91308:Sec size msg=17233 id(1)=21 local(2)=0 grid(3)=72 product(4)=34 data-rep(5)=23 bitmap(6)=4555 data(7)=12508
8:108541:Sec size msg=8175 id(1)=21 local(2)=0 grid(3)=72 product(4)=34 data-rep(5)=23 bitmap(6)=4555 data(7)=3450
9:116716:Sec size msg=12116 id(1)=21 local(2)=0 grid(3)=72 product(4)=34 data-rep(5)=23 bitmap(6)=4555 data(7)=7391
10:128832:Sec size msg=12016 id(1)=21 local(2)=0 grid(3)=72 product(4)=34 data-rep(5)=23 bitmap(6)=4555 data(7)=7291
11:140848:Sec size msg=10884 id(1)=21 local(2)=0 grid(3)=72 product(4)=34 data-rep(5)=23 bitmap(6)=4555 data(7)=6159
12:151732:Sec size msg=9289 id(1)=21 local(2)=0 grid(3)=72 product(4)=34 data-rep(5)=23 bitmap(6)=4555 data(7)=4564
13:161021:Sec size msg=12655 id(1)=21 local(2)=0 grid(3)=72 product(4)=34 data-rep(5)=23 bitmap(6)=4555 data(7)=7930
14:173676:Sec size msg=15749 id(1)=21 local(2)=0 grid(3)=72 product(4)=34 data-rep(5)=23 bitmap(6)=4555 data(7)=11024
15:189425:Sec size msg=15860 id(1)=21 local(2)=0 grid(3)=72 product(4)=34 data-rep(5)=23 bitmap(6)=4555 data(7)=11135
16:205285:Sec size msg=12978 id(1)=21 local(2)=0 grid(3)=72 product(4)=34 data-rep(5)=23 bitmap(6)=4555 data(7)=8253
17:218263:Sec size msg=18772 id(1)=21 local(2)=0 grid(3)=72 product(4)=34 data-rep(5)=23 bitmap(6)=4555 data(7)=14047
18:237035:Sec size msg=22188 id(1)=21 local(2)=0 grid(3)=72 product(4)=34 data-rep(5)=23 bitmap(6)=4555 data(7)=17463
19:259223:Sec size msg=22427 id(1)=21 local(2)=0 grid(3)=72 product(4)=34 data-rep(5)=23 bitmap(6)=4555 data(7)=17702
7 changes: 6 additions & 1 deletion tests/run_wgrib2_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ echo "*** Testing grid information"
cat grid_test.txt
cmp grid_test.txt data/ref_grid.gdaswave.t00z.wcoast.0p16.f000.grib2.txt

echo "*** Testing returning contents of section 0"
echo "*** Testing Sec0"
../wgrib2/wgrib2 data/gdas.t12z.pgrb2.1p00.anl.75r.grib2 -Sec0 -grib_out sec0.grb
../wgrib2/wgrib2 sec0.grb > sec0.txt
cat sec0.txt
Expand All @@ -53,5 +53,10 @@ if [ "$cksum0" != "$cksum1" ] ; then
exit 1
fi

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 "*** SUCCESS!"
exit 0

0 comments on commit 356b978

Please sign in to comment.