diff options
author | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2004-04-08 01:44:14 (GMT) |
---|---|---|
committer | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2004-04-08 01:44:14 (GMT) |
commit | 698f1af7cef2b2b471a8938d122fb44b2d94c0a2 (patch) | |
tree | 185c6ba6b8d578b4fd2649129474e85ce416c787 /tools/h5repack | |
parent | 791e811bb531964e5a5d72c40b5ab8faa2649836 (diff) | |
download | hdf5-698f1af7cef2b2b471a8938d122fb44b2d94c0a2.zip hdf5-698f1af7cef2b2b471a8938d122fb44b2d94c0a2.tar.gz hdf5-698f1af7cef2b2b471a8938d122fb44b2d94c0a2.tar.bz2 |
[svn-r8320] Purpose:
new tests for h5repack
Description:
added more tests both to the test program and shell script that test
a variation of different filter converssions
Solution:
Platforms tested:
linux
Misc. update:
Diffstat (limited to 'tools/h5repack')
-rw-r--r-- | tools/h5repack/h5repack.c | 6 | ||||
-rw-r--r-- | tools/h5repack/h5repack.sh | 113 | ||||
-rw-r--r-- | tools/h5repack/testh5repack_main.c | 61 | ||||
-rw-r--r-- | tools/h5repack/testh5repack_make.c | 2 |
4 files changed, 170 insertions, 12 deletions
diff --git a/tools/h5repack/h5repack.c b/tools/h5repack/h5repack.c index f980e3e..21166b7 100644 --- a/tools/h5repack/h5repack.c +++ b/tools/h5repack/h5repack.c @@ -338,7 +338,11 @@ static int check_options(pack_opt_t *options) szip_pixels_per_block=pack.filter[j].cd_values[0]; /* check szip parameters */ - if (check_szip(0, /* do not test size */ + if ( pack.chunk.rank!=-1 /* + it means a layout was not input, so there is no + case to try to check it + */ + && check_szip(0, /* do not test size */ pack.chunk.rank, pack.chunk.chunk_lengths, szip_options_mask, diff --git a/tools/h5repack/h5repack.sh b/tools/h5repack/h5repack.sh index bac641a..a471ba9 100644 --- a/tools/h5repack/h5repack.sh +++ b/tools/h5repack/h5repack.sh @@ -99,35 +99,132 @@ DIFFTEST() # -#The tests -#We use the file "test4.h5" generated by h5repacktst -#Each run generates "file4.out.h5" and the tool h5diff is used to +# The tests +# We use the files generated by h5repacktst +# Each run generates "file4.out.h5" and the tool h5diff is used to # compare the input and output files # + +# copy files +TOOLTEST -i test1.h5 -o test1.out.h5 +DIFFTEST test1.h5 test1.out.h5 + +TOOLTEST -i test3.h5 -o test3.out.h5 +DIFFTEST test3.h5 test3.out.h5 + TOOLTEST -i test4.h5 -o test4.out.h5 DIFFTEST test4.h5 test4.out.h5 + +#TOOLTEST -i test5.h5 -o test5.out.h5 +#DIFFTEST test5.h5 test5.out.h5 + +# remove all filters +TOOLTEST -i test4.h5 -o test4.out.h5 -f NONE +DIFFTEST test4.h5 test4.out.h5 + +# remove one filter +TOOLTEST -i test4.h5 -o test4.out.h5 -f dset_gzip:NONE +DIFFTEST test4.h5 test4.out.h5 + +# gzip +TOOLTEST -i test4.h5 -o test4.out.h5 -f dset1:GZIP=9 +DIFFTEST test4.h5 test4.out.h5 + TOOLTEST -i test4.h5 -o test4.out.h5 -f GZIP=1 DIFFTEST test4.h5 test4.out.h5 + +# szip +TOOLTEST -i test4.h5 -o test4.out.h5 -f dset1:SZIP=8 +DIFFTEST test4.h5 test4.out.h5 + TOOLTEST -i test4.h5 -o test4.out.h5 -f SZIP=8 DIFFTEST test4.h5 test4.out.h5 + +# shuffle +TOOLTEST -i test4.h5 -o test4.out.h5 -f dset1:SHUF +DIFFTEST test4.h5 test4.out.h5 + TOOLTEST -i test4.h5 -o test4.out.h5 -f SHUF DIFFTEST test4.h5 test4.out.h5 -TOOLTEST -i test4.h5 -o test4.out.h5 -f FLET + +# fletcher +TOOLTEST -i test4.h5 -o test4.out.h5 -f dset1:FLET DIFFTEST test4.h5 test4.out.h5 -TOOLTEST -i test4.h5 -o test4.out.h5 -f dset1:SHUF -f dset1,dset2:GZIP=6 + +TOOLTEST -i test4.h5 -o test4.out.h5 -f FLET DIFFTEST test4.h5 test4.out.h5 -TOOLTEST -i test4.h5 -o test4.out.h5 -l dset1:CHUNK=20x10 -f dset1,dset2:SZIP=8 + +#layout chunk +TOOLTEST -i test4.h5 -o test4.out.h5 -l dset1:CHUNK=20x10 DIFFTEST test4.h5 test4.out.h5 + TOOLTEST -i test4.h5 -o test4.out.h5 -l CHUNK=20x10 DIFFTEST test4.h5 test4.out.h5 + +#layout compact +TOOLTEST -i test4.h5 -o test4.out.h5 -l dset1:COMPA +DIFFTEST test4.h5 test4.out.h5 + TOOLTEST -i test4.h5 -o test4.out.h5 -l COMPA DIFFTEST test4.h5 test4.out.h5 + +#layout contiguous +TOOLTEST -i test4.h5 -o test4.out.h5 -l dset1:CONTI +DIFFTEST test4.h5 test4.out.h5 + TOOLTEST -i test4.h5 -o test4.out.h5 -l CONTI DIFFTEST test4.h5 test4.out.h5 -TOOLTEST -i test4.h5 -o test4.out.h5 -f GZIP=1 -m 1024 + +#conversions +TOOLTEST -i test4.h5 -o test4.out.h5 -l dset_compact:CONTI +DIFFTEST test4.h5 test4.out.h5 + +TOOLTEST -i test4.h5 -o test4.out.h5 -l dset_compact:CHUNK=2x5 +DIFFTEST test4.h5 test4.out.h5 + +TOOLTEST -i test4.h5 -o test4.out.h5 -l dset_compact:COMPA +DIFFTEST test4.h5 test4.out.h5 + +TOOLTEST -i test4.h5 -o test4.out.h5 -l dset_contiguous:COMPA +DIFFTEST test4.h5 test4.out.h5 + +TOOLTEST -i test4.h5 -o test4.out.h5 -l dset_contiguous:CHUNK=3x6 +DIFFTEST test4.h5 test4.out.h5 + +TOOLTEST -i test4.h5 -o test4.out.h5 -l dset_contiguous:CONTI +DIFFTEST test4.h5 test4.out.h5 + +TOOLTEST -i test4.h5 -o test4.out.h5 -l dset_chunk:COMPA +DIFFTEST test4.h5 test4.out.h5 + +TOOLTEST -i test4.h5 -o test4.out.h5 -l dset_chunk:CONTI +DIFFTEST test4.h5 test4.out.h5 + +TOOLTEST -i test4.h5 -o test4.out.h5 -l dset_chunk:CHUNK=18x13 +DIFFTEST test4.h5 test4.out.h5 + +#filters +TOOLTEST -i test4.h5 -o test4.out.h5 -f dset1:SHUF -f dset1,dset2:GZIP=6 +DIFFTEST test4.h5 test4.out.h5 + +TOOLTEST -i test4.h5 -o test4.out.h5 -l dset1:CHUNK=20x10 -f dset1,dset2:SZIP=8 +DIFFTEST test4.h5 test4.out.h5 + +#filter conversions +TOOLTEST -i test4.h5 -o test4.out.h5 -f dset_gzip:SZIP=8 +DIFFTEST test4.h5 test4.out.h5 + +TOOLTEST -i test4.h5 -o test4.out.h5 -f dset_szip:GZIP=1 +DIFFTEST test4.h5 test4.out.h5 + +TOOLTEST -i test4.h5 -o test4.out.h5 -f dset_all:GZIP=1 DIFFTEST test4.h5 test4.out.h5 -TOOLTEST -i test4.h5 -o test4.out.h5 -f NONE + +#limit +TOOLTEST -i test4.h5 -o test4.out.h5 -f GZIP=1 -m 1024 DIFFTEST test4.h5 test4.out.h5 + +#file #TOOLTEST -i test4.h5 -o test4.out.h5 -e h5repack_info.txt #DIFFTEST test4.h5 test4.out.h5 diff --git a/tools/h5repack/testh5repack_main.c b/tools/h5repack/testh5repack_main.c index a008455..dbd6f58 100644 --- a/tools/h5repack/testh5repack_main.c +++ b/tools/h5repack/testh5repack_main.c @@ -702,7 +702,7 @@ int main (void) PASSED(); - TESTING(" filter queue"); + TESTING(" filter queue fletcher, shuffle, deflate, szip"); /*------------------------------------------------------------------------- * add some filters @@ -734,6 +734,65 @@ int main (void) PASSED(); + TESTING(" filter conversion from deflate to szip"); +/*------------------------------------------------------------------------- + * filter conversion from deflate to szip + *------------------------------------------------------------------------- + */ + if (h5repack_init (&pack_options, 0)<0) + TEST_ERROR; + if (h5repack_addfilter("dset_gzip:SZIP=8",&pack_options)<0) + TEST_ERROR; + if (h5repack(FNAME4,FNAME4OUT,&pack_options)<0) + TEST_ERROR; + if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) == 1) + TEST_ERROR; + if (h5repack_verify(FNAME4OUT,&pack_options)<=0) + TEST_ERROR; + if (h5repack_end (&pack_options)<0) + TEST_ERROR; + PASSED(); + + TESTING(" filter conversion from szip to deflate"); +/*------------------------------------------------------------------------- + * filter conversion from szip to deflate + *------------------------------------------------------------------------- + */ + if (h5repack_init (&pack_options, 0)<0) + TEST_ERROR; + if (h5repack_addfilter("dset_szip:GZIP=1",&pack_options)<0) + TEST_ERROR; + if (h5repack(FNAME4,FNAME4OUT,&pack_options)<0) + TEST_ERROR; + if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) == 1) + TEST_ERROR; + if (h5repack_verify(FNAME4OUT,&pack_options)<=0) + TEST_ERROR; + if (h5repack_end (&pack_options)<0) + TEST_ERROR; + PASSED(); + + TESTING(" filter conversion from 2 filters to 1 filter"); +/*------------------------------------------------------------------------- + * filter conversion from szip to deflate + *------------------------------------------------------------------------- + */ + if (h5repack_init (&pack_options, 0)<0) + TEST_ERROR; + if (h5repack_addfilter("dset_all:GZIP=1",&pack_options)<0) + TEST_ERROR; + if (h5repack(FNAME4,FNAME4OUT,&pack_options)<0) + TEST_ERROR; + if (h5diff(FNAME4,FNAME4OUT,NULL,NULL,&diff_options) == 1) + TEST_ERROR; + if (h5repack_verify(FNAME4OUT,&pack_options)<=0) + TEST_ERROR; + if (h5repack_end (&pack_options)<0) + TEST_ERROR; + PASSED(); + + + puts("All h5repack tests passed."); return 0; diff --git a/tools/h5repack/testh5repack_make.c b/tools/h5repack/testh5repack_make.c index faacce4..fbf5cf5 100644 --- a/tools/h5repack/testh5repack_make.c +++ b/tools/h5repack/testh5repack_make.c @@ -84,9 +84,7 @@ int make_testfiles(void) return 0; out: - H5E_BEGIN_TRY { H5Fclose(loc_id); - } H5E_END_TRY; return -1; } |