diff options
Diffstat (limited to 'tools/h5copy')
-rw-r--r-- | tools/h5copy/h5copygentest.c | 35 | ||||
-rw-r--r-- | tools/h5copy/testfiles/h5copytst.h5 | bin | 30448 -> 30480 bytes | |||
-rw-r--r-- | tools/h5copy/testfiles/h5copytst_new.h5 | bin | 0 -> 15029 bytes | |||
-rw-r--r-- | tools/h5copy/testfiles/h5copytst_new.out.ls | 502 | ||||
-rw-r--r-- | tools/h5copy/testh5copy.sh | 18 |
5 files changed, 539 insertions, 16 deletions
diff --git a/tools/h5copy/h5copygentest.c b/tools/h5copy/h5copygentest.c index 7842b38..cd4c234 100644 --- a/tools/h5copy/h5copygentest.c +++ b/tools/h5copy/h5copygentest.c @@ -20,6 +20,7 @@ #include "hdf5.h" #define FILENAME "h5copytst.h5" +#define FILENAME_NEW "h5copytst_new.h5" #define DATASET_SIMPLE "simple" #define DATASET_CHUNK "chunk" #define DATASET_COMPACT "compact" @@ -30,6 +31,8 @@ #define GROUP_EMPTY "grp_empty" #define GROUP_DATASETS "grp_dsets" #define GROUP_NESTED "grp_nested" +#define TRUE 1 +#define FALSE 0 /*------------------------------------------------------------------------- @@ -394,15 +397,29 @@ static void gent_nested_group(hid_t loc_id) int main(void) { - hid_t fid; - - /* Create source file */ - fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - gent_datasets(fid); - gent_empty_group(fid); - gent_nested_datasets(fid); - gent_nested_group(fid); - H5Fclose(fid); + hid_t fid; /* File id */ + hid_t fapl_new; /* File access property id */ + hbool_t new_format; /* New format or old format */ + + fapl_new = H5Pcreate(H5P_FILE_ACCESS); + H5Pset_libver_bounds(fapl_new, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST); + + /* Test with old & new format groups */ + for(new_format = FALSE; new_format <= TRUE; new_format++) { + + /* Set the FAPL for the type of format */ + if(new_format) + fid = H5Fcreate(FILENAME_NEW, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_new); + else + fid = H5Fcreate(FILENAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + + gent_datasets(fid); + gent_empty_group(fid); + gent_nested_datasets(fid); + gent_nested_group(fid); + H5Fclose(fid); + } + H5Pclose(fapl_new); return 0; } diff --git a/tools/h5copy/testfiles/h5copytst.h5 b/tools/h5copy/testfiles/h5copytst.h5 Binary files differindex f407f82..0f10410 100644 --- a/tools/h5copy/testfiles/h5copytst.h5 +++ b/tools/h5copy/testfiles/h5copytst.h5 diff --git a/tools/h5copy/testfiles/h5copytst_new.h5 b/tools/h5copy/testfiles/h5copytst_new.h5 Binary files differnew file mode 100644 index 0000000..57e1805 --- /dev/null +++ b/tools/h5copy/testfiles/h5copytst_new.h5 diff --git a/tools/h5copy/testfiles/h5copytst_new.out.ls b/tools/h5copy/testfiles/h5copytst_new.out.ls new file mode 100644 index 0000000..9df6b2e --- /dev/null +++ b/tools/h5copy/testfiles/h5copytst_new.out.ls @@ -0,0 +1,502 @@ +############################# +Expected output for 'h5ls ../testfiles/h5copytst_new.out.h5' +############################# +Opened "../testfiles/h5copytst_new.out.h5" with sec2 driver. +/ Group + Location: 1:96 + Links: 1 +/A Group + Location: 1:65602 + Links: 1 +/A/B1 Group + Location: 1:66306 + Links: 1 +/A/B1/simple Dataset {6/6} + Location: 1:65509 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX + Storage: <details removed for portability> + Type: 32-bit little-endian integer +/A/B2 Group + Location: 1:69807 + Links: 1 +/A/B2/simple2 Dataset {6/6} + Location: 1:69714 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX + Storage: <details removed for portability> + Type: 32-bit little-endian integer +/C Group + Location: 1:72980 + Links: 1 +/C/D Group + Location: 1:73684 + Links: 1 +/C/D/simple Dataset {6/6} + Location: 1:72887 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX + Storage: <details removed for portability> + Type: 32-bit little-endian integer +/E Group + Location: 1:76217 + Links: 1 +/E/F Group + Location: 1:76921 + Links: 1 +/E/F/grp_dsets Group + Location: 1:75044 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX +/E/F/grp_dsets/chunk Dataset {6/6} + Location: 1:76014 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX + Chunks: {2} 8 bytes + Storage: <details removed for portability> + Type: 32-bit little-endian integer +/E/F/grp_dsets/compact Dataset {6/6} + Location: 1:75367 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX + Storage: <details removed for portability> + Type: 32-bit little-endian integer +/E/F/grp_dsets/compound Dataset {2/2} + Location: 1:75470 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX + Storage: <details removed for portability> + Type: struct { + "str1" +0 20-byte null-terminated ASCII string + "str2" +20 20-byte null-terminated ASCII string + } 40 bytes +/E/F/grp_dsets/compressed Dataset {6/6} + Location: 1:75683 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX + Chunks: {2} 8 bytes + Storage: <details removed for portability> + Filter-0: deflate-1 OPT {1} + Type: 32-bit little-endian integer +/E/F/grp_dsets/named_vl Dataset {2/2} + Location: 1:75853 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX + Storage: <details removed for portability> + Type: shared-1:75793 variable length of + 32-bit little-endian integer +/E/F/grp_dsets/nested_vl Dataset {2/2} + Location: 1:76108 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX + Storage: <details removed for portability> + Type: variable length of + variable length of + 32-bit little-endian integer +/E/F/grp_dsets/simple Dataset {6/6} + Location: 1:75274 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX + Storage: <details removed for portability> + Type: 32-bit little-endian integer +/E/F/grp_dsets/vl Type + Location: 1:75793 + Links: 2 + Modified: XXXX-XX-XX XX:XX:XX XXX + Type: shared-1:75793 variable length of + 32-bit little-endian integer +/G Group + Location: 1:85688 + Links: 1 +/G/H Group + Location: 1:86392 + Links: 1 +/G/H/grp_nested Group + Location: 1:84436 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX +/G/H/grp_nested/grp_dsets Group + Location: 1:84515 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX +/G/H/grp_nested/grp_dsets/chunk Dataset {6/6} + Location: 1:85485 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX + Chunks: {2} 8 bytes + Storage: <details removed for portability> + Type: 32-bit little-endian integer +/G/H/grp_nested/grp_dsets/compact Dataset {6/6} + Location: 1:84838 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX + Storage: <details removed for portability> + Type: 32-bit little-endian integer +/G/H/grp_nested/grp_dsets/compound Dataset {2/2} + Location: 1:84941 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX + Storage: <details removed for portability> + Type: struct { + "str1" +0 20-byte null-terminated ASCII string + "str2" +20 20-byte null-terminated ASCII string + } 40 bytes +/G/H/grp_nested/grp_dsets/compressed Dataset {6/6} + Location: 1:85154 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX + Chunks: {2} 8 bytes + Storage: <details removed for portability> + Filter-0: deflate-1 OPT {1} + Type: 32-bit little-endian integer +/G/H/grp_nested/grp_dsets/named_vl Dataset {2/2} + Location: 1:85324 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX + Storage: <details removed for portability> + Type: shared-1:85264 variable length of + 32-bit little-endian integer +/G/H/grp_nested/grp_dsets/nested_vl Dataset {2/2} + Location: 1:85579 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX + Storage: <details removed for portability> + Type: variable length of + variable length of + 32-bit little-endian integer +/G/H/grp_nested/grp_dsets/simple Dataset {6/6} + Location: 1:84745 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX + Storage: <details removed for portability> + Type: 32-bit little-endian integer +/G/H/grp_nested/grp_dsets/vl Type + Location: 1:85264 + Links: 2 + Modified: XXXX-XX-XX XX:XX:XX XXX + Type: shared-1:85264 variable length of + 32-bit little-endian integer +/chunk Dataset {6/6} + Location: 1:2238 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX + Chunks: {2} 8 bytes + Storage: <details removed for portability> + Type: 32-bit little-endian integer +/compact Dataset {6/6} + Location: 1:4240 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX + Storage: <details removed for portability> + Type: 32-bit little-endian integer +/compound Dataset {2/2} + Location: 1:6391 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX + Storage: <details removed for portability> + Type: struct { + "str1" +0 20-byte null-terminated ASCII string + "str2" +20 20-byte null-terminated ASCII string + } 40 bytes +/compressed Dataset {6/6} + Location: 1:6604 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX + Chunks: {2} 8 bytes + Storage: <details removed for portability> + Filter-0: deflate-1 OPT {1} + Type: 32-bit little-endian integer +/grp_dsets Group + Location: 1:27748 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX +/grp_dsets/chunk Dataset {6/6} + Location: 1:28718 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX + Chunks: {2} 8 bytes + Storage: <details removed for portability> + Type: 32-bit little-endian integer +/grp_dsets/compact Dataset {6/6} + Location: 1:28071 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX + Storage: <details removed for portability> + Type: 32-bit little-endian integer +/grp_dsets/compound Dataset {2/2} + Location: 1:28174 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX + Storage: <details removed for portability> + Type: struct { + "str1" +0 20-byte null-terminated ASCII string + "str2" +20 20-byte null-terminated ASCII string + } 40 bytes +/grp_dsets/compressed Dataset {6/6} + Location: 1:28387 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX + Chunks: {2} 8 bytes + Storage: <details removed for portability> + Filter-0: deflate-1 OPT {1} + Type: 32-bit little-endian integer +/grp_dsets/named_vl Dataset {2/2} + Location: 1:28557 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX + Storage: <details removed for portability> + Type: shared-1:28497 variable length of + 32-bit little-endian integer +/grp_dsets/nested_vl Dataset {2/2} + Location: 1:28812 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX + Storage: <details removed for portability> + Type: variable length of + variable length of + 32-bit little-endian integer +/grp_dsets/simple Dataset {6/6} + Location: 1:27978 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX + Storage: <details removed for portability> + Type: 32-bit little-endian integer +/grp_dsets/simple_group Dataset {6/6} + Location: 1:46180 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX + Storage: <details removed for portability> + Type: 32-bit little-endian integer +/grp_dsets/vl Type + Location: 1:28497 + Links: 2 + Modified: XXXX-XX-XX XX:XX:XX XXX + Type: shared-1:28497 variable length of + 32-bit little-endian integer +/grp_empty Group + Location: 1:27693 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX +/grp_nested Group + Location: 1:35940 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX +/grp_nested/grp_dsets Group + Location: 1:36019 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX +/grp_nested/grp_dsets/chunk Dataset {6/6} + Location: 1:36989 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX + Chunks: {2} 8 bytes + Storage: <details removed for portability> + Type: 32-bit little-endian integer +/grp_nested/grp_dsets/compact Dataset {6/6} + Location: 1:36342 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX + Storage: <details removed for portability> + Type: 32-bit little-endian integer +/grp_nested/grp_dsets/compound Dataset {2/2} + Location: 1:36445 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX + Storage: <details removed for portability> + Type: struct { + "str1" +0 20-byte null-terminated ASCII string + "str2" +20 20-byte null-terminated ASCII string + } 40 bytes +/grp_nested/grp_dsets/compressed Dataset {6/6} + Location: 1:36658 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX + Chunks: {2} 8 bytes + Storage: <details removed for portability> + Filter-0: deflate-1 OPT {1} + Type: 32-bit little-endian integer +/grp_nested/grp_dsets/named_vl Dataset {2/2} + Location: 1:36828 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX + Storage: <details removed for portability> + Type: shared-1:36768 variable length of + 32-bit little-endian integer +/grp_nested/grp_dsets/nested_vl Dataset {2/2} + Location: 1:37083 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX + Storage: <details removed for portability> + Type: variable length of + variable length of + 32-bit little-endian integer +/grp_nested/grp_dsets/simple Dataset {6/6} + Location: 1:36249 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX + Storage: <details removed for portability> + Type: 32-bit little-endian integer +/grp_nested/grp_dsets/vl Type + Location: 1:36768 + Links: 2 + Modified: XXXX-XX-XX XX:XX:XX XXX + Type: shared-1:36768 variable length of + 32-bit little-endian integer +/grp_rename Group + Location: 1:47077 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX +/grp_rename/chunk Dataset {6/6} + Location: 1:48047 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX + Chunks: {2} 8 bytes + Storage: <details removed for portability> + Type: 32-bit little-endian integer +/grp_rename/compact Dataset {6/6} + Location: 1:47400 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX + Storage: <details removed for portability> + Type: 32-bit little-endian integer +/grp_rename/compound Dataset {2/2} + Location: 1:47503 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX + Storage: <details removed for portability> + Type: struct { + "str1" +0 20-byte null-terminated ASCII string + "str2" +20 20-byte null-terminated ASCII string + } 40 bytes +/grp_rename/compressed Dataset {6/6} + Location: 1:47716 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX + Chunks: {2} 8 bytes + Storage: <details removed for portability> + Filter-0: deflate-1 OPT {1} + Type: 32-bit little-endian integer +/grp_rename/grp_dsets Group + Location: 1:55269 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX +/grp_rename/grp_dsets/chunk Dataset {6/6} + Location: 1:56239 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX + Chunks: {2} 8 bytes + Storage: <details removed for portability> + Type: 32-bit little-endian integer +/grp_rename/grp_dsets/compact Dataset {6/6} + Location: 1:55592 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX + Storage: <details removed for portability> + Type: 32-bit little-endian integer +/grp_rename/grp_dsets/compound Dataset {2/2} + Location: 1:55695 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX + Storage: <details removed for portability> + Type: struct { + "str1" +0 20-byte null-terminated ASCII string + "str2" +20 20-byte null-terminated ASCII string + } 40 bytes +/grp_rename/grp_dsets/compressed Dataset {6/6} + Location: 1:55908 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX + Chunks: {2} 8 bytes + Storage: <details removed for portability> + Filter-0: deflate-1 OPT {1} + Type: 32-bit little-endian integer +/grp_rename/grp_dsets/named_vl Dataset {2/2} + Location: 1:56078 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX + Storage: <details removed for portability> + Type: shared-1:56018 variable length of + 32-bit little-endian integer +/grp_rename/grp_dsets/nested_vl Dataset {2/2} + Location: 1:56333 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX + Storage: <details removed for portability> + Type: variable length of + variable length of + 32-bit little-endian integer +/grp_rename/grp_dsets/simple Dataset {6/6} + Location: 1:55499 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX + Storage: <details removed for portability> + Type: 32-bit little-endian integer +/grp_rename/grp_dsets/vl Type + Location: 1:56018 + Links: 2 + Modified: XXXX-XX-XX XX:XX:XX XXX + Type: shared-1:56018 variable length of + 32-bit little-endian integer +/grp_rename/named_vl Dataset {2/2} + Location: 1:47886 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX + Storage: <details removed for portability> + Type: shared-1:47826 variable length of + 32-bit little-endian integer +/grp_rename/nested_vl Dataset {2/2} + Location: 1:48141 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX + Storage: <details removed for portability> + Type: variable length of + variable length of + 32-bit little-endian integer +/grp_rename/simple Dataset {6/6} + Location: 1:47307 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX + Storage: <details removed for portability> + Type: 32-bit little-endian integer +/grp_rename/vl Type + Location: 1:47826 + Links: 2 + Modified: XXXX-XX-XX XX:XX:XX XXX + Type: shared-1:47826 variable length of + 32-bit little-endian integer +/named_vl Dataset {2/2} + Location: 1:8657 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX + Storage: <details removed for portability> + Type: shared-1:8606 variable length of + 32-bit little-endian integer +/nested_vl Dataset {2/2} + Location: 1:22942 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX + Storage: <details removed for portability> + Type: variable length of + variable length of + 32-bit little-endian integer +/rename Dataset {2/2} + Location: 1:27240 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX + Storage: <details removed for portability> + Type: struct { + "str1" +0 20-byte null-terminated ASCII string + "str2" +20 20-byte null-terminated ASCII string + } 40 bytes +/simple Dataset {6/6} + Location: 1:800 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX + Storage: <details removed for portability> + Type: 32-bit little-endian integer +/simple_top Dataset {6/6} + Location: 1:25099 + Links: 1 + Modified: XXXX-XX-XX XX:XX:XX XXX + Storage: <details removed for portability> + Type: 32-bit little-endian integer diff --git a/tools/h5copy/testh5copy.sh b/tools/h5copy/testh5copy.sh index c1d0309..046440d 100644 --- a/tools/h5copy/testh5copy.sh +++ b/tools/h5copy/testh5copy.sh @@ -30,7 +30,6 @@ H5LS_BIN=`pwd`/../h5ls/$H5LS # The path of the h5ls tool binary nerrors=0 verbose=yes -SRCFILE=h5copytst.h5 INDIR=$srcdir/testfiles OUTDIR=../testfiles CMP='cmp -s' @@ -56,7 +55,7 @@ TESTING() VERIFY() { SPACES=" " - echo "Verifying h5diff output $* $SPACES" | cut -c1-70 | tr -d '\012' + echo "Verifying h5diff output `basename $1` `basename $2` `basename $3` `basename $4` $SPACES" | cut -c1-70 | tr -d '\012' } # Print a line-line message left justified in a field of 70 characters @@ -92,7 +91,7 @@ TOOLTEST() runh5diff=no fi - TESTING $H5COPY $@ + TESTING $H5COPY $5 $6 $7 $8 $9 ( echo "#############################" echo " output for '$H5COPY $@'" @@ -134,7 +133,7 @@ TOOLTEST_FAIL() runh5diff=no fi - TESTING $H5COPY $@ + TESTING $H5COPY $5 $6 $7 $8 $9 ( echo "#############################" echo " output for '$H5COPY $@'" @@ -248,12 +247,13 @@ H5LSTEST() # <none> COPYOBJECTS() { - TESTFILE="$INDIR/$SRCFILE" - FILEOUT="$OUTDIR/`basename $SRCFILE .h5`.out.h5" + TESTFILE="$INDIR/$1" + FILEOUT="$OUTDIR/`basename $1 .h5`.out.h5" # Remove any output file left over from previous test run rm -f $FILEOUT + echo "Testing from `basename $TESTFILE` to `basename $FILEOUT` for the following tests:" echo "Test copying various forms of datasets" TOOLTEST -i $TESTFILE -o $FILEOUT -v -s simple -d simple TOOLTEST -i $TESTFILE -o $FILEOUT -v -s chunk -d chunk @@ -304,8 +304,12 @@ COPYOBJECTS() ### T H E T E S T S ### ############################################################################## -COPYOBJECTS +COPYOBJECTS h5copytst.h5 +# Add newline for nicer formatting +echo " " + +COPYOBJECTS h5copytst_new.h5 if test $nerrors -eq 0 ; then echo "All h5copy tests passed." |