From 2aefbf76034212e2be23d4542262a5b9d88181db Mon Sep 17 00:00:00 2001 From: Paul Harten Date: Tue, 5 Jan 1999 14:40:32 -0500 Subject: [svn-r1004] Purpose: Conform closer to other test print-out. Solution: Added "All h5dump tests passed." statement to output of testh5dump.sh when appropriate. Similarly, added "All h5toh4 tests passed." statement to output of testh5toh4 when appropriate. Also, added the testing of converting H5 files with loop pathways into H4 files with recursive references. Platforms tested: Solaris2.5, Digital Unix 4.0 --- tools/testfiles/tloop.dmp | 53 +++++++++++++++++++++++++++++++++++++++++++++++ tools/testh5dump.sh | 5 +++++ tools/testh5toh4 | 37 +++++++++++++++++++++++---------- 3 files changed, 84 insertions(+), 11 deletions(-) create mode 100644 tools/testfiles/tloop.dmp diff --git a/tools/testfiles/tloop.dmp b/tools/testfiles/tloop.dmp new file mode 100644 index 0000000..0f85156 --- /dev/null +++ b/tools/testfiles/tloop.dmp @@ -0,0 +1,53 @@ +File name: testfiles/tloop.hdf + + +Vgroup:0 + tag = 1965; reference = 2; + name = /; class = HDF5; + number of entries = 2; + number of attributes = 0 +Entries:- + #0 (Vgroup) + tag = 1965;reference = 3; + number of entries = 1; + name = g1; class = HDF5 + number of attributes = 0 + #1 (Vgroup) + tag = 1965;reference = 4; + number of entries = 1; + name = g1.1; class = HDF5 + number of attributes = 0 + + +Vgroup:1 + tag = 1965; reference = 3; + name = g1; class = HDF5; + number of entries = 1; + number of attributes = 0 +Entries:- + #0 (Vgroup) + tag = 1965;reference = 4; + number of entries = 1; + name = g1.1; class = HDF5 + number of attributes = 0 + + +Vgroup:2 + tag = 1965; reference = 4; + name = g1.1; class = HDF5; + number of entries = 1; + number of attributes = 0 +Entries:- + #0 (Vgroup) + tag = 1965;reference = 3; + number of entries = 1; + name = g1; class = HDF5 + number of attributes = 0 + + +Graphical representation of the file:- +(vg#: vgroup; vd: vdata) + +File name: testfiles/tloop.hdf + +File name: testfiles/tloop.hdf diff --git a/tools/testh5dump.sh b/tools/testh5dump.sh index 5645d60..6ad84e2 100755 --- a/tools/testh5dump.sh +++ b/tools/testh5dump.sh @@ -112,3 +112,8 @@ DUMP tall-3.ddl -d /g2/dset2.1 -l /g1/g1.2/g1.2.1/slink tall.h5 # test for loop detection DUMP tloop-1.ddl tloop.h5 + +if test "0" = "$nerrors"; then + echo "All h5dump tests passed." +fi + diff --git a/tools/testh5toh4 b/tools/testh5toh4 index 87f3ef3..8f4b0a5 100644 --- a/tools/testh5toh4 +++ b/tools/testh5toh4 @@ -22,10 +22,10 @@ TESTING() # Run a test and print PASS or *FAIL*. If a test fails then increment # the `nerrors' global variable and (if $verbose is set) display the # difference between the actual output and the expected output. The -# expected output is given as the first argument to this function and -# the actual output file is calculated by replacing the `.ddl' with -# `.out'. The actual output is not removed if $HDF5_NOCLEANUP has a -# non-zero value. +# expected output is given by adding a `.dmp' extension to the root of +# the first argument to this function and the actual output file is +# calculated by replacing the `.dmp' with `.tmp'. The actual output +# is not removed if $HDF5_NOCLEANUP has a value. CONVERT() { # Run h5toh4 convert. @@ -48,7 +48,11 @@ CONVERT() actual=`echo $h4file | $SED -e s/\.hdf/.tmp/` expect=`echo $h4file | $SED -e s/\.hdf/.dmp/` - $H4DUMP dumpvg $h4file > $actual + if test "testfiles/tloop.hdf" = "$h4file"; then + $H4DUMP dumpvg $h4file | head -50 > $actual + else + $H4DUMP dumpvg $h4file > $actual + fi $H4DUMP dumpvd $h4file >> $actual @@ -67,9 +71,9 @@ CONVERT() if test "passed" = "$multirun"; then echo "*FAILED*" echo " Actual result (*.tmp) differs from expected result (*.dmp)" + nerrors="`expr $nerrors + 1`" multirun=failed fi - nerrors="`expr $nerrors + 1`" test yes = "$verbose" && $diff $expect $actual |sed 's/^/ /' fi @@ -77,6 +81,7 @@ CONVERT() rm -f $expect-norm $actual-norm if [ X = ${HDF5_NOCLEANUP:-X} ]; then rm -f $actual + rm -f $h4file fi done if test "passed" = "$multirun"; then @@ -98,10 +103,12 @@ CONVERT() actual=`echo $h4file | $SED -e s/\.hdf/.tmp/` expect=`echo $h4file | $SED -e s/\.hdf/.dmp/` - $H4DUMP dumpvg $h4file > $actual - + if test "testfiles/tloop.hdf" = "$h4file"; then + $H4DUMP dumpvg $h4file | head -50 > $actual + else + $H4DUMP dumpvg $h4file > $actual + fi $H4DUMP dumpvd $h4file >> $actual - $H4DUMP dumpsds $h4file >> $actual @@ -125,6 +132,7 @@ CONVERT() rm -f $expect-norm $actual-norm if [ X = ${HDF5_NOCLEANUP:-X} ]; then rm -f $actual + rm -f $h4file fi ;; @@ -168,6 +176,9 @@ CONVERT tcompound.h5 # test for converting all H5 objects at in same file. CONVERT tall.h5 +# tests for converting H5 objects with loops. +CONVERT tloop.h5 + # test for converting extendable H5 datasets to H4 SDS's. CONVERT tdset2.h5 @@ -190,6 +201,7 @@ CONVERT tslink.h5 tslink.hdf CONVERT thlink.h5 thlink.hdf CONVERT tcompound.h5 tcompound.hdf CONVERT tall.h5 tall.hdf +CONVERT tloop.h5 tloop.hdf CONVERT tdset2.h5 tdset2.hdf CONVERT tcompound2.h5 tcompound2.hdf CONVERT tmany.h5 tmany.hdf @@ -199,7 +211,10 @@ CONVERT tmany.h5 tmany.hdf # $RM ./testfiles/*.hdf ./testfiles/*.tmp CONVERT -m tgroup.h5 tdset.h5 tattr.h5 tslink.h5 thlink.h5 -CONVERT -m tcompound.h5 tall.h5 +CONVERT -m tcompound.h5 tall.h5 tloop.h5 CONVERT -m tdset2.h5 tcompound2.h5 tmany.h5 -$RM ./testfiles/*.hdf ./testfiles/*.tmp + +if test "0" = "$nerrors"; then + echo "All h5toh4 tests passed." +fi -- cgit v0.12