summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorBinh-Minh Ribler <bmribler@hdfgroup.org>2018-02-17 22:18:37 (GMT)
committerBinh-Minh Ribler <bmribler@hdfgroup.org>2018-02-17 22:18:37 (GMT)
commit39e3da756333d5c0e5f024d9067edbadea4a018b (patch)
tree5cb6498035993710459df84370f246665c74796c /tools
parentb65ec9d05b9301ec639fac03b26c6ec06e463888 (diff)
downloadhdf5-39e3da756333d5c0e5f024d9067edbadea4a018b.zip
hdf5-39e3da756333d5c0e5f024d9067edbadea4a018b.tar.gz
hdf5-39e3da756333d5c0e5f024d9067edbadea4a018b.tar.bz2
Improving tests
Description: - Added test for version bounds with nested datatypes - Added script for additional version bound test in h5repack - Cleaned up tests for consistency - Removed extra included header files Platforms tested: Linux/64 (jelly) Linux/64 (moohan) Darwin (osx1010test)
Diffstat (limited to 'tools')
-rw-r--r--tools/test/h5repack/h5repack.sh.in96
1 files changed, 94 insertions, 2 deletions
diff --git a/tools/test/h5repack/h5repack.sh.in b/tools/test/h5repack/h5repack.sh.in
index e474bc3..a34b75c 100644
--- a/tools/test/h5repack/h5repack.sh.in
+++ b/tools/test/h5repack/h5repack.sh.in
@@ -340,8 +340,8 @@ VERIFY_LAYOUT_DSET()
fi
# clean up tmp files
- rm -f $outfile
- rm -f $layoutfile
+# rm -f $outfile
+# rm -f $layoutfile
}
#------------------------------------------
@@ -513,6 +513,86 @@ VERIFY_LAYOUT_ALL()
rm -f $layoutfile
}
+#--------------------------------------------------------------
+# Verifying superblock of a file with different version bounds
+VERIFY_SUPERBLOCK()
+{
+ lowbound=$1
+ highbound=$2
+ superblock=$3
+ infile=$4
+ layoutfile=verbounds-low$lowbound-high$highbound.$4
+ outfile=out-verbounds-low$lowbound-high$highbound.$infile
+ expectedsuperblock="SUPERBLOCK_VERSION $superblock"
+
+ shift
+ shift
+ shift
+ shift
+
+ TESTING $H5REPACK $@
+ (
+ cd $TESTDIR
+ $RUNSERIAL $H5REPACK_BIN -j $lowbound -k $highbound $infile $outfile
+echo "$RUNSERIAL $H5REPACK_BIN -j $lowbound -k $highbound $infile $outfile"
+ )
+ RET=$?
+ if [ $RET != 0 ] ; then
+ echo "*FAILED*"
+ nerrors="`expr $nerrors + 1`"
+ else
+ echo " PASSED"
+ DIFFTEST $infile $outfile
+ fi
+
+ #---------------------------------
+ # check the layout from a dataset
+ VERIFY "superblock"
+ (
+ cd $TESTDIR
+ $RUNSERIAL $H5DUMP_BIN -H -B $outfile > $layoutfile
+ )
+ $GREP "$expectedsuperblock" $TESTDIR/$layoutfile > /dev/null
+ if [ $? -eq 0 ]; then
+ echo " PASSED"
+ else
+ echo " FAILED"
+ nerrors="`expr $nerrors + 1`"
+ fi
+
+ # clean up tmp files
+ rm -f $outfile
+ rm -f $layoutfile
+
+} # end of VERIFY_SUPERBLOCK
+
+#------------------------------------------------------------------
+# Verifying that a latest file cannot be opened with earlier bounds
+VERIFY_INVALIDBOUNDS()
+{
+ lowbound=$1
+ highbound=$2
+ infile=$3
+ outfile=out-verbounds-low$lowbound-high$highbound.$infile
+
+ TESTING $H5REPACK $@
+ (
+ cd $TESTDIR
+ $RUNSERIAL $H5REPACK_BIN -j $lowbound -k $highbound $infile $outfile
+ )
+ RET=$?
+ if [ $RET != 0 ] ; then
+ echo " PASSED"
+ else
+ echo "*FAILED*"
+ nerrors="`expr $nerrors + 1`"
+ fi
+
+ # clean up tmp files
+ rm -f $outfile
+
+} # end of VERIFY_INVALIDBOUNDS
+
# same as TOOLTEST, but it uses the old syntax -i input_file -o output_file
#
TOOLTEST0()
@@ -1365,6 +1445,18 @@ else
VERIFY_LAYOUT_VDS vds_conti 4_vds.h5 vds_dset CONTIGUOUS -l vds_dset:CONTI
fi
+#########################################################
+# Testing version bounds
+#########################################################
+# -j 0 -k 2, superblock will be 0
+VERIFY_SUPERBLOCK 0 2 0 h5repack_layout.h5 -j 0 -k 2 h5repack_layout.h5
+# -j 1 -k 2, superblock will be 2
+VERIFY_SUPERBLOCK 1 2 2 h5repack_layout.h5 -j 1 -k 2 h5repack_layout.h5
+# -j 2 -k 2, superblock will be 3
+VERIFY_SUPERBLOCK 2 2 3 h5repack_layout.h5 -j 2 -k 2 h5repack_layout.h5
+# -j 0 -k 1, file cannot be opened
+VERIFY_INVALIDBOUNDS 0 1 bounds_latest_latest.h5
+
# Clean up temporary files/directories
CLEAN_TESTFILES_AND_TESTDIR