[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:
This commit is contained in:
Pedro Vicente Nunes 2004-04-07 20:44:14 -05:00
parent 791e811bb5
commit 698f1af7ce
8 changed files with 172 additions and 12 deletions

View File

@ -1474,6 +1474,8 @@
./tools/testfiles/h5diff_80.txt
#test files for h5repack
./tools/testfiles/test1.h5
./tools/testfiles/test3.h5
./tools/testfiles/test4.h5
./tools/testfiles/h5repack_info.txt

View File

@ -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,

View File

@ -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
# 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 FLET
DIFFTEST test4.h5 test4.out.h5
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
#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
#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
#limit
TOOLTEST -i test4.h5 -o test4.out.h5 -f GZIP=1 -m 1024
DIFFTEST test4.h5 test4.out.h5
TOOLTEST -i test4.h5 -o test4.out.h5 -f NONE
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

View File

@ -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;

View File

@ -84,9 +84,7 @@ int make_testfiles(void)
return 0;
out:
H5E_BEGIN_TRY {
H5Fclose(loc_id);
} H5E_END_TRY;
return -1;
}

BIN
tools/testfiles/test1.h5 Normal file

Binary file not shown.

BIN
tools/testfiles/test3.h5 Normal file

Binary file not shown.

Binary file not shown.