From 486c13d307978ccbb9c2306c85c39a674ed56b96 Mon Sep 17 00:00:00 2001 From: Pedro Vicente Nunes Date: Tue, 2 Dec 2003 18:13:27 -0500 Subject: [svn-r7904] Purpose: h5diff new features Description: added comparison for attributes adeded comparison for all dataset datatypes added tests for the new features changed the output format Solution: Platforms tested: linux solaris 5.7 IRIX 6.5 (64) Misc. update: --- tools/h5diff/Makefile.in | 9 +- tools/h5diff/h5diff_main.c | 47 +- tools/h5diff/test_h5diff.c | 784 ---------------------------- tools/h5diff/testh5diff.h | 54 ++ tools/h5diff/testh5diff.sh | 86 ++-- tools/h5diff/testh5diff_attr.c | 1088 +++++++++++++++++++++++++++++++++++++++ tools/h5diff/testh5diff_basic.c | 498 ++++++++++++++++++ tools/h5diff/testh5diff_dset.c | 683 ++++++++++++++++++++++++ tools/h5diff/testh5diff_main.c | 36 ++ tools/h5diff/testh5diff_util.c | 99 ++++ tools/lib/h5diff.c | 170 +++++- tools/lib/h5diff.h | 52 +- tools/lib/h5diff_array.c | 575 +++++++++++++++------ tools/lib/h5diff_attr.c | 31 +- tools/lib/h5diff_dset.c | 213 ++++---- tools/lib/h5diff_util.c | 70 +-- tools/testfiles/file1.h5 | Bin 6240 -> 6240 bytes tools/testfiles/file2.h5 | Bin 6288 -> 6288 bytes tools/testfiles/file3.h5 | Bin 4352 -> 4352 bytes tools/testfiles/file4.h5 | Bin 4352 -> 10520 bytes tools/testfiles/file5.h5 | Bin 2936 -> 19216 bytes tools/testfiles/file6.h5 | Bin 10520 -> 19216 bytes tools/testfiles/file7.h5 | Bin 0 -> 20312 bytes tools/testfiles/file8.h5 | Bin 0 -> 20312 bytes tools/testfiles/h5diff_10.txt | 2 - tools/testfiles/h5diff_11.txt | 11 +- tools/testfiles/h5diff_12.txt | 7 +- tools/testfiles/h5diff_13.txt | 14 +- tools/testfiles/h5diff_14.txt | 2 +- tools/testfiles/h5diff_15.txt | 3 +- tools/testfiles/h5diff_16.txt | 9 +- tools/testfiles/h5diff_20.txt | 3 +- tools/testfiles/h5diff_21.txt | 3 +- tools/testfiles/h5diff_22.txt | 3 +- tools/testfiles/h5diff_23.txt | 3 +- tools/testfiles/h5diff_24.txt | 3 +- tools/testfiles/h5diff_25.txt | 3 +- tools/testfiles/h5diff_30.txt | 29 -- tools/testfiles/h5diff_31.txt | 29 -- tools/testfiles/h5diff_32.txt | 29 -- tools/testfiles/h5diff_33.txt | 29 -- tools/testfiles/h5diff_34.txt | 29 -- tools/testfiles/h5diff_35.txt | 29 -- tools/testfiles/h5diff_36.txt | 29 -- tools/testfiles/h5diff_37.txt | 29 -- tools/testfiles/h5diff_38.txt | 6 - tools/testfiles/h5diff_50.txt | 20 +- tools/testfiles/h5diff_51.txt | 14 +- tools/testfiles/h5diff_52.txt | 14 +- tools/testfiles/h5diff_53.txt | 14 +- tools/testfiles/h5diff_54.txt | 14 +- tools/testfiles/h5diff_55.txt | 14 +- tools/testfiles/h5diff_56.txt | 14 +- tools/testfiles/h5diff_57.txt | 14 +- tools/testfiles/h5diff_600.txt | 2 - tools/testfiles/h5diff_601.txt | 2 - tools/testfiles/h5diff_602.txt | 2 - tools/testfiles/h5diff_603.txt | 2 - tools/testfiles/h5diff_604.txt | 2 - tools/testfiles/h5diff_605.txt | 2 - tools/testfiles/h5diff_606.txt | 2 - tools/testfiles/h5diff_607.txt | 13 +- tools/testfiles/h5diff_608.txt | 13 +- tools/testfiles/h5diff_609.txt | 1 - tools/testfiles/h5diff_610.txt | 13 +- tools/testfiles/h5diff_611.txt | 2 - tools/testfiles/h5diff_612.txt | 2 - tools/testfiles/h5diff_613.txt | 2 - tools/testfiles/h5diff_614.txt | 2 - tools/testfiles/h5diff_615.txt | 2 - tools/testfiles/h5diff_616.txt | 1 - tools/testfiles/h5diff_617.txt | 1 - tools/testfiles/h5diff_618.txt | 1 - tools/testfiles/h5diff_619.txt | 1 - tools/testfiles/h5diff_620.txt | 2 - tools/testfiles/h5diff_621.txt | 2 - tools/testfiles/h5diff_622.txt | 2 - tools/testfiles/h5diff_623.txt | 2 - tools/testfiles/h5diff_624.txt | 2 - tools/testfiles/h5diff_625.txt | 7 +- tools/testfiles/h5diff_626.txt | 8 +- tools/testfiles/h5diff_627.txt | 11 +- tools/testfiles/h5diff_628.txt | 6 +- tools/testfiles/h5diff_629.txt | 1 - tools/testfiles/h5diff_70.txt | 514 ++++++++++++++++++ tools/testfiles/h5diff_80.txt | 611 ++++++++++++++++++++++ 86 files changed, 4554 insertions(+), 1599 deletions(-) delete mode 100644 tools/h5diff/test_h5diff.c create mode 100644 tools/h5diff/testh5diff.h create mode 100644 tools/h5diff/testh5diff_attr.c create mode 100644 tools/h5diff/testh5diff_basic.c create mode 100644 tools/h5diff/testh5diff_dset.c create mode 100644 tools/h5diff/testh5diff_main.c create mode 100644 tools/h5diff/testh5diff_util.c create mode 100644 tools/testfiles/file7.h5 create mode 100644 tools/testfiles/file8.h5 delete mode 100644 tools/testfiles/h5diff_30.txt delete mode 100644 tools/testfiles/h5diff_31.txt delete mode 100644 tools/testfiles/h5diff_32.txt delete mode 100644 tools/testfiles/h5diff_33.txt delete mode 100644 tools/testfiles/h5diff_34.txt delete mode 100644 tools/testfiles/h5diff_35.txt delete mode 100644 tools/testfiles/h5diff_36.txt delete mode 100644 tools/testfiles/h5diff_37.txt delete mode 100644 tools/testfiles/h5diff_38.txt create mode 100644 tools/testfiles/h5diff_70.txt create mode 100644 tools/testfiles/h5diff_80.txt diff --git a/tools/h5diff/Makefile.in b/tools/h5diff/Makefile.in index 3726718..a616658 100644 --- a/tools/h5diff/Makefile.in +++ b/tools/h5diff/Makefile.in @@ -49,11 +49,12 @@ MOSTLYCLEAN=*.h5 ## Source and object files for programs... ## -PROG_SRC= h5diff_main.c test_h5diff.c +PROG_SRC= h5diff_main.c testh5diff_attr.c testh5diff_basic.c testh5diff_dset.c testh5diff_util.c testh5diff_main.c PROG_OBJ=$(PROG_SRC:.c=.lo) OBJS= h5diff_main.lo +TEST_OBJS=testh5diff_attr.lo testh5diff_basic.lo testh5diff_dset.lo testh5diff_util.lo testh5diff_main.lo -PRIVATE_HDR= +PRIVATE_HDR=testh5diff.h ## Source and object files for the tests ## @@ -72,8 +73,8 @@ $(PROGS): $(LIBTOOLS) $(LIBHDF5) h5diff: $(OBJS) @$(LT_LINK_EXE) $(CFLAGS) -o $@ $(OBJS) $(LIBTOOLS) $(LIBHDF5) $(LDFLAGS) $(LIBS) -h5difftst: test_h5diff.lo - @$(LT_LINK_EXE) $(CFLAGS) -o $@ test_h5diff.lo $(LIBTOOLS) $(LIBHDF5) $(LDFLAGS) $(LIBS) +h5difftst: $(TEST_OBJS) + @$(LT_LINK_EXE) $(CFLAGS) -o $@ $(TEST_OBJS) $(LIBTOOLS) $(LIBHDF5) $(LDFLAGS) $(LIBS) @CONCLUDE@ diff --git a/tools/h5diff/h5diff_main.c b/tools/h5diff/h5diff_main.c index 2ac3703..58fc9a9 100644 --- a/tools/h5diff/h5diff_main.c +++ b/tools/h5diff/h5diff_main.c @@ -19,7 +19,7 @@ /* Due to alignment issue in Alpha clusters, options must be declared here * not as a local variable in main(). */ -diff_opt_t options = {0,0,0,0,0,0,0,0,0}; +diff_opt_t options = {0,0,0,0,0,0,0,0}; static void usage(void); static int check_n_input( const char* ); @@ -56,19 +56,6 @@ int main(int argc, const char *argv[]) int nfound=0, ret; /*------------------------------------------------------------------------- - * print the command line options - *------------------------------------------------------------------------- - */ - - printf("$h5diff"); - for (i=1; i -#include -#include -#include "hdf5.h" -#include "H5private.h" - -/*UINT_MAX Maximum value for a variable of type unsigned int. 4294967295 */ -#define UIMAX 4294967295u - -/* diff test*/ -static int do_test_1(const char *file1, const char *file2); -static int do_test_2(const char *file1, const char *file2); -static int do_test_3(const char *file1, const char *file2); -static int do_test_4(const char *file1, const char *file2); -static int do_test_5(const char *file1, const char *file2); -static int write_dataset( hid_t loc_id, int rank, hsize_t *dims, const char *dset_name, - hid_t type_id, void *buf ); - - -int main(int UNUSED argc, const UNUSED char *argv[]) -{ - - do_test_1("file1.h5","file2.h5"); - do_test_2("file3.h5",NULL); - do_test_3("file4.h5",NULL); - do_test_4("file5.h5",NULL); - do_test_5("file6.h5",NULL); - return 0; -} - - - -/*------------------------------------------------------------------------- - * Function: write_dataset - * - * Purpose: utility function to write a dataset - * - * Return: - * - * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu - * - * Date: April 7, 2003 - * - *------------------------------------------------------------------------- - */ - -static -int write_dataset( hid_t loc_id, int rank, hsize_t *dims, const char *dset_name, - hid_t type_id, void *buf ) -{ - hid_t dataset_id; - hid_t space_id; - herr_t status; - - /* Create a buf space */ - space_id = H5Screate_simple(rank,dims,NULL); - - /* Create a dataset */ - dataset_id = H5Dcreate(loc_id,dset_name,type_id,space_id,H5P_DEFAULT); - - /* Write the buf */ - if ( buf ) - H5Dwrite(dataset_id,type_id,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf); - - /* Close */ - status = H5Dclose(dataset_id); - status = H5Sclose(space_id); - assert(status>=0); - - return status; - -} - -/* - -# ############################################################################## -# # Common usage -# ############################################################################## - - -# 1.0 - -h - -# 1.1 - file1.h5 file2.h5 g1/dset1 g1/dset2 - -# 1.2 - file1.h5 file2.h5 -n 2 g1/dset1 g1/dset2 - -# 1.3 - file1.h5 file2.h5 -d 5 g1/dset3 g1/dset4 - -# 1.4 - file1.h5 file2.h5 -p 0.05 g1/dset3 g1/dset4 - -# 1.5 - file1.h5 file2.h5 -r g1/dset1 g1/dset2 - -# 1.6 - file1.h5 file2.h5 - -# ############################################################################## -# # not comparable types -# ############################################################################## - -# 2.0 - file3.h5 file3.h5 dset group - -# 2.1 - file3.h5 file3.h5 dset link - -# 2.2 - file3.h5 file3.h5 dset type - -# 2.3 - file3.h5 file3.h5 group group - -# 2.4 - file3.h5 file3.h5 type type - -# 2.5 - file3.h5 file3.h5 link link - -# ############################################################################## -# # Class issues -# ############################################################################## - - -# 3.0 - file4.h5 file4.h5 string - -# 3.1 - file4.h5 file4.h5 bitfield - -# 3.2 - file4.h5 file4.h5 opaque - -# 3.3 - file4.h5 file4.h5 compound - -# 3.4 - file4.h5 file4.h5 ref - -# 3.5 - file4.h5 file4.h5 enum - -# 3.6 - file4.h5 file4.h5 vlen - -# 3.7 - file4.h5 file4.h5 array - -# 3.8 - file4.h5 file4.h5 integer float - -# ############################################################################## -# # Dimensions -# ############################################################################## - -# 4.0 - file5.h5 file5.h5 dset1 dset2 - -# 4.1 - file5.h5 file5.h5 dset3 dset4 - -# 4.2 - file5.h5 file5.h5 dset5 dset6 - - -# ############################################################################## -# # Dataset types -# ############################################################################## - -# 5.0 - file6.h5 file6.h5 dset0a dset0b - -# 5.1 - file6.h5 file6.h5 dset1a dset1b - -# 5.2 - file6.h5 file6.h5 dset2a dset2b - -# 5.3 - file6.h5 file6.h5 dset3a dset4b - -# 5.4 - file6.h5 file6.h5 dset4a dset4b - -# 5.5 - file6.h5 file6.h5 dset5a dset5b - -# 5.6 - file6.h5 file6.h5 dset6a dset6b - -# 5.7 - file6.h5 file6.h5 dset7a dset7b - -# 5.8 - file6.h5 file6.h5 dset8a dset8b - -# ############################################################################## -# # Error messages -# ############################################################################## - - -# 6.0: Check if the command line number of arguments is less than 3 - h5diff_test1.h5 - -# 6.1: Check for invalid options - h5diff_test1.h5 h5diff_test2.h5 -x - -# ############################################################################## -# # -d -# ############################################################################## - -# 6.2: no value - file1.h5 file2.h5 -d g1/dset3 g1/dset4 - -# 6.3: negative value - file1.h5 file2.h5 -d -4 g1/dset3 g1/dset4 - -# 6.4: zero - file1.h5 file2.h5 -d 0 g1/dset3 g1/dset4 - -# 6.5: non number - file1.h5 file2.h5 -d u g1/dset3 g1/dset4 - -# 6.6: hexadecimal - file1.h5 file2.h5 -d 0x1 g1/dset3 g1/dset4 - -# 6.7: string - file1.h5 file2.h5 -d "1" g1/dset3 g1/dset4 - -# 6.8: repeated option - file1.h5 file2.h5 -d 1 -d 2 g1/dset3 g1/dset4 - -# 6.9: number larger than biggest difference - file1.h5 file2.h5 -d 200 g1/dset3 g1/dset4 - -# 6.10: number smaller than smallest difference - file1.h5 file2.h5 -d 1 g1/dset3 g1/dset4 - - -# ############################################################################## -# # -p -# ############################################################################## - - -# 6.11: no value - file1.h5 file2.h5 -p g1/dset3 g1/dset4 - -# 6.12: negative value - file1.h5 file2.h5 -p -4 g1/dset3 g1/dset4 - -# 6.13: zero - file1.h5 file2.h5 -p 0 g1/dset3 g1/dset4 - -# 6.14: non number - file1.h5 file2.h5 -p u g1/dset3 g1/dset4 - -# 6.15: hexadecimal - file1.h5 file2.h5 -p 0x1 g1/dset3 g1/dset4 - -# 6.16: string - file1.h5 file2.h5 -p "0.21" g1/dset3 g1/dset4 - -# 6.17: repeated option - file1.h5 file2.h5 -p 0.21 -p 0.22 g1/dset3 g1/dset4 - -# 6.18: number larger than biggest difference - file1.h5 file2.h5 -p 2 g1/dset3 g1/dset4 - -# 6.19: number smaller than smallest difference - file1.h5 file2.h5 -p 0.005 g1/dset3 g1/dset4 - - - -# ############################################################################## -# # -n -# ############################################################################## - - -# 6.20: no value - file1.h5 file2.h5 -n g1/dset3 g1/dset4 - -# 6.21: negative value - file1.h5 file2.h5 -n -4 g1/dset3 g1/dset4 - -# 6.22: zero - file1.h5 file2.h5 -n 0 g1/dset3 g1/dset4 - -# 6.23: non number - file1.h5 file2.h5 -n u g1/dset3 g1/dset4 - -# 6.24: hexadecimal - file1.h5 file2.h5 -n 0x1 g1/dset3 g1/dset4 - -# 6.25: string - file1.h5 file2.h5 -n "2" g1/dset3 g1/dset4 - -# 6.26: repeated option - file1.h5 file2.h5 -n 2 -n 3 g1/dset3 g1/dset4 - -# 6.27: number larger than biggest difference - file1.h5 file2.h5 -n 200 g1/dset3 g1/dset4 - -# 6.28: number smaller than smallest difference - file1.h5 file2.h5 -n 1 g1/dset3 g1/dset4 - -# ############################################################################## -# # non valid files -# ############################################################################## - - file1.h6 file2.h6 - -*/ - - -/*------------------------------------------------------------------------- - * Basic review tests - *------------------------------------------------------------------------- - */ -static -int do_test_1(const char *file1, const char *file2) -{ - - hid_t file1_id, file2_id; - hid_t group1_id, group2_id, group3_id; - herr_t status; - hsize_t dims[2] = { 3,2 }; - - /* Test */ - double data1[3][2] = {{1,1},{1,1},{1,1}}; - double data2[3][2] = {{1,1.1},{1.01,1.001},{1.0001,1.000000001}}; - double data3[3][2] = {{100,110},{100,100},{100,100}}; - double data4[3][2] = {{110,100},{90,80},{140,200}}; - -/*------------------------------------------------------------------------- - * Create two files - *------------------------------------------------------------------------- - */ - - file1_id = H5Fcreate (file1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - file2_id = H5Fcreate (file2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - - /* Create groups */ - group1_id = H5Gcreate(file1_id, "g1", 0); - group2_id = H5Gcreate(file2_id, "g1", 0); - group3_id = H5Gcreate(file2_id, "g2", 0); - - write_dataset(group1_id,2,dims,"dset1",H5T_NATIVE_DOUBLE,data1); - write_dataset(group2_id,2,dims,"dset2",H5T_NATIVE_DOUBLE,data2); - write_dataset(group1_id,2,dims,"dset3",H5T_NATIVE_DOUBLE,data3); - write_dataset(group2_id,2,dims,"dset4",H5T_NATIVE_DOUBLE,data4); - write_dataset(group2_id,2,dims,"dset1",H5T_NATIVE_DOUBLE,data2); - -/*------------------------------------------------------------------------- - * Close - *------------------------------------------------------------------------- - */ - status = H5Gclose(group1_id); - status = H5Gclose(group2_id); - status = H5Gclose(group3_id); - status = H5Fclose(file1_id); - status = H5Fclose(file2_id); - return status; -} - -/*------------------------------------------------------------------------- - * Compare different types: H5G_DATASET, H5G_TYPE, H5G_GROUP, H5G_LINK - *------------------------------------------------------------------------- - */ -static -int do_test_2(const char *file1, const char UNUSED *file2) -{ - - hid_t file1_id; - hid_t group_id; - hid_t type_id; - herr_t status; - hsize_t dims[1]={1}; - /* Compound datatype */ - typedef struct s_t - { - int a; - float b; - } s_t; - -/*------------------------------------------------------------------------- - * Create one file - *------------------------------------------------------------------------- - */ - file1_id = H5Fcreate (file1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - -/*------------------------------------------------------------------------- - * H5G_DATASET - *------------------------------------------------------------------------- - */ - write_dataset(file1_id,1,dims,"dset",H5T_NATIVE_INT,0); - -/*------------------------------------------------------------------------- - * H5G_GROUP - *------------------------------------------------------------------------- - */ - group_id = H5Gcreate(file1_id, "group", 0); - status = H5Gclose(group_id); - -/*------------------------------------------------------------------------- - * H5G_TYPE - *------------------------------------------------------------------------- - */ - - /* Create a memory compound datatype */ - type_id = H5Tcreate (H5T_COMPOUND, sizeof(s_t)); - H5Tinsert(type_id, "a", HOFFSET(s_t, a), H5T_NATIVE_INT); - H5Tinsert(type_id, "b", HOFFSET(s_t, b), H5T_NATIVE_FLOAT); - /* Commit compound datatype and close it */ - H5Tcommit(file1_id, "type", type_id); - H5Tclose(type_id); - -/*------------------------------------------------------------------------- - * H5G_LINK - *------------------------------------------------------------------------- - */ - - status = H5Glink(file1_id, H5G_LINK_SOFT, "dset", "link"); - -/*------------------------------------------------------------------------- - * Close - *------------------------------------------------------------------------- - */ - status = H5Fclose(file1_id); - return status; -} - - - - -/*------------------------------------------------------------------------- - * Check for non supported classes. Supported classes are H5T_INTEGER and H5T_FLOAT - * Non supported classes are - * H5T_TIME, H5T_STRING, H5T_BITFIELD, H5T_OPAQUE, H5T_COMPOUND, H5T_REFERENCE, - * H5T_ENUM, H5T_VLEN, H5T_ARRAY - *------------------------------------------------------------------------- - */ -static -int do_test_3(const char *file1, const char UNUSED *file2) -{ - - hid_t file1_id; - hid_t dataset_id; - hid_t space_id; - hid_t type_id; - hsize_t dims[1]={1}; - herr_t status; - int val; - - /* Compound datatype */ - typedef struct s_t - { - int a; - float b; - } s_t; - - typedef enum - { - E_RED, - E_GREEN -} e_t; - -/*------------------------------------------------------------------------- - * Create a file - *------------------------------------------------------------------------- - */ - file1_id = H5Fcreate (file1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - -/*------------------------------------------------------------------------- - * H5T_STRING - *------------------------------------------------------------------------- - */ - space_id = H5Screate(H5S_SCALAR); - type_id = H5Tcopy(H5T_C_S1); - dataset_id = H5Dcreate(file1_id,"string",type_id,space_id,H5P_DEFAULT); - status = H5Dclose(dataset_id); - status = H5Sclose(space_id); - status = H5Tclose(type_id); - -/*------------------------------------------------------------------------- - * H5T_BITFIELD - *------------------------------------------------------------------------- - */ - - type_id = H5Tcopy(H5T_STD_B8LE); - write_dataset(file1_id,1,dims,"bitfield",type_id,0); - status = H5Tclose(type_id); - - -/*------------------------------------------------------------------------- - * H5T_OPAQUE - *------------------------------------------------------------------------- - */ - - type_id = H5Tcreate(H5T_OPAQUE, 1); - status = H5Tset_tag(type_id, "1-byte opaque type"); /* must set this */ - write_dataset(file1_id,1,dims,"opaque",type_id,0); - status = H5Tclose(type_id); - -/*------------------------------------------------------------------------- - * H5T_COMPOUND - *------------------------------------------------------------------------- - */ - - type_id = H5Tcreate (H5T_COMPOUND, sizeof(s_t)); - H5Tinsert(type_id, "a", HOFFSET(s_t, a), H5T_NATIVE_INT); - H5Tinsert(type_id, "b", HOFFSET(s_t, b), H5T_NATIVE_FLOAT); - write_dataset(file1_id,1,dims,"compound",type_id,0); - status = H5Tclose(type_id); - -/*------------------------------------------------------------------------- - * H5T_REFERENCE - *------------------------------------------------------------------------- - */ - write_dataset(file1_id,1,dims,"ref",H5T_STD_REF_OBJ,0); - -/*------------------------------------------------------------------------- - * H5T_ENUM - *------------------------------------------------------------------------- - */ - type_id = H5Tcreate(H5T_ENUM, sizeof(e_t)); - H5Tenum_insert(type_id, "RED", (val = 0, &val)); - H5Tenum_insert(type_id, "GREEN", (val = 1, &val)); - write_dataset(file1_id,1,dims,"enum",type_id,0); - status = H5Tclose(type_id); - -/*------------------------------------------------------------------------- - * H5T_VLEN - *------------------------------------------------------------------------- - */ - type_id = H5Tvlen_create(H5T_NATIVE_INT); - write_dataset(file1_id,1,dims,"vlen",type_id,0); - status = H5Tclose(type_id); - -/*------------------------------------------------------------------------- - * H5T_ARRAY - *------------------------------------------------------------------------- - */ - type_id = H5Tarray_create(H5T_NATIVE_INT,1,dims,NULL); - write_dataset(file1_id,1,dims,"array",type_id,0); - status = H5Tclose(type_id); - -/*------------------------------------------------------------------------- - * H5T_INTEGER vs H5T_FLOAT - *------------------------------------------------------------------------- - */ - - write_dataset(file1_id,1,dims,"integer",H5T_NATIVE_INT,0); - write_dataset(file1_id,1,dims,"float",H5T_NATIVE_FLOAT,0); - -/*------------------------------------------------------------------------- - * Close - *------------------------------------------------------------------------- - */ - status = H5Fclose(file1_id); - return status; -} - - -/*------------------------------------------------------------------------- - * Dimension issues - *------------------------------------------------------------------------- - */ -static -int do_test_4(const char *file1, const char UNUSED *file2) -{ - - hid_t file1_id; - hid_t dataset_id; - hid_t space_id; - hid_t plist_id; - herr_t status; - hsize_t dims1 [1]={7}; - hsize_t dims2 [4]={2,2,2,2}; - hsize_t dims21[4]={2,2,2,3}; - -/*------------------------------------------------------------------------- - * Create a file - *------------------------------------------------------------------------- - */ - file1_id = H5Fcreate (file1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - -/*------------------------------------------------------------------------- - * rank - *------------------------------------------------------------------------- - */ - write_dataset(file1_id,1,dims1,"dset1",H5T_NATIVE_INT,NULL); - write_dataset(file1_id,4,dims2,"dset2",H5T_NATIVE_INT,NULL); - -/*------------------------------------------------------------------------- - * current dimensions - *------------------------------------------------------------------------- - */ - write_dataset(file1_id,4,dims2,"dset3",H5T_NATIVE_INT,NULL); - write_dataset(file1_id,4,dims21,"dset4",H5T_NATIVE_INT,NULL); - -/*------------------------------------------------------------------------- - * Check for the same maximum dimensions. Give a warning if they are different - *------------------------------------------------------------------------- - */ - - space_id = H5Screate_simple(4,dims2,dims2); - dataset_id = H5Dcreate(file1_id,"dset5",H5T_NATIVE_INT,space_id,H5P_DEFAULT); - status = H5Dclose(dataset_id); - status = H5Sclose(space_id); - space_id = H5Screate_simple(4,dims2,dims21); - plist_id = H5Pcreate(H5P_DATASET_CREATE); - status = H5Pset_chunk(plist_id,4,dims2); - dataset_id = H5Dcreate(file1_id,"dset6",H5T_NATIVE_INT,space_id,plist_id); - status = H5Dclose(dataset_id); - status = H5Sclose(space_id); - -/*------------------------------------------------------------------------- - * Close - *------------------------------------------------------------------------- - */ - status = H5Fclose(file1_id); - return status; -} - - - - -/*------------------------------------------------------------------------- - * Datasets datatypes - *------------------------------------------------------------------------- - */ -static -int do_test_5(const char *file1, const char UNUSED *file2) -{ - - hid_t file1_id; - hsize_t dims[2]={3,2}; - herr_t status; - char buf1a[3][2] = {{1,1},{1,1},{1,1}}; - char buf1b[3][2] = {{1,1},{3,4},{5,6}}; - short buf2a[3][2] = {{1,1},{1,1},{1,1}}; - short buf2b[3][2] = {{1,1},{3,4},{5,6}}; - int buf3a[3][2] = {{1,1},{1,1},{1,1}}; - int buf3b[3][2] = {{1,1},{3,4},{5,6}}; - long buf4a[3][2] = {{1,1},{1,1},{1,1}}; - long buf4b[3][2] = {{1,1},{3,4},{5,6}}; - float buf5a[3][2] = {{1,1},{1,1},{1,1}}; - float buf5b[3][2] = {{1,1},{3,4},{5,6}}; - double buf6a[3][2] = {{1,1},{1,1},{1,1}}; - double buf6b[3][2] = {{1,1},{3,4},{5,6}}; - - /*unsigned/signed test - signed char -128 to 127 - unsigned char 0 to 255 - */ - char buf7a[3][2] = {{-1,-128},{-1,-1},{-1,-1}}; - unsigned char buf7b[3][2] = {{1,128},{1,1},{1,1}}; - - /* long_long test */ - long_long buf8a[3][2] = {{1,1},{1,1},{1,1}}; - long_long buf8b[3][2] = {{1,1},{3,4},{5,6}}; - unsigned long_long buf9a[3][2] = {{1,1},{1,1},{1,1}}; - unsigned long_long buf9b[3][2] = {{1,1},{3,4},{5,6}}; - - unsigned int buf10a[3][2] = {{UIMAX,1},{1,1},{1,1}}; - unsigned int buf10b[3][2] = {{UIMAX-1,1},{3,4},{5,6}}; - - -/*------------------------------------------------------------------------- - * Create a file - *------------------------------------------------------------------------- - */ - file1_id = H5Fcreate (file1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - -/*------------------------------------------------------------------------- - * Check for different storage order. Give a warning if they are different - *------------------------------------------------------------------------- - */ - - write_dataset(file1_id,2,dims,"dset0a",H5T_STD_I16LE,buf2a); - write_dataset(file1_id,2,dims,"dset0b",H5T_STD_I32LE,buf3b); - -/*------------------------------------------------------------------------- - * Check H5T_NATIVE_CHAR - *------------------------------------------------------------------------- - */ - write_dataset(file1_id,2,dims,"dset1a",H5T_NATIVE_CHAR,buf1a); - write_dataset(file1_id,2,dims,"dset1b",H5T_NATIVE_CHAR,buf1b); - -/*------------------------------------------------------------------------- - * Check H5T_NATIVE_SHORT - *------------------------------------------------------------------------- - */ - write_dataset(file1_id,2,dims,"dset2a",H5T_NATIVE_SHORT,buf2a); - write_dataset(file1_id,2,dims,"dset2b",H5T_NATIVE_SHORT,buf2b); - -/*------------------------------------------------------------------------- - * Check H5T_NATIVE_INT - *------------------------------------------------------------------------- - */ - write_dataset(file1_id,2,dims,"dset3a",H5T_NATIVE_INT,buf3a); - write_dataset(file1_id,2,dims,"dset3b",H5T_NATIVE_INT,buf3b); - -/*------------------------------------------------------------------------- - * Check H5T_NATIVE_LONG - *------------------------------------------------------------------------- - */ - write_dataset(file1_id,2,dims,"dset4a",H5T_NATIVE_LONG,buf4a); - write_dataset(file1_id,2,dims,"dset4b",H5T_NATIVE_LONG,buf4b); - -/*------------------------------------------------------------------------- - * Check H5T_NATIVE_FLOAT - *------------------------------------------------------------------------- - */ - write_dataset(file1_id,2,dims,"dset5a",H5T_NATIVE_FLOAT,buf5a); - write_dataset(file1_id,2,dims,"dset5b",H5T_NATIVE_FLOAT,buf5b); - -/*------------------------------------------------------------------------- - * Check H5T_NATIVE_DOUBLE - *------------------------------------------------------------------------- - */ - - write_dataset(file1_id,2,dims,"dset6a",H5T_NATIVE_DOUBLE,buf6a); - write_dataset(file1_id,2,dims,"dset6b",H5T_NATIVE_DOUBLE,buf6b); - -/*------------------------------------------------------------------------- - * H5T_NATIVE_CHAR and H5T_NATIVE_UCHAR - *------------------------------------------------------------------------- - */ - - write_dataset(file1_id,2,dims,"dset7a",H5T_NATIVE_CHAR,buf7a); - write_dataset(file1_id,2,dims,"dset7b",H5T_NATIVE_UCHAR,buf7b); - -/*------------------------------------------------------------------------- - * H5T_NATIVE_LLONG - *------------------------------------------------------------------------- - */ - - write_dataset(file1_id,2,dims,"dset8a",H5T_NATIVE_LLONG,buf8a); - write_dataset(file1_id,2,dims,"dset8b",H5T_NATIVE_LLONG,buf8b); - -/*------------------------------------------------------------------------- - * H5T_NATIVE_ULLONG - *------------------------------------------------------------------------- - */ - - write_dataset(file1_id,2,dims,"dset9a",H5T_NATIVE_ULLONG,buf9a); - write_dataset(file1_id,2,dims,"dset9b",H5T_NATIVE_ULLONG,buf9b); - -/*------------------------------------------------------------------------- - * H5T_NATIVE_INT - *------------------------------------------------------------------------- - */ - - write_dataset(file1_id,2,dims,"dset10a",H5T_NATIVE_UINT,buf10a); - write_dataset(file1_id,2,dims,"dset10b",H5T_NATIVE_UINT,buf10b); - - -/*------------------------------------------------------------------------- - * Close - *------------------------------------------------------------------------- - */ - status = H5Fclose(file1_id); - return status; -} - diff --git a/tools/h5diff/testh5diff.h b/tools/h5diff/testh5diff.h new file mode 100644 index 0000000..5d9a651 --- /dev/null +++ b/tools/h5diff/testh5diff.h @@ -0,0 +1,54 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include +#include +#include +#include "hdf5.h" +#include "H5private.h" + + +int test_basic(const char *file1, + const char *file2); + +int test_types(const char *file1, + const char *file2); + +int test_native(const char *file1, + const char *file2); + + +int test_dsetall(const char *file, + int make_diffs /* flag to modify data buffers */); + +int test_attr(const char *file, + int make_diffs /* flag to modify data buffers */); + + +int write_attr(hid_t loc_id, + int rank, + hsize_t *dims, + const char *attr_name, + hid_t type_id, + void *buf); + + +int write_dset( hid_t loc_id, + int rank, + hsize_t *dims, + const char *dset_name, + hid_t type_id, + void *buf ); + + diff --git a/tools/h5diff/testh5diff.sh b/tools/h5diff/testh5diff.sh index 59d52cd..23cbfaa 100755 --- a/tools/h5diff/testh5diff.sh +++ b/tools/h5diff/testh5diff.sh @@ -103,7 +103,7 @@ TOOLTEST() { TOOLTEST h5diff_10.txt -h # 1.1 -TOOLTEST h5diff_11.txt file6.h5 file6.h5 -v dset3a dset3b +TOOLTEST h5diff_11.txt file1.h5 file2.h5 g1/dset1 g1/dset2 # 1.2 TOOLTEST h5diff_12.txt file1.h5 file2.h5 -v -n 2 g1/dset1 g1/dset2 @@ -118,7 +118,7 @@ TOOLTEST h5diff_14.txt file1.h5 file2.h5 -v -p 0.05 g1/dset3 g1/dset4 TOOLTEST h5diff_15.txt file1.h5 file2.h5 -v -r g1/dset1 g1/dset2 # 1.6 -TOOLTEST h5diff_16.txt file6.h5 file6.h5 +TOOLTEST h5diff_16.txt file1.h5 file2.h5 # ############################################################################## # # not comparable types @@ -142,82 +142,37 @@ TOOLTEST h5diff_24.txt file3.h5 file3.h5 -v type type # 2.5 TOOLTEST h5diff_25.txt file3.h5 file3.h5 -v link link -# ############################################################################## -# # Class issues -# ############################################################################## - - -# 3.0 -TOOLTEST h5diff_30.txt file4.h5 file4.h5 -v string - -# 3.1 -TOOLTEST h5diff_31.txt file4.h5 file4.h5 -v bitfield - -# 3.2 -TOOLTEST h5diff_32.txt file4.h5 file4.h5 -v opaque - -# 3.3 -TOOLTEST h5diff_33.txt file4.h5 file4.h5 -v compound - -# 3.4 -TOOLTEST h5diff_34.txt file4.h5 file4.h5 -v ref - -# 3.5 -TOOLTEST h5diff_35.txt file4.h5 file4.h5 -v enum - -# 3.6 -TOOLTEST h5diff_36.txt file4.h5 file4.h5 -v vlen - -# 3.7 -TOOLTEST h5diff_37.txt file4.h5 file4.h5 -v array - -# 3.8 -TOOLTEST h5diff_38.txt file4.h5 file4.h5 -v integer float - -# ############################################################################## -# # Dimensions -# ############################################################################## - -# 4.0 -TOOLTEST h5diff_40.txt file5.h5 file5.h5 -v dset1 dset2 - -# 4.1 -TOOLTEST h5diff_41.txt file5.h5 file5.h5 -v dset3 dset4 - -# 4.2 -TOOLTEST h5diff_42.txt file5.h5 file5.h5 -v dset5 dset6 - # ############################################################################## # # Dataset types # ############################################################################## # 5.0 -TOOLTEST h5diff_50.txt file6.h5 file6.h5 -v dset0a dset0b +TOOLTEST h5diff_50.txt file4.h5 file4.h5 -v dset0a dset0b # 5.1 -TOOLTEST h5diff_51.txt file6.h5 file6.h5 -v dset1a dset1b +TOOLTEST h5diff_51.txt file4.h5 file4.h5 -v dset1a dset1b # 5.2 -TOOLTEST h5diff_52.txt file6.h5 file6.h5 -v dset2a dset2b +TOOLTEST h5diff_52.txt file4.h5 file4.h5 -v dset2a dset2b # 5.3 -TOOLTEST h5diff_53.txt file6.h5 file6.h5 -v dset3a dset4b +TOOLTEST h5diff_53.txt file4.h5 file4.h5 -v dset3a dset4b # 5.4 -TOOLTEST h5diff_54.txt file6.h5 file6.h5 -v dset4a dset4b +TOOLTEST h5diff_54.txt file4.h5 file4.h5 -v dset4a dset4b # 5.5 -TOOLTEST h5diff_55.txt file6.h5 file6.h5 -v dset5a dset5b +TOOLTEST h5diff_55.txt file4.h5 file4.h5 -v dset5a dset5b # 5.6 -TOOLTEST h5diff_56.txt file6.h5 file6.h5 -v dset6a dset6b +TOOLTEST h5diff_56.txt file4.h5 file4.h5 -v dset6a dset6b # 5.7 -TOOLTEST h5diff_57.txt file6.h5 file6.h5 -v dset7a dset7b +TOOLTEST h5diff_57.txt file4.h5 file4.h5 -v dset7a dset7b # 5.8 long_long test; different format of long_long print in Linux and IRIX -#TOOLTEST h5diff_58.txt file6.h5 file6.h5 dset8a dset8b +#TOOLTEST h5diff_58.txt file4.h5 file4.h5 dset8a dset8b # ############################################################################## # # Error messages @@ -334,6 +289,25 @@ TOOLTEST h5diff_628.txt file1.h5 file2.h5 -n 1 g1/dset3 g1/dset4 TOOLTEST h5diff_629.txt file1.h6 file2.h6 +# ############################################################################## +# # attributes +# ############################################################################## + +TOOLTEST h5diff_70.txt file5.h5 file6.h5 + +# ############################################################################## +# # all dataset datatypes +# ############################################################################## + +TOOLTEST h5diff_80.txt file7.h5 file8.h5 + + + + + + + + # ############################################################################## # # END diff --git a/tools/h5diff/testh5diff_attr.c b/tools/h5diff/testh5diff_attr.c new file mode 100644 index 0000000..5124792 --- /dev/null +++ b/tools/h5diff/testh5diff_attr.c @@ -0,0 +1,1088 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include "testh5diff.h" + + + +/*------------------------------------------------------------------------- + * Function: write_attr_in + * + * Purpose: write attributes in LOC_ID (dataset, group, named datatype) + * + * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * + * Date: November 12, 2003 + * + *------------------------------------------------------------------------- + */ + + +void write_attr_in(hid_t loc_id, + const char* dset_name, /* for saving reference to dataset*/ + hid_t file_id, + int make_diffs /* flag to modify data buffers */) +{ + /* Compound datatype */ + typedef struct s_t + { + char a; + double b; + } s_t; + + typedef enum + { + RED, + GREEN + } e_t; + + hid_t attr_id; + hid_t space_id; + hid_t type_id; + herr_t status; + int val, i, j, k, n; + float f; + + /* create 1D attributes with dimension [2], 2 elements */ + hsize_t dims[1]={2}; + char buf1[2][2]= {"ab","de"}; /* string */ + char buf2[2]= {1,2}; /* bitfield, opaque */ + s_t buf3[2]= {{1,2},{3,4}}; /* compound */ + hobj_ref_t buf4[2]; /* reference */ + e_t buf45[2]= {RED,RED}; /* enum */ + hvl_t buf5[2]; /* vlen */ + hsize_t dimarray[1]={3}; /* array dimension */ + int buf6[2][3]= {{1,2,3},{4,5,6}}; /* array */ + int buf7[2]= {1,2}; /* integer */ + float buf8[2]= {1,2}; /* float */ + + /* create 2D attributes with dimension [3][2], 6 elements */ + hsize_t dims2[2]={3,2}; + char buf12[6][2]= {"ab","cd","ef","gh","ij","kl"}; /* string */ + char buf22[3][2]= {{1,2},{3,4},{5,6}}; /* bitfield, opaque */ + s_t buf32[6]= {{1,2},{3,4},{5,6},{7,8},{9,10},{11,12}}; /* compound */ + hobj_ref_t buf42[3][2]; /* reference */ + e_t buf452[3][2]; /* enum */ + hvl_t buf52[3][2]; /* vlen */ + int buf62[6][3]= {{1,2,3},{4,5,6},{7,8,9},{10,11,12},{13,14,15},{16,17,18}}; /* array */ + int buf72[3][2]= {{1,2},{3,4},{5,6}}; /* integer */ + float buf82[3][2]= {{1,2},{3,4},{5,6}}; /* float */ + + /* create 3D attributes with dimension [4][3][2], 24 elements */ + hsize_t dims3[3]={4,3,2}; + char buf13[24][2]= {"ab","cd","ef","gh","ij","kl","mn","pq", + "rs","tu","vw","xz","AB","CD","EF","GH", + "IJ","KL","MN","PQ","RS","TU","VW","XZ"}; /* string */ + char buf23[4][3][2]; /* bitfield, opaque */ + s_t buf33[4][3][2]; /* compound */ + hobj_ref_t buf43[4][3][2]; /* reference */ + e_t buf453[4][3][2]; /* enum */ + hvl_t buf53[4][3][2]; /* vlen */ + int buf63[24][3]; /* array */ + int buf73[4][3][2]; /* integer */ + float buf83[4][3][2]; /* float */ + + +/*------------------------------------------------------------------------- + * 1D attributes + *------------------------------------------------------------------------- + */ + +/*------------------------------------------------------------------------- + * H5T_STRING + *------------------------------------------------------------------------- + */ + + if (make_diffs) + { + for (i=0; i<2; i++) + for (j=0; j<2; j++) + { + buf1[i][j]='z'; + } + } + /* + buf1[2][2]= {"ab","de"}; + $h5diff file7.h5 file6.h5 g1 g1 -v + Group: and + Attribute: and + position string of string of difference + ------------------------------------------------------------ +[ 0 ] a z +[ 0 ] b z +[ 1 ] d z +[ 1 ] e z + */ + type_id = H5Tcopy(H5T_C_S1); + status = H5Tset_size(type_id, 2); + write_attr(loc_id,1,dims,"string",type_id,buf1); + status = H5Tclose(type_id); + +/*------------------------------------------------------------------------- + * H5T_BITFIELD + *------------------------------------------------------------------------- + */ + + if (make_diffs) + { + for (i=0; i<2; i++) + buf2[i]=buf2[1]=0; + } + /* + buf2[2]= {1,2}; + $h5diff file7.h5 file6.h5 g1 g1 -v + Group: and + Attribute: and + position bitfield of bitfield of difference + position opaque of opaque of difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 1 ] 2 0 2 + */ + + type_id = H5Tcopy(H5T_STD_B8LE); + write_attr(loc_id,1,dims,"bitfield",type_id,buf2); + status = H5Tclose(type_id); + +/*------------------------------------------------------------------------- + * H5T_OPAQUE + *------------------------------------------------------------------------- + */ + + /* + buf2[2]= {1,2}; + $h5diff file7.h5 file6.h5 g1 g1 -v + Group: and + Attribute: and + position opaque of opaque of difference + position opaque of opaque of difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 1 ] 2 0 2 +*/ + + type_id = H5Tcreate(H5T_OPAQUE, 1); + status = H5Tset_tag(type_id, "1-byte opaque type"); /* must set this */ + write_attr(loc_id,1,dims,"opaque",type_id,buf2); + status = H5Tclose(type_id); + +/*------------------------------------------------------------------------- + * H5T_COMPOUND + *------------------------------------------------------------------------- + */ + + if (make_diffs) + { + for (i=0; i<2; i++) + { + buf3[i].a=0; buf3[i].b=0; + } + } + + /* + buf3[2]= {{1,2},{3,4}}; + $h5diff file7.h5 file6.h5 g1 g1 -v + Group: and + Attribute: and + position compound of compound of difference + ------------------------------------------------------------ + [ 0 ] 1 5 4 + [ 0 ] 2 5 3 + [ 1 ] 3 5 2 + [ 1 ] 4 5 1 + */ + + type_id = H5Tcreate (H5T_COMPOUND, sizeof(s_t)); + H5Tinsert(type_id, "a", HOFFSET(s_t, a), H5T_NATIVE_CHAR); + H5Tinsert(type_id, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); + write_attr(loc_id,1,dims,"compound",type_id,buf3); + status = H5Tclose(type_id); + +/*------------------------------------------------------------------------- + * H5T_REFERENCE + *------------------------------------------------------------------------- + */ + /* Create references to dataset */ + if (dset_name) + { + status=H5Rcreate(&buf4[0],file_id,dset_name,H5R_OBJECT,-1); + status=H5Rcreate(&buf4[1],file_id,dset_name,H5R_OBJECT,-1); + write_attr(loc_id,1,dims,"reference",H5T_STD_REF_OBJ,buf4); + } + +/*------------------------------------------------------------------------- + * H5T_ENUM + *------------------------------------------------------------------------- + */ + if (make_diffs) + { + for (i=0; i<2; i++) + { + buf45[i]=GREEN; + } + } + /* + buf45[2]= {RED,RED}; + $h5diff file7.h5 file6.h5 g1 g1 -v + Group: and + Attribute: and + position enum of enum of difference +------------------------------------------------------------ +[ 0 ] RED GREEN +[ 1 ] RED GREEN + */ + type_id = H5Tcreate(H5T_ENUM, sizeof(e_t)); + H5Tenum_insert(type_id, "RED", (val = 0, &val)); + H5Tenum_insert(type_id, "GREEN", (val = 1, &val)); + write_attr(loc_id,1,dims,"enum",type_id,buf45); + status = H5Tclose(type_id); + +/*------------------------------------------------------------------------- + * H5T_VLEN + *------------------------------------------------------------------------- + */ + + /* Allocate and initialize VL dataset to write */ + + buf5[0].len = 1; + buf5[0].p = malloc( 1 * sizeof(int)); + ((int *)buf5[0].p)[0]=1; + buf5[1].len = 2; + buf5[1].p = malloc( 2 * sizeof(int)); + ((int *)buf5[1].p)[0]=2; + ((int *)buf5[1].p)[1]=3; + + if (make_diffs) + { + ((int *)buf5[0].p)[0]=0; + ((int *)buf5[1].p)[0]=0; + ((int *)buf5[1].p)[1]=0; + } + /* + $h5diff file7.h5 file6.h5 g1 g1 -v + Group: and + position vlen of vlen of difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 1 ] 2 0 2 +[ 1 ] 3 0 3 + */ + + space_id = H5Screate_simple(1,dims,NULL); + type_id = H5Tvlen_create(H5T_NATIVE_INT); + attr_id = H5Acreate(loc_id,"vlen",type_id,space_id,H5P_DEFAULT); + status = H5Awrite(attr_id,type_id,buf5); + assert(status>=0); + status = H5Dvlen_reclaim(type_id,space_id,H5P_DEFAULT,buf5); + assert(status>=0); + status = H5Aclose(attr_id); + status = H5Tclose(type_id); + status = H5Sclose(space_id); + +/*------------------------------------------------------------------------- + * H5T_ARRAY + *------------------------------------------------------------------------- + */ + + if (make_diffs) + { + for (i=0; i<2; i++) + for (j=0; j<3; j++) + { + buf6[i][j]=0; + } + } + /* + buf6[2][3]= {{1,2,3},{4,5,6}}; + $h5diff file7.h5 file6.h5 g1 g1 -v + Group: and + Attribute: and +position array of array of difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 0 ] 2 0 2 +[ 0 ] 3 0 3 +[ 1 ] 4 0 4 +[ 1 ] 5 0 5 +[ 1 ] 6 0 6 + */ + type_id = H5Tarray_create(H5T_NATIVE_INT,1,dimarray,NULL); + write_attr(loc_id,1,dims,"array",type_id,buf6); + status = H5Tclose(type_id); + +/*------------------------------------------------------------------------- + * H5T_INTEGER and H5T_FLOAT + *------------------------------------------------------------------------- + */ + + if (make_diffs) + { + for (i=0; i<2; i++) + { + buf7[i]=0; + buf8[i]=0; + } + } + /* + buf7[2]= {1,2}; + buf8[2]= {1,2}; + $h5diff file7.h5 file6.h5 g1 g1 -v + Group: and + position integer of integer of difference + ------------------------------------------------------------ + [ 0 ] 1 0 1 + [ 1 ] 2 0 2 + position float of float of difference + ------------------------------------------------------------ + [ 0 ] 1 0 1 + [ 1 ] 2 0 2 + */ + write_attr(loc_id,1,dims,"integer",H5T_NATIVE_INT,buf7); + write_attr(loc_id,1,dims,"float",H5T_NATIVE_FLOAT,buf8); + + +/*------------------------------------------------------------------------- + * 2D attributes + *------------------------------------------------------------------------- + */ + +/*------------------------------------------------------------------------- + * H5T_STRING + *------------------------------------------------------------------------- + */ + if (make_diffs) + { + memset(buf12, 'z', sizeof buf12); + } + + /* + buf12[6][2]= {"ab","cd","ef","gh","ij","kl"}; + $h5diff file7.h5 file6.h5 g1 g1 -v + Attribute: and + position string2D of string2D of difference + ------------------------------------------------------------ +[ 0 0 ] a z +[ 0 0 ] b z +[ 0 1 ] c z +[ 0 1 ] d z +[ 1 0 ] e z +[ 1 0 ] f z +[ 1 1 ] g z +[ 1 1 ] h z +[ 2 0 ] i z +[ 2 0 ] j z +[ 2 1 ] k z +[ 2 1 ] l z + */ + + type_id = H5Tcopy(H5T_C_S1); + status = H5Tset_size(type_id, 2); + write_attr(loc_id,2,dims2,"string2D",type_id,buf12); + status = H5Tclose(type_id); + +/*------------------------------------------------------------------------- + * H5T_BITFIELD + *------------------------------------------------------------------------- + */ + + if (make_diffs) + { + memset(buf22,0,sizeof buf22); + } + + /* + buf22[3][2]= {{1,2},{3,4},{5,6}}; + $h5diff file7.h5 file6.h5 g1 g1 -v + Attribute: and + position bitfield2D of bitfield2D of difference +------------------------------------------------------------ +[ 0 0 ] 1 0 1 +[ 0 1 ] 2 0 2 +[ 1 0 ] 3 0 3 +[ 1 1 ] 4 0 4 +[ 2 0 ] 5 0 5 +[ 2 1 ] 6 0 6 + */ + + + type_id = H5Tcopy(H5T_STD_B8LE); + write_attr(loc_id,2,dims2,"bitfield2D",type_id,buf22); + status = H5Tclose(type_id); + +/*------------------------------------------------------------------------- + * H5T_OPAQUE + *------------------------------------------------------------------------- + */ + + /* + buf22[3][2]= {{1,2},{3,4},{5,6}}; + $h5diff file7.h5 file6.h5 g1 g1 -v + Attribute: and + position opaque2D of opaque2D of difference +------------------------------------------------------------ +[ 0 0 ] 1 0 1 +[ 0 1 ] 2 0 2 +[ 1 0 ] 3 0 3 +[ 1 1 ] 4 0 4 +[ 2 0 ] 5 0 5 +[ 2 1 ] 6 0 6 + */ + type_id = H5Tcreate(H5T_OPAQUE, 1); + status = H5Tset_tag(type_id, "1-byte opaque type"); /* must set this */ + write_attr(loc_id,2,dims2,"opaque2D",type_id,buf22); + status = H5Tclose(type_id); + +/*------------------------------------------------------------------------- + * H5T_COMPOUND + *------------------------------------------------------------------------- + */ + if (make_diffs) + { + memset(buf32,0,sizeof buf32); + } + + /* + buf32[6]= {{1,2},{3,4},{5,6},{7,8},{9,10},{11,12}}; + $h5diff file7.h5 file6.h5 g1 g1 -v + Attribute: and + position opaque2D of opaque2D of difference +------------------------------------------------------------ +[ 0 0 ] 1 0 1 +[ 0 1 ] 2 0 2 +[ 1 0 ] 3 0 3 +[ 1 1 ] 4 0 4 +[ 2 0 ] 5 0 5 +[ 2 1 ] 6 0 6 + */ + + + type_id = H5Tcreate (H5T_COMPOUND, sizeof(s_t)); + H5Tinsert(type_id, "a", HOFFSET(s_t, a), H5T_NATIVE_CHAR); + H5Tinsert(type_id, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); + write_attr(loc_id,2,dims2,"compound2D",type_id,buf32); + status = H5Tclose(type_id); + +/*------------------------------------------------------------------------- + * H5T_REFERENCE + *------------------------------------------------------------------------- + */ + /* Create references to dataset */ + if (dset_name) + { + for (i = 0; i < 3; i++) { + for (j = 0; j < 2; j++) { + status=H5Rcreate(&buf42[i][j],file_id,dset_name,H5R_OBJECT,-1); + } + } + write_attr(loc_id,2,dims2,"reference2D",H5T_STD_REF_OBJ,buf42); + } + +/*------------------------------------------------------------------------- + * H5T_ENUM + *------------------------------------------------------------------------- + */ + for (i=0; i<3; i++) + for (j=0; j<2; j++) + { + if (make_diffs) buf452[i][j]=GREEN; else buf452[i][j]=RED; + } + +/* +Attribute: and +position enum2D of enum2D of difference +------------------------------------------------------------ +[ 0 0 ] RED GREEN +[ 0 1 ] RED GREEN +[ 1 0 ] RED GREEN +[ 1 1 ] RED GREEN +[ 2 0 ] RED GREEN +[ 2 1 ] RED GREEN +*/ + + type_id = H5Tcreate(H5T_ENUM, sizeof(e_t)); + H5Tenum_insert(type_id, "RED", (val = 0, &val)); + H5Tenum_insert(type_id, "GREEN", (val = 1, &val)); + write_attr(loc_id,2,dims2,"enum2D",type_id,buf452); + status = H5Tclose(type_id); + +/*------------------------------------------------------------------------- + * H5T_VLEN + *------------------------------------------------------------------------- + */ + + /* Allocate and initialize VL dataset to write */ + n=0; + for (i = 0; i < 3; i++) { + for (j = 0; j < 2; j++) { + int l; + buf52[i][j].p = malloc((i + 1) * sizeof(int)); + buf52[i][j].len = i + 1; + for (l = 0; l < i + 1; l++) + if (make_diffs)((int *)buf52[i][j].p)[l] = 0; + else ((int *)buf52[i][j].p)[l] = n++; + } + } + + /* + position vlen2D of vlen2D of difference +------------------------------------------------------------ +[ 0 1 ] 1 0 1 +[ 1 0 ] 2 0 2 +[ 1 0 ] 3 0 3 +[ 1 1 ] 4 0 4 +[ 1 1 ] 5 0 5 +[ 2 0 ] 6 0 6 +[ 2 0 ] 7 0 7 +[ 2 0 ] 8 0 8 +[ 2 1 ] 9 0 9 +[ 2 1 ] 10 0 10 +[ 2 1 ] 11 0 11 +*/ + + space_id = H5Screate_simple(2,dims2,NULL); + type_id = H5Tvlen_create(H5T_NATIVE_INT); + attr_id = H5Acreate(loc_id,"vlen2D",type_id,space_id,H5P_DEFAULT); + status = H5Awrite(attr_id,type_id,buf52); + assert(status>=0); + status = H5Dvlen_reclaim(type_id,space_id,H5P_DEFAULT,buf52); + assert(status>=0); + status = H5Aclose(attr_id); + status = H5Tclose(type_id); + status = H5Sclose(space_id); + +/*------------------------------------------------------------------------- + * H5T_ARRAY + *------------------------------------------------------------------------- + */ + + if (make_diffs) + { + memset(buf62,0,sizeof buf62); + } + /* + buf62[6][3]= {{1,2,3},{4,5,6},{7,8,9},{10,11,12},{13,14,15},{16,17,18}}; + $h5diff file7.h5 file6.h5 g1 g1 -v + Group: and +Attribute: and +position array2D of array2D of difference +------------------------------------------------------------ +[ 0 0 ] 1 0 1 +[ 0 0 ] 2 0 2 +[ 0 0 ] 3 0 3 +[ 0 1 ] 4 0 4 +[ 0 1 ] 5 0 5 +[ 0 1 ] 6 0 6 +[ 1 0 ] 7 0 7 +[ 1 0 ] 8 0 8 +[ 1 0 ] 9 0 9 +[ 1 1 ] 10 0 10 +[ 1 1 ] 11 0 11 +[ 1 1 ] 12 0 12 +[ 2 0 ] 13 0 13 +[ 2 0 ] 14 0 14 +[ 2 0 ] 15 0 15 +[ 2 1 ] 16 0 16 +[ 2 1 ] 17 0 17 +[ 2 1 ] 18 0 18 + */ + type_id = H5Tarray_create(H5T_NATIVE_INT,1,dimarray,NULL); + write_attr(loc_id,2,dims2,"array2D",type_id,buf62); + status = H5Tclose(type_id); + +/*------------------------------------------------------------------------- + * H5T_INTEGER and H5T_FLOAT + *------------------------------------------------------------------------- + */ + + if (make_diffs) + { + memset(buf72,0,sizeof buf72); + memset(buf82,0,sizeof buf82); + } +/* +Attribute: and +position integer2D of integer2D of difference +------------------------------------------------------------ +[ 0 0 ] 1 0 1 +[ 0 1 ] 2 0 2 +[ 1 0 ] 3 0 3 +[ 1 1 ] 4 0 4 +[ 2 0 ] 5 0 5 +[ 2 1 ] 6 0 6 +6 differences found +Attribute: and +position float2D of float2D of difference +------------------------------------------------------------ +[ 0 0 ] 1 0 1 +[ 0 1 ] 2 0 2 +[ 1 0 ] 3 0 3 +[ 1 1 ] 4 0 4 +[ 2 0 ] 5 0 5 +[ 2 1 ] 6 0 6 +*/ + + write_attr(loc_id,2,dims2,"integer2D",H5T_NATIVE_INT,buf72); + write_attr(loc_id,2,dims2,"float2D",H5T_NATIVE_FLOAT,buf82); + + +/*------------------------------------------------------------------------- + * 3D attributes + *------------------------------------------------------------------------- + */ + +/*------------------------------------------------------------------------- + * H5T_STRING + *------------------------------------------------------------------------- + */ + + if (make_diffs) + { + memset(buf13,'z',sizeof buf13); + } + + /* + buf13[24][2]= {"ab","cd","ef","gh","ij","kl","mn","pq", + "rs","tu","vw","xz","AB","CD","EF","GH", + "IJ","KL","MN","PQ","RS","TU","VW","XZ"}; + +Attribute: and +position string3D of string3D of difference +------------------------------------------------------------ +[ 0 0 0 ] a z +[ 0 0 0 ] b z +[ 0 0 1 ] c z +[ 0 0 1 ] d z +[ 0 1 0 ] e z +[ 0 1 0 ] f z +[ 0 1 1 ] g z +[ 0 1 1 ] h z +[ 0 2 0 ] i z +[ 0 2 0 ] j z +[ 0 2 1 ] k z +[ 0 2 1 ] l z +[ 1 0 0 ] m z +[ 1 0 0 ] n z +[ 1 0 1 ] p z +[ 1 0 1 ] q z +[ 1 1 0 ] r z +[ 1 1 0 ] s z +[ 1 1 1 ] t z +[ 1 1 1 ] u z +[ 1 2 0 ] v z +[ 1 2 0 ] w z +[ 1 2 1 ] x z +[ 2 0 0 ] A z +[ 2 0 0 ] B z +[ 2 0 1 ] C z +[ 2 0 1 ] D z +[ 2 1 0 ] E z +[ 2 1 0 ] F z +[ 2 1 1 ] G z +[ 2 1 1 ] H z +[ 2 2 0 ] I z +[ 2 2 0 ] J z +[ 2 2 1 ] K z +[ 2 2 1 ] L z +[ 3 0 0 ] M z +[ 3 0 0 ] N z +[ 3 0 1 ] P z +[ 3 0 1 ] Q z +[ 3 1 0 ] R z +[ 3 1 0 ] S z +[ 3 1 1 ] T z +[ 3 1 1 ] U z +[ 3 2 0 ] V z +[ 3 2 0 ] W z +[ 3 2 1 ] X z +[ 3 2 1 ] Z z + */ + + type_id = H5Tcopy(H5T_C_S1); + status = H5Tset_size(type_id, 2); + write_attr(loc_id,3,dims3,"string3D",type_id,buf13); + status = H5Tclose(type_id); + +/*------------------------------------------------------------------------- + * H5T_BITFIELD + *------------------------------------------------------------------------- + */ + + n=1; + for (i = 0; i < 4; i++) { + for (j = 0; j < 3; j++) { + for (k = 0; k < 2; k++) { + if (make_diffs) buf23[i][j][k]=0; + else buf23[i][j][k]=n++; + } + } + } + +/* +position bitfield3D of bitfield3D of difference +------------------------------------------------------------ +[ 0 0 0 ] 1 0 1 +[ 0 0 1 ] 2 0 2 +[ 0 1 0 ] 3 0 3 +[ 0 1 1 ] 4 0 4 +[ 0 2 0 ] 5 0 5 +[ 0 2 1 ] 6 0 6 +[ 1 0 0 ] 7 0 7 +[ 1 0 1 ] 8 0 8 +[ 1 1 0 ] 9 0 9 +[ 1 1 1 ] 10 0 10 +[ 1 2 0 ] 11 0 11 +[ 1 2 1 ] 12 0 12 +[ 2 0 0 ] 13 0 13 +[ 2 0 1 ] 14 0 14 +[ 2 1 0 ] 15 0 15 +[ 2 1 1 ] 16 0 16 +[ 2 2 0 ] 17 0 17 +[ 2 2 1 ] 18 0 18 +[ 3 0 0 ] 19 0 19 +[ 3 0 1 ] 20 0 20 +[ 3 1 0 ] 21 0 21 +[ 3 1 1 ] 22 0 22 +[ 3 2 0 ] 23 0 23 +[ 3 2 1 ] 24 0 24 +*/ + + type_id = H5Tcopy(H5T_STD_B8LE); + write_attr(loc_id,3,dims3,"bitfield3D",type_id,buf23); + status = H5Tclose(type_id); + +/*------------------------------------------------------------------------- + * H5T_OPAQUE + *------------------------------------------------------------------------- + */ + type_id = H5Tcreate(H5T_OPAQUE, 1); + status = H5Tset_tag(type_id, "1-byte opaque type"); /* must set this */ + write_attr(loc_id,3,dims3,"opaque3D",type_id,buf23); + status = H5Tclose(type_id); + +/*------------------------------------------------------------------------- + * H5T_COMPOUND + *------------------------------------------------------------------------- + */ + + n=1; + for (i = 0; i < 4; i++) { + for (j = 0; j < 3; j++) { + for (k = 0; k < 2; k++) { + if (make_diffs) { + buf33[i][j][k].a=0; + buf33[i][j][k].b=0; + } + else { + buf33[i][j][k].a=n++; + buf33[i][j][k].b=n++; + } + } + } + } +/*position compound3D of compound3D of difference +------------------------------------------------------------ +[ 0 0 0 ] 1 0 1 +[ 0 0 0 ] 2 0 2 +[ 0 0 1 ] 3 0 3 +[ 0 0 1 ] 4 0 4 +[ 0 1 0 ] 5 0 5 +[ 0 1 0 ] 6 0 6 +[ 0 1 1 ] 7 0 7 +[ 0 1 1 ] 8 0 8 +[ 0 2 0 ] 9 0 9 +[ 0 2 0 ] 10 0 10 +[ 0 2 1 ] 11 0 11 +[ 0 2 1 ] 12 0 12 +[ 1 0 0 ] 13 0 13 +[ 1 0 0 ] 14 0 14 +[ 1 0 1 ] 15 0 15 +[ 1 0 1 ] 16 0 16 +[ 1 1 0 ] 17 0 17 +[ 1 1 0 ] 18 0 18 +[ 1 1 1 ] 19 0 19 +[ 1 1 1 ] 20 0 20 +[ 1 2 0 ] 21 0 21 +[ 1 2 0 ] 22 0 22 +[ 1 2 1 ] 23 0 23 +[ 1 2 1 ] 24 0 24 +[ 2 0 0 ] 25 0 25 +[ 2 0 0 ] 26 0 26 +[ 2 0 1 ] 27 0 27 +[ 2 0 1 ] 28 0 28 +[ 2 1 0 ] 29 0 29 +[ 2 1 0 ] 30 0 30 +[ 2 1 1 ] 31 0 31 +[ 2 1 1 ] 32 0 32 +[ 2 2 0 ] 33 0 33 +[ 2 2 0 ] 34 0 34 +[ 2 2 1 ] 35 0 35 +[ 2 2 1 ] 36 0 36 +[ 3 0 0 ] 37 0 37 +[ 3 0 0 ] 38 0 38 +[ 3 0 1 ] 39 0 39 +[ 3 0 1 ] 40 0 40 +[ 3 1 0 ] 41 0 41 +[ 3 1 0 ] 42 0 42 +[ 3 1 1 ] 43 0 43 +[ 3 1 1 ] 44 0 44 +[ 3 2 0 ] 45 0 45 +[ 3 2 0 ] 46 0 46 +[ 3 2 1 ] 47 0 47 +[ 3 2 1 ] 48 0 48 +*/ + + + + type_id = H5Tcreate (H5T_COMPOUND, sizeof(s_t)); + H5Tinsert(type_id, "a", HOFFSET(s_t, a), H5T_NATIVE_CHAR); + H5Tinsert(type_id, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); + write_attr(loc_id,3,dims3,"compound3D",type_id,buf33); + status = H5Tclose(type_id); + +/*------------------------------------------------------------------------- + * H5T_REFERENCE + *------------------------------------------------------------------------- + */ + /* Create references to dataset */ + if (dset_name) + { + for (i = 0; i < 4; i++) { + for (j = 0; j < 3; j++) { + for (k = 0; k < 2; k++) + status=H5Rcreate(&buf43[i][j][k],file_id,dset_name,H5R_OBJECT,-1); + } + } + write_attr(loc_id,3,dims3,"reference3D",H5T_STD_REF_OBJ,buf43); + } + +/*------------------------------------------------------------------------- + * H5T_ENUM + *------------------------------------------------------------------------- + */ + + for (i = 0; i < 4; i++) { + for (j = 0; j < 3; j++) { + for (k = 0; k < 2; k++) { + if (make_diffs) buf453[i][j][k]=RED; else buf453[i][j][k]=GREEN; + } + } + } + +/* +position enum3D of enum3D of difference +------------------------------------------------------------ +[ 0 0 0 ] GREEN RED +[ 0 0 1 ] GREEN RED +[ 0 1 0 ] GREEN RED +[ 0 1 1 ] GREEN RED +[ 0 2 0 ] GREEN RED +[ 0 2 1 ] GREEN RED +[ 1 0 0 ] GREEN RED +[ 1 0 1 ] GREEN RED +[ 1 1 0 ] GREEN RED +[ 1 1 1 ] GREEN RED +[ 1 2 0 ] GREEN RED +[ 1 2 1 ] GREEN RED +[ 2 0 0 ] GREEN RED +[ 2 0 1 ] GREEN RED +[ 2 1 0 ] GREEN RED +[ 2 1 1 ] GREEN RED +[ 2 2 0 ] GREEN RED +[ 2 2 1 ] GREEN RED +[ 3 0 0 ] GREEN RED +[ 3 0 1 ] GREEN RED +[ 3 1 0 ] GREEN RED +[ 3 1 1 ] GREEN RED +[ 3 2 0 ] GREEN RED +[ 3 2 1 ] GREEN RED +*/ + + + type_id = H5Tcreate(H5T_ENUM, sizeof(e_t)); + H5Tenum_insert(type_id, "RED", (val = 0, &val)); + H5Tenum_insert(type_id, "GREEN", (val = 1, &val)); + write_attr(loc_id,3,dims3,"enum3D",type_id,buf453); + status = H5Tclose(type_id); + +/*------------------------------------------------------------------------- + * H5T_VLEN + *------------------------------------------------------------------------- + */ + + /* Allocate and initialize VL dataset to write */ + n=0; + for (i = 0; i < 4; i++) { + for (j = 0; j < 3; j++) { + for (k = 0; k < 2; k++) { + int l; + buf53[i][j][k].p = malloc((i + 1) * sizeof(int)); + buf53[i][j][k].len = i + 1; + for (l = 0; l < i + 1; l++) + if (make_diffs)((int *)buf53[i][j][k].p)[l] = 0; + else ((int *)buf53[i][j][k].p)[l] = n++; + } + } + } +/* +position vlen3D of vlen3D of difference +------------------------------------------------------------ +[ 0 0 1 ] 1 0 1 +[ 0 1 0 ] 2 0 2 +[ 0 1 1 ] 3 0 3 +[ 0 2 0 ] 4 0 4 +[ 0 2 1 ] 5 0 5 +[ 1 0 0 ] 6 0 6 +[ 1 0 0 ] 7 0 7 +[ 1 0 1 ] 8 0 8 +[ 1 0 1 ] 9 0 9 +[ 1 1 0 ] 10 0 10 +etc +*/ + space_id = H5Screate_simple(3,dims3,NULL); + type_id = H5Tvlen_create(H5T_NATIVE_INT); + attr_id = H5Acreate(loc_id,"vlen3D",type_id,space_id,H5P_DEFAULT); + status = H5Awrite(attr_id,type_id,buf53); + assert(status>=0); + status = H5Dvlen_reclaim(type_id,space_id,H5P_DEFAULT,buf53); + assert(status>=0); + status = H5Aclose(attr_id); + status = H5Tclose(type_id); + status = H5Sclose(space_id); + +/*------------------------------------------------------------------------- + * H5T_ARRAY + *------------------------------------------------------------------------- + */ + n=1; + for (i = 0; i < 24; i++) { + for (j = 0; j < (int)dimarray[0]; j++) { + if (make_diffs) buf63[i][j]=0; + else buf63[i][j]=n++; + } + } + /* + position array3D of array3D of difference +------------------------------------------------------------ +[ 0 0 0 ] 1 0 1 +[ 0 0 0 ] 2 0 2 +[ 0 0 0 ] 3 0 3 +[ 0 0 1 ] 4 0 4 +[ 0 0 1 ] 5 0 5 +[ 0 0 1 ] 6 0 6 +[ 0 1 0 ] 7 0 7 +etc +*/ + + type_id = H5Tarray_create(H5T_NATIVE_INT,1,dimarray,NULL); + write_attr(loc_id,3,dims3,"array3D",type_id,buf63); + status = H5Tclose(type_id); + +/*------------------------------------------------------------------------- + * H5T_INTEGER and H5T_FLOAT + *------------------------------------------------------------------------- + */ + n=1; f=1; + for (i = 0; i < 4; i++) { + for (j = 0; j < 3; j++) { + for (k = 0; k < 2; k++) { + if (make_diffs) { + buf73[i][j][k]=0; + buf83[i][j][k]=0; + } + else { + buf73[i][j][k]=n++; + buf83[i][j][k]=f++; + } + } + } + } + + /* + position integer3D of integer3D of difference +------------------------------------------------------------ +[ 0 0 0 ] 1 0 1 +[ 0 0 1 ] 2 0 2 +[ 0 1 0 ] 3 0 3 +[ 0 1 1 ] 4 0 4 +[ 0 2 0 ] 5 0 5 +[ 0 2 1 ] 6 0 6 +[ 1 0 0 ] 7 0 7 +[ 1 0 1 ] 8 0 8 +[ 1 1 0 ] 9 0 9 +[ 1 1 1 ] 10 0 10 +etc +*/ + write_attr(loc_id,3,dims3,"integer3D",H5T_NATIVE_INT,buf73); + write_attr(loc_id,3,dims3,"float3D",H5T_NATIVE_FLOAT,buf83); +} + + + +/*------------------------------------------------------------------------- + * Check all HDF5 classes + * H5T_INTEGER, H5T_FLOAT + * H5T_TIME, H5T_STRING, H5T_BITFIELD, H5T_OPAQUE, H5T_COMPOUND, H5T_REFERENCE, + * H5T_ENUM, H5T_VLEN, H5T_ARRAY + *------------------------------------------------------------------------- + */ + + +int test_attr(const char *file, + int make_diffs /* flag to modify data buffers */) +{ + hid_t file_id; + hid_t dset_id; + hid_t group_id; + hid_t root_id; + hid_t space_id; + hsize_t dims[1]={2}; + herr_t status; + + /* Create a file */ + if ((file_id = H5Fcreate(file, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT))<0) + return -1; + + /* Create a 1D dataset */ + space_id = H5Screate_simple(1,dims,NULL); + dset_id = H5Dcreate(file_id,"dset",H5T_NATIVE_INT,space_id,H5P_DEFAULT); + status = H5Sclose(space_id); + assert(status>=0); + + /* Create groups */ + group_id = H5Gcreate(file_id,"g1",0); + root_id = H5Gopen(file_id, "/"); + +/*------------------------------------------------------------------------- + * write a series of attributes on the dataset, group, and root group + *------------------------------------------------------------------------- + */ + + write_attr_in(dset_id,"dset",file_id,make_diffs); + write_attr_in(group_id,NULL,0,make_diffs); + write_attr_in(root_id,NULL,0,make_diffs); + + + /* Close */ + status = H5Dclose(dset_id); + assert(status>=0); + status = H5Gclose(group_id); + assert(status>=0); + status = H5Gclose(root_id); + assert(status>=0); + + /* Close file */ + status = H5Fclose(file_id); + assert(status>=0); + return status; +} diff --git a/tools/h5diff/testh5diff_basic.c b/tools/h5diff/testh5diff_basic.c new file mode 100644 index 0000000..fe0282d --- /dev/null +++ b/tools/h5diff/testh5diff_basic.c @@ -0,0 +1,498 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include "testh5diff.h" + + +/*UINT_MAX Maximum value for a variable of type unsigned int. 4294967295 */ +#define UIMAX 4294967295u + + + +/* + +# ############################################################################## +# # Common usage +# ############################################################################## + + +# 1.0 + -h + +# 1.1 + file1.h5 file2.h5 g1/dset1 g1/dset2 + +# 1.2 + file1.h5 file2.h5 -n 2 g1/dset1 g1/dset2 + +# 1.3 + file1.h5 file2.h5 -d 5 g1/dset3 g1/dset4 + +# 1.4 + file1.h5 file2.h5 -p 0.05 g1/dset3 g1/dset4 + +# 1.5 + file1.h5 file2.h5 -r g1/dset1 g1/dset2 + +# 1.6 + file1.h5 file2.h5 + +# ############################################################################## +# # basic types +# ############################################################################## + +# 2.0 + file3.h5 file3.h5 dset group + +# 2.1 + file3.h5 file3.h5 dset link + +# 2.2 + file3.h5 file3.h5 dset type + +# 2.3 + file3.h5 file3.h5 group group + +# 2.4 + file3.h5 file3.h5 type type + +# 2.5 + file3.h5 file3.h5 link link + + +# ############################################################################## +# # Dimensions +# ############################################################################## + +# 4.0 + file5.h5 file5.h5 dset1 dset2 + +# 4.1 + file5.h5 file5.h5 dset3 dset4 + +# 4.2 + file5.h5 file5.h5 dset5 dset6 + + +# ############################################################################## +# # Dataset types +# ############################################################################## + +# 5.0 + file6.h5 file6.h5 dset0a dset0b + +# 5.1 + file6.h5 file6.h5 dset1a dset1b + +# 5.2 + file6.h5 file6.h5 dset2a dset2b + +# 5.3 + file6.h5 file6.h5 dset3a dset4b + +# 5.4 + file6.h5 file6.h5 dset4a dset4b + +# 5.5 + file6.h5 file6.h5 dset5a dset5b + +# 5.6 + file6.h5 file6.h5 dset6a dset6b + +# 5.7 + file6.h5 file6.h5 dset7a dset7b + +# 5.8 + file6.h5 file6.h5 dset8a dset8b + +# ############################################################################## +# # Error messages +# ############################################################################## + + +# 6.0: Check if the command line number of arguments is less than 3 + h5diff_test1.h5 + +# 6.1: Check for invalid options + h5diff_test1.h5 h5diff_test2.h5 -x + +# ############################################################################## +# # -d +# ############################################################################## + +# 6.2: no value + file1.h5 file2.h5 -d g1/dset3 g1/dset4 + +# 6.3: negative value + file1.h5 file2.h5 -d -4 g1/dset3 g1/dset4 + +# 6.4: zero + file1.h5 file2.h5 -d 0 g1/dset3 g1/dset4 + +# 6.5: non number + file1.h5 file2.h5 -d u g1/dset3 g1/dset4 + +# 6.6: hexadecimal + file1.h5 file2.h5 -d 0x1 g1/dset3 g1/dset4 + +# 6.7: string + file1.h5 file2.h5 -d "1" g1/dset3 g1/dset4 + +# 6.8: repeated option + file1.h5 file2.h5 -d 1 -d 2 g1/dset3 g1/dset4 + +# 6.9: number larger than biggest difference + file1.h5 file2.h5 -d 200 g1/dset3 g1/dset4 + +# 6.10: number smaller than smallest difference + file1.h5 file2.h5 -d 1 g1/dset3 g1/dset4 + + +# ############################################################################## +# # -p +# ############################################################################## + + +# 6.11: no value + file1.h5 file2.h5 -p g1/dset3 g1/dset4 + +# 6.12: negative value + file1.h5 file2.h5 -p -4 g1/dset3 g1/dset4 + +# 6.13: zero + file1.h5 file2.h5 -p 0 g1/dset3 g1/dset4 + +# 6.14: non number + file1.h5 file2.h5 -p u g1/dset3 g1/dset4 + +# 6.15: hexadecimal + file1.h5 file2.h5 -p 0x1 g1/dset3 g1/dset4 + +# 6.16: string + file1.h5 file2.h5 -p "0.21" g1/dset3 g1/dset4 + +# 6.17: repeated option + file1.h5 file2.h5 -p 0.21 -p 0.22 g1/dset3 g1/dset4 + +# 6.18: number larger than biggest difference + file1.h5 file2.h5 -p 2 g1/dset3 g1/dset4 + +# 6.19: number smaller than smallest difference + file1.h5 file2.h5 -p 0.005 g1/dset3 g1/dset4 + + + +# ############################################################################## +# # -n +# ############################################################################## + + +# 6.20: no value + file1.h5 file2.h5 -n g1/dset3 g1/dset4 + +# 6.21: negative value + file1.h5 file2.h5 -n -4 g1/dset3 g1/dset4 + +# 6.22: zero + file1.h5 file2.h5 -n 0 g1/dset3 g1/dset4 + +# 6.23: non number + file1.h5 file2.h5 -n u g1/dset3 g1/dset4 + +# 6.24: hexadecimal + file1.h5 file2.h5 -n 0x1 g1/dset3 g1/dset4 + +# 6.25: string + file1.h5 file2.h5 -n "2" g1/dset3 g1/dset4 + +# 6.26: repeated option + file1.h5 file2.h5 -n 2 -n 3 g1/dset3 g1/dset4 + +# 6.27: number larger than biggest difference + file1.h5 file2.h5 -n 200 g1/dset3 g1/dset4 + +# 6.28: number smaller than smallest difference + file1.h5 file2.h5 -n 1 g1/dset3 g1/dset4 + +# ############################################################################## +# # non valid files +# ############################################################################## + + file1.h6 file2.h6 + +*/ + + +/*------------------------------------------------------------------------- + * Basic review tests + *------------------------------------------------------------------------- + */ + +int test_basic(const char *file1, const char *file2) +{ + + hid_t file1_id, file2_id; + hid_t group1_id, group2_id, group3_id; + herr_t status; + hsize_t dims[2] = { 3,2 }; + + /* Test */ + double data1[3][2] = {{1,1},{1,1},{1,1}}; + double data2[3][2] = {{1,1.1},{1.01,1.001},{1.0001,1}}; + double data3[3][2] = {{100,110},{100,100},{100,100}}; + double data4[3][2] = {{110,100},{90,80},{140,200}}; + +/*------------------------------------------------------------------------- + * Create two files + *------------------------------------------------------------------------- + */ + + file1_id = H5Fcreate (file1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + file2_id = H5Fcreate (file2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + + /* Create groups */ + group1_id = H5Gcreate(file1_id, "g1", 0); + group2_id = H5Gcreate(file2_id, "g1", 0); + group3_id = H5Gcreate(file2_id, "g2", 0); + + write_dset(group1_id,2,dims,"dset1",H5T_NATIVE_DOUBLE,data1); + write_dset(group2_id,2,dims,"dset2",H5T_NATIVE_DOUBLE,data2); + write_dset(group1_id,2,dims,"dset3",H5T_NATIVE_DOUBLE,data3); + write_dset(group2_id,2,dims,"dset4",H5T_NATIVE_DOUBLE,data4); + write_dset(group2_id,2,dims,"dset1",H5T_NATIVE_DOUBLE,data2); + +/*------------------------------------------------------------------------- + * Close + *------------------------------------------------------------------------- + */ + status = H5Gclose(group1_id); + status = H5Gclose(group2_id); + status = H5Gclose(group3_id); + status = H5Fclose(file1_id); + status = H5Fclose(file2_id); + return status; +} + +/*------------------------------------------------------------------------- + * Compare different types: H5G_DATASET, H5G_TYPE, H5G_GROUP, H5G_LINK + *------------------------------------------------------------------------- + */ + +int test_types(const char *file1, const char UNUSED *file2) +{ + + hid_t file1_id; + hid_t group_id; + hid_t type_id; + herr_t status; + hsize_t dims[1]={1}; + /* Compound datatype */ + typedef struct s_t + { + int a; + float b; + } s_t; + + +/*------------------------------------------------------------------------- + * Create one file + *------------------------------------------------------------------------- + */ + file1_id = H5Fcreate (file1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + +/*------------------------------------------------------------------------- + * H5G_DATASET + *------------------------------------------------------------------------- + */ + write_dset(file1_id,1,dims,"dset",H5T_NATIVE_INT,0); + +/*------------------------------------------------------------------------- + * H5G_GROUP + *------------------------------------------------------------------------- + */ + group_id = H5Gcreate(file1_id, "group", 0); + status = H5Gclose(group_id); + +/*------------------------------------------------------------------------- + * H5G_TYPE + *------------------------------------------------------------------------- + */ + + /* Create a memory compound datatype */ + type_id = H5Tcreate (H5T_COMPOUND, sizeof(s_t)); + H5Tinsert(type_id, "a", HOFFSET(s_t, a), H5T_NATIVE_INT); + H5Tinsert(type_id, "b", HOFFSET(s_t, b), H5T_NATIVE_FLOAT); + /* Commit compound datatype and close it */ + H5Tcommit(file1_id, "type", type_id); + H5Tclose(type_id); + +/*------------------------------------------------------------------------- + * H5G_LINK + *------------------------------------------------------------------------- + */ + + status = H5Glink(file1_id, H5G_LINK_SOFT, "dset", "link"); + +/*------------------------------------------------------------------------- + * Close + *------------------------------------------------------------------------- + */ + status = H5Fclose(file1_id); + return status; +} + + + + + +/*------------------------------------------------------------------------- + * Datasets datatypes + *------------------------------------------------------------------------- + */ + +int test_native(const char *file1, const char UNUSED *file2) +{ + + hid_t file1_id; + hsize_t dims[2]={3,2}; + herr_t status; + char buf1a[3][2] = {{1,1},{1,1},{1,1}}; + char buf1b[3][2] = {{1,1},{3,4},{5,6}}; + short buf2a[3][2] = {{1,1},{1,1},{1,1}}; + short buf2b[3][2] = {{1,1},{3,4},{5,6}}; + int buf3a[3][2] = {{1,1},{1,1},{1,1}}; + int buf3b[3][2] = {{1,1},{3,4},{5,6}}; + long buf4a[3][2] = {{1,1},{1,1},{1,1}}; + long buf4b[3][2] = {{1,1},{3,4},{5,6}}; + float buf5a[3][2] = {{1,1},{1,1},{1,1}}; + float buf5b[3][2] = {{1,1},{3,4},{5,6}}; + double buf6a[3][2] = {{1,1},{1,1},{1,1}}; + double buf6b[3][2] = {{1,1},{3,4},{5,6}}; + + /*unsigned/signed test + signed char -128 to 127 + unsigned char 0 to 255 + */ + char buf7a[3][2] = {{-1,-128},{-1,-1},{-1,-1}}; + unsigned char buf7b[3][2] = {{1,128},{1,1},{1,1}}; + + /* long_long test */ + long_long buf8a[3][2] = {{1,1},{1,1},{1,1}}; + long_long buf8b[3][2] = {{1,1},{3,4},{5,6}}; + unsigned long_long buf9a[3][2] = {{1,1},{1,1},{1,1}}; + unsigned long_long buf9b[3][2] = {{1,1},{3,4},{5,6}}; + + unsigned int buf10a[3][2] = {{UIMAX,1},{1,1},{1,1}}; + unsigned int buf10b[3][2] = {{UIMAX-1,1},{3,4},{5,6}}; + + +/*------------------------------------------------------------------------- + * Create a file + *------------------------------------------------------------------------- + */ + file1_id = H5Fcreate (file1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + +/*------------------------------------------------------------------------- + * Check for different storage order. Give a warning if they are different + *------------------------------------------------------------------------- + */ + + write_dset(file1_id,2,dims,"dset0a",H5T_STD_I16LE,buf2a); + write_dset(file1_id,2,dims,"dset0b",H5T_STD_I32LE,buf3b); + +/*------------------------------------------------------------------------- + * Check H5T_NATIVE_CHAR + *------------------------------------------------------------------------- + */ + write_dset(file1_id,2,dims,"dset1a",H5T_NATIVE_CHAR,buf1a); + write_dset(file1_id,2,dims,"dset1b",H5T_NATIVE_CHAR,buf1b); + +/*------------------------------------------------------------------------- + * Check H5T_NATIVE_SHORT + *------------------------------------------------------------------------- + */ + write_dset(file1_id,2,dims,"dset2a",H5T_NATIVE_SHORT,buf2a); + write_dset(file1_id,2,dims,"dset2b",H5T_NATIVE_SHORT,buf2b); + +/*------------------------------------------------------------------------- + * Check H5T_NATIVE_INT + *------------------------------------------------------------------------- + */ + write_dset(file1_id,2,dims,"dset3a",H5T_NATIVE_INT,buf3a); + write_dset(file1_id,2,dims,"dset3b",H5T_NATIVE_INT,buf3b); + +/*------------------------------------------------------------------------- + * Check H5T_NATIVE_LONG + *------------------------------------------------------------------------- + */ + write_dset(file1_id,2,dims,"dset4a",H5T_NATIVE_LONG,buf4a); + write_dset(file1_id,2,dims,"dset4b",H5T_NATIVE_LONG,buf4b); + +/*------------------------------------------------------------------------- + * Check H5T_NATIVE_FLOAT + *------------------------------------------------------------------------- + */ + write_dset(file1_id,2,dims,"dset5a",H5T_NATIVE_FLOAT,buf5a); + write_dset(file1_id,2,dims,"dset5b",H5T_NATIVE_FLOAT,buf5b); + +/*------------------------------------------------------------------------- + * Check H5T_NATIVE_DOUBLE + *------------------------------------------------------------------------- + */ + + write_dset(file1_id,2,dims,"dset6a",H5T_NATIVE_DOUBLE,buf6a); + write_dset(file1_id,2,dims,"dset6b",H5T_NATIVE_DOUBLE,buf6b); + +/*------------------------------------------------------------------------- + * H5T_NATIVE_CHAR and H5T_NATIVE_UCHAR + *------------------------------------------------------------------------- + */ + + write_dset(file1_id,2,dims,"dset7a",H5T_NATIVE_CHAR,buf7a); + write_dset(file1_id,2,dims,"dset7b",H5T_NATIVE_UCHAR,buf7b); + +/*------------------------------------------------------------------------- + * H5T_NATIVE_LLONG + *------------------------------------------------------------------------- + */ + + write_dset(file1_id,2,dims,"dset8a",H5T_NATIVE_LLONG,buf8a); + write_dset(file1_id,2,dims,"dset8b",H5T_NATIVE_LLONG,buf8b); + +/*------------------------------------------------------------------------- + * H5T_NATIVE_ULLONG + *------------------------------------------------------------------------- + */ + + write_dset(file1_id,2,dims,"dset9a",H5T_NATIVE_ULLONG,buf9a); + write_dset(file1_id,2,dims,"dset9b",H5T_NATIVE_ULLONG,buf9b); + +/*------------------------------------------------------------------------- + * H5T_NATIVE_INT + *------------------------------------------------------------------------- + */ + + write_dset(file1_id,2,dims,"dset10a",H5T_NATIVE_UINT,buf10a); + write_dset(file1_id,2,dims,"dset10b",H5T_NATIVE_UINT,buf10b); + + +/*------------------------------------------------------------------------- + * Close + *------------------------------------------------------------------------- + */ + status = H5Fclose(file1_id); + return status; +} + + diff --git a/tools/h5diff/testh5diff_dset.c b/tools/h5diff/testh5diff_dset.c new file mode 100644 index 0000000..44b2445 --- /dev/null +++ b/tools/h5diff/testh5diff_dset.c @@ -0,0 +1,683 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include "testh5diff.h" + + + +/*------------------------------------------------------------------------- + * Function: write_dset_in + * + * Purpose: write datasets in LOC_ID + * + * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * + * Date: November 12, 2003 + * + *------------------------------------------------------------------------- + */ + + +void write_dset_in(hid_t loc_id, + const char* dset_name, /* for saving reference to dataset*/ + hid_t file_id, + int make_diffs /* flag to modify data buffers */) +{ + /* Compound datatype */ + typedef struct s_t + { + char a; + double b; + } s_t; + + typedef enum + { + RED, + GREEN + } e_t; + + hid_t dset_id; + hid_t space_id; + hid_t type_id; + hid_t plist_id; + herr_t status; + int val, i, j, k, n; + float f; + int fillvalue=2; + + /* create 1D attributes with dimension [2], 2 elements */ + hsize_t dims[1]={2}; + char buf1[2][2]= {"ab","de"}; /* string */ + char buf2[2]= {1,2}; /* bitfield, opaque */ + s_t buf3[2]= {{1,2},{3,4}}; /* compound */ + hobj_ref_t buf4[2]; /* reference */ + e_t buf45[2]= {RED,GREEN}; /* enum */ + hvl_t buf5[2]; /* vlen */ + hsize_t dimarray[1]={3}; /* array dimension */ + int buf6[2][3]= {{1,2,3},{4,5,6}}; /* array */ + int buf7[2]= {1,2}; /* integer */ + float buf8[2]= {1,2}; /* float */ + + /* create 2D attributes with dimension [3][2], 6 elements */ + hsize_t dims2[2]={3,2}; + char buf12[6][2]= {"ab","cd","ef","gh","ij","kl"}; /* string */ + char buf22[3][2]= {{1,2},{3,4},{5,6}}; /* bitfield, opaque */ + s_t buf32[6]= {{1,2},{3,4},{5,6},{7,8},{9,10},{11,12}}; /* compound */ + hobj_ref_t buf42[3][2]; /* reference */ + e_t buf452[3][2]; /* enum */ + hvl_t buf52[3][2]; /* vlen */ + int buf62[6][3]= {{1,2,3},{4,5,6},{7,8,9},{10,11,12},{13,14,15},{16,17,18}}; /* array */ + int buf72[3][2]= {{1,2},{3,4},{5,6}}; /* integer */ + float buf82[3][2]= {{1,2},{3,4},{5,6}}; /* float */ + + /* create 3D attributes with dimension [4][3][2], 24 elements */ + hsize_t dims3[3]={4,3,2}; + char buf13[24][2]= {"ab","cd","ef","gh","ij","kl","mn","pq", + "rs","tu","vw","xz","AB","CD","EF","GH", + "IJ","KL","MN","PQ","RS","TU","VW","XZ"}; /* string */ + char buf23[4][3][2]; /* bitfield, opaque */ + s_t buf33[4][3][2]; /* compound */ + hobj_ref_t buf43[4][3][2]; /* reference */ + e_t buf453[4][3][2]; /* enum */ + hvl_t buf53[4][3][2]; /* vlen */ + int buf63[24][3]; /* array */ + int buf73[4][3][2]; /* integer */ + float buf83[4][3][2]; /* float */ + + +/*------------------------------------------------------------------------- + * 1D + *------------------------------------------------------------------------- + */ + +/*------------------------------------------------------------------------- + * H5T_STRING + *------------------------------------------------------------------------- + */ + + + if (make_diffs) + { + for (i=0; i<2; i++) + for (j=0; j<2; j++) + { + buf1[i][j]='z'; + } + } + + + type_id = H5Tcopy(H5T_C_S1); + status = H5Tset_size(type_id, 2); + write_dset(loc_id,1,dims,"string",type_id,buf1); + status = H5Tclose(type_id); + +/*------------------------------------------------------------------------- + * H5T_BITFIELD + *------------------------------------------------------------------------- + */ + + if (make_diffs) + { + for (i=0; i<2; i++) + buf2[i]=buf2[1]=0; + } + + type_id = H5Tcopy(H5T_STD_B8LE); + write_dset(loc_id,1,dims,"bitfield",type_id,buf2); + status = H5Tclose(type_id); + +/*------------------------------------------------------------------------- + * H5T_OPAQUE + *------------------------------------------------------------------------- + */ + + if (make_diffs) + { + for (i=0; i<2; i++) + { + buf3[i].a=0; buf3[i].b=0; + } + } + + type_id = H5Tcreate(H5T_OPAQUE, 1); + status = H5Tset_tag(type_id, "1-byte opaque type"); /* must set this */ + write_dset(loc_id,1,dims,"opaque",type_id,buf2); + status = H5Tclose(type_id); + +/*------------------------------------------------------------------------- + * H5T_COMPOUND + *------------------------------------------------------------------------- + */ + + + if (make_diffs) + { + for (i=0; i<2; i++) + { + buf45[i]=GREEN; + } + } + + type_id = H5Tcreate (H5T_COMPOUND, sizeof(s_t)); + H5Tinsert(type_id, "a", HOFFSET(s_t, a), H5T_NATIVE_CHAR); + H5Tinsert(type_id, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); + write_dset(loc_id,1,dims,"compound",type_id,buf3); + status = H5Tclose(type_id); + +/*------------------------------------------------------------------------- + * H5T_REFERENCE + *------------------------------------------------------------------------- + */ + /* Create references to dataset */ + if (dset_name) + { + status=H5Rcreate(&buf4[0],file_id,dset_name,H5R_OBJECT,-1); + status=H5Rcreate(&buf4[1],file_id,dset_name,H5R_OBJECT,-1); + write_dset(loc_id,1,dims,"reference",H5T_STD_REF_OBJ,buf4); + } + +/*------------------------------------------------------------------------- + * H5T_ENUM + *------------------------------------------------------------------------- + */ + type_id = H5Tcreate(H5T_ENUM, sizeof(e_t)); + H5Tenum_insert(type_id, "RED", (val = 0, &val)); + H5Tenum_insert(type_id, "GREEN", (val = 1, &val)); + write_dset(loc_id,1,dims,"enum",type_id,buf45); + status = H5Tclose(type_id); + +/*------------------------------------------------------------------------- + * H5T_VLEN + *------------------------------------------------------------------------- + */ + + /* Allocate and initialize VL dataset to write */ + + buf5[0].len = 1; + buf5[0].p = malloc( 1 * sizeof(int)); + ((int *)buf5[0].p)[0]=1; + buf5[1].len = 2; + buf5[1].p = malloc( 2 * sizeof(int)); + ((int *)buf5[1].p)[0]=2; + ((int *)buf5[1].p)[1]=3; + + if (make_diffs) + { + ((int *)buf5[0].p)[0]=0; + ((int *)buf5[1].p)[0]=0; + ((int *)buf5[1].p)[1]=0; + } + + space_id = H5Screate_simple(1,dims,NULL); + type_id = H5Tvlen_create(H5T_NATIVE_INT); + dset_id = H5Dcreate(loc_id,"vlen",type_id,space_id,H5P_DEFAULT); + status = H5Dwrite(dset_id,type_id,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf5); + assert(status>=0); + status = H5Dvlen_reclaim(type_id,space_id,H5P_DEFAULT,buf5); + assert(status>=0); + status = H5Dclose(dset_id); + status = H5Tclose(type_id); + status = H5Sclose(space_id); + +/*------------------------------------------------------------------------- + * H5T_ARRAY + *------------------------------------------------------------------------- + */ + + if (make_diffs) + { + for (i=0; i<2; i++) + for (j=0; j<3; j++) + { + buf6[i][j]=0; + } + } + + type_id = H5Tarray_create(H5T_NATIVE_INT,1,dimarray,NULL); + write_dset(loc_id,1,dims,"array",type_id,buf6); + status = H5Tclose(type_id); + +/*------------------------------------------------------------------------- + * H5T_INTEGER and H5T_FLOAT + *------------------------------------------------------------------------- + */ + + if (make_diffs) + { + for (i=0; i<2; i++) + { + buf7[i]=0; + buf8[i]=0; + } + } + + write_dset(loc_id,1,dims,"integer",H5T_NATIVE_INT,buf7); + write_dset(loc_id,1,dims,"float",H5T_NATIVE_FLOAT,buf8); + + +/*------------------------------------------------------------------------- + * 2D + *------------------------------------------------------------------------- + */ + +/*------------------------------------------------------------------------- + * H5T_STRING + *------------------------------------------------------------------------- + */ + + if (make_diffs) + { + memset(buf12, 'z', sizeof buf12); + } + + + type_id = H5Tcopy(H5T_C_S1); + status = H5Tset_size(type_id, 2); + write_dset(loc_id,2,dims2,"string2D",type_id,buf12); + status = H5Tclose(type_id); + +/*------------------------------------------------------------------------- + * H5T_BITFIELD + *------------------------------------------------------------------------- + */ + + + if (make_diffs) + { + memset(buf22,0,sizeof buf22); + } + + type_id = H5Tcopy(H5T_STD_B8LE); + write_dset(loc_id,2,dims2,"bitfield2D",type_id,buf22); + status = H5Tclose(type_id); + +/*------------------------------------------------------------------------- + * H5T_OPAQUE + *------------------------------------------------------------------------- + */ + type_id = H5Tcreate(H5T_OPAQUE, 1); + status = H5Tset_tag(type_id, "1-byte opaque type"); /* must set this */ + write_dset(loc_id,2,dims2,"opaque2D",type_id,buf22); + status = H5Tclose(type_id); + +/*------------------------------------------------------------------------- + * H5T_COMPOUND + *------------------------------------------------------------------------- + */ + + if (make_diffs) + { + memset(buf32,0,sizeof buf32); + } + + type_id = H5Tcreate (H5T_COMPOUND, sizeof(s_t)); + H5Tinsert(type_id, "a", HOFFSET(s_t, a), H5T_NATIVE_CHAR); + H5Tinsert(type_id, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); + write_dset(loc_id,2,dims2,"compound2D",type_id,buf32); + status = H5Tclose(type_id); + +/*------------------------------------------------------------------------- + * H5T_REFERENCE + *------------------------------------------------------------------------- + */ + /* Create references to dataset */ + if (dset_name) + { + for (i = 0; i < 3; i++) { + for (j = 0; j < 2; j++) { + status=H5Rcreate(&buf42[i][j],file_id,dset_name,H5R_OBJECT,-1); + } + } + write_dset(loc_id,2,dims2,"reference2D",H5T_STD_REF_OBJ,buf42); + } + +/*------------------------------------------------------------------------- + * H5T_ENUM + *------------------------------------------------------------------------- + */ + + for (i=0; i<3; i++) + for (j=0; j<2; j++) + { + if (make_diffs) buf452[i][j]=GREEN; else buf452[i][j]=RED; + } + + + type_id = H5Tcreate(H5T_ENUM, sizeof(e_t)); + H5Tenum_insert(type_id, "RED", (val = 0, &val)); + H5Tenum_insert(type_id, "GREEN", (val = 1, &val)); + write_dset(loc_id,2,dims2,"enum2D",type_id,0); + status = H5Tclose(type_id); + +/*------------------------------------------------------------------------- + * H5T_VLEN + *------------------------------------------------------------------------- + */ + +/* Allocate and initialize VL dataset to write */ + n=0; + for (i = 0; i < 3; i++) { + for (j = 0; j < 2; j++) { + int l; + buf52[i][j].p = malloc((i + 1) * sizeof(int)); + buf52[i][j].len = i + 1; + for (l = 0; l < i + 1; l++) + if (make_diffs)((int *)buf52[i][j].p)[l] = 0; + else ((int *)buf52[i][j].p)[l] = n++; + } + } + + space_id = H5Screate_simple(2,dims2,NULL); + type_id = H5Tvlen_create(H5T_NATIVE_INT); + dset_id = H5Dcreate(loc_id,"vlen2D",type_id,space_id,H5P_DEFAULT); + status = H5Dwrite(dset_id,type_id,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf52); + assert(status>=0); + status = H5Dvlen_reclaim(type_id,space_id,H5P_DEFAULT,buf52); + assert(status>=0); + status = H5Dclose(dset_id); + status = H5Tclose(type_id); + status = H5Sclose(space_id); + +/*------------------------------------------------------------------------- + * H5T_ARRAY + *------------------------------------------------------------------------- + */ + + if (make_diffs) + { + memset(buf62,0,sizeof buf62); + } + + + type_id = H5Tarray_create(H5T_NATIVE_INT,1,dimarray,NULL); + write_dset(loc_id,2,dims2,"array2D",type_id,buf62); + status = H5Tclose(type_id); + +/*------------------------------------------------------------------------- + * H5T_INTEGER, write a fill value + *------------------------------------------------------------------------- + */ + + + if (make_diffs) + { + memset(buf72,0,sizeof buf72); + memset(buf82,0,sizeof buf82); + } + + + plist_id = H5Pcreate(H5P_DATASET_CREATE); + status = H5Pset_fill_value(plist_id, H5T_NATIVE_INT, &fillvalue); + space_id = H5Screate_simple(2,dims2,NULL); + dset_id = H5Dcreate(loc_id,"integer2D",H5T_NATIVE_INT,space_id,plist_id); + status = H5Dwrite(dset_id,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf72); + status = H5Pclose(plist_id); + status = H5Dclose(dset_id); + status = H5Sclose(space_id); + +/*------------------------------------------------------------------------- + * H5T_FLOAT + *------------------------------------------------------------------------- + */ + + write_dset(loc_id,2,dims2,"float2D",H5T_NATIVE_FLOAT,buf82); + + +/*------------------------------------------------------------------------- + * 3D + *------------------------------------------------------------------------- + */ + +/*------------------------------------------------------------------------- + * H5T_STRING + *------------------------------------------------------------------------- + */ + + if (make_diffs) + { + memset(buf13,'z',sizeof buf13); + } + + type_id = H5Tcopy(H5T_C_S1); + status = H5Tset_size(type_id, 2); + write_dset(loc_id,3,dims3,"string3D",type_id,buf13); + status = H5Tclose(type_id); + +/*------------------------------------------------------------------------- + * H5T_BITFIELD + *------------------------------------------------------------------------- + */ + + + n=1; + for (i = 0; i < 4; i++) { + for (j = 0; j < 3; j++) { + for (k = 0; k < 2; k++) { + if (make_diffs) buf23[i][j][k]=0; + else buf23[i][j][k]=n++; + } + } + } + + + type_id = H5Tcopy(H5T_STD_B8LE); + write_dset(loc_id,3,dims3,"bitfield3D",type_id,buf23); + status = H5Tclose(type_id); + +/*------------------------------------------------------------------------- + * H5T_OPAQUE + *------------------------------------------------------------------------- + */ + type_id = H5Tcreate(H5T_OPAQUE, 1); + status = H5Tset_tag(type_id, "1-byte opaque type"); /* must set this */ + write_dset(loc_id,3,dims3,"opaque3D",type_id,buf23); + status = H5Tclose(type_id); + +/*------------------------------------------------------------------------- + * H5T_COMPOUND + *------------------------------------------------------------------------- + */ + + n=1; + for (i = 0; i < 4; i++) { + for (j = 0; j < 3; j++) { + for (k = 0; k < 2; k++) { + if (make_diffs) { + buf33[i][j][k].a=0; + buf33[i][j][k].b=0; + } + else { + buf33[i][j][k].a=n++; + buf33[i][j][k].b=n++; + } + } + } + } + + + type_id = H5Tcreate (H5T_COMPOUND, sizeof(s_t)); + H5Tinsert(type_id, "a", HOFFSET(s_t, a), H5T_NATIVE_CHAR); + H5Tinsert(type_id, "b", HOFFSET(s_t, b), H5T_NATIVE_DOUBLE); + write_dset(loc_id,3,dims3,"compound3D",type_id,buf33); + status = H5Tclose(type_id); + +/*------------------------------------------------------------------------- + * H5T_REFERENCE + *------------------------------------------------------------------------- + */ + /* Create references to dataset */ + if (dset_name) + { + for (i = 0; i < 4; i++) { + for (j = 0; j < 3; j++) { + for (k = 0; k < 2; k++) + status=H5Rcreate(&buf43[i][j][k],file_id,dset_name,H5R_OBJECT,-1); + } + } + write_dset(loc_id,3,dims3,"reference3D",H5T_STD_REF_OBJ,buf43); + } + +/*------------------------------------------------------------------------- + * H5T_ENUM + *------------------------------------------------------------------------- + */ + + + for (i = 0; i < 4; i++) { + for (j = 0; j < 3; j++) { + for (k = 0; k < 2; k++) { + if (make_diffs) buf453[i][j][k]=RED; else buf453[i][j][k]=GREEN; + } + } + } + + type_id = H5Tcreate(H5T_ENUM, sizeof(e_t)); + H5Tenum_insert(type_id, "RED", (val = 0, &val)); + H5Tenum_insert(type_id, "GREEN", (val = 1, &val)); + write_dset(loc_id,3,dims3,"enum3D",type_id,0); + status = H5Tclose(type_id); + +/*------------------------------------------------------------------------- + * H5T_VLEN + *------------------------------------------------------------------------- + */ + + /* Allocate and initialize VL dataset to write */ + n=0; + for (i = 0; i < 4; i++) { + for (j = 0; j < 3; j++) { + for (k = 0; k < 2; k++) { + int l; + buf53[i][j][k].p = malloc((i + 1) * sizeof(int)); + buf53[i][j][k].len = i + 1; + for (l = 0; l < i + 1; l++) + if (make_diffs)((int *)buf53[i][j][k].p)[l] = 0; + else ((int *)buf53[i][j][k].p)[l] = n++; + } + } + } + + space_id = H5Screate_simple(3,dims3,NULL); + type_id = H5Tvlen_create(H5T_NATIVE_INT); + dset_id = H5Dcreate(loc_id,"vlen3D",type_id,space_id,H5P_DEFAULT); + status = H5Dwrite(dset_id,type_id,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf53); + assert(status>=0); + status = H5Dvlen_reclaim(type_id,space_id,H5P_DEFAULT,buf53); + assert(status>=0); + status = H5Dclose(dset_id); + status = H5Tclose(type_id); + status = H5Sclose(space_id); + +/*------------------------------------------------------------------------- + * H5T_ARRAY + *------------------------------------------------------------------------- + */ + + + n=1; + for (i = 0; i < 24; i++) { + for (j = 0; j < (int)dimarray[0]; j++) { + if (make_diffs) buf63[i][j]=0; + else buf63[i][j]=n++; + } + } + + type_id = H5Tarray_create(H5T_NATIVE_INT,1,dimarray,NULL); + write_dset(loc_id,3,dims3,"array3D",type_id,buf63); + status = H5Tclose(type_id); + +/*------------------------------------------------------------------------- + * H5T_INTEGER and H5T_FLOAT + *------------------------------------------------------------------------- + */ + n=1; f=1; + for (i = 0; i < 4; i++) { + for (j = 0; j < 3; j++) { + for (k = 0; k < 2; k++) { + if (make_diffs) { + buf73[i][j][k]=0; + buf83[i][j][k]=0; + } + else { + buf73[i][j][k]=n++; + buf83[i][j][k]=f++; + } + } + } + } + write_dset(loc_id,3,dims3,"integer3D",H5T_NATIVE_INT,buf73); + write_dset(loc_id,3,dims3,"float3D",H5T_NATIVE_FLOAT,buf83); +} + + +/*------------------------------------------------------------------------- + * Check all HDF5 classes + * H5T_INTEGER, H5T_FLOAT + * H5T_TIME, H5T_STRING, H5T_BITFIELD, H5T_OPAQUE, H5T_COMPOUND, H5T_REFERENCE, + * H5T_ENUM, H5T_VLEN, H5T_ARRAY + *------------------------------------------------------------------------- + */ + + +int test_dsetall(const char *file, + int make_diffs /* flag to modify data buffers */) +{ + hid_t file_id; + hid_t dset_id; + hid_t group_id; + hid_t space_id; + hsize_t dims[1]={2}; + herr_t status; + int buf[2]={1,2}; + + if (make_diffs) + { + memset(buf,0,sizeof buf); + } + + /* Create a file */ + if ((file_id = H5Fcreate(file, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT))<0) + return -1; + + /* Create a 1D dataset */ + space_id = H5Screate_simple(1,dims,NULL); + dset_id = H5Dcreate(file_id,"dset",H5T_NATIVE_INT,space_id,H5P_DEFAULT); + status = H5Dwrite(dset_id,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf); + status = H5Sclose(space_id); + assert(status>=0); + + /* Create a group */ + group_id = H5Gcreate(file_id,"g1",0); + +/*------------------------------------------------------------------------- + * write a series of datasets on the group + *------------------------------------------------------------------------- + */ + + write_dset_in(group_id,"/dset",file_id,make_diffs); + + /* Close */ + status = H5Dclose(dset_id); + assert(status>=0); + status = H5Gclose(group_id); + assert(status>=0); + + /* Close file */ + status = H5Fclose(file_id); + assert(status>=0); + return status; +} + + + diff --git a/tools/h5diff/testh5diff_main.c b/tools/h5diff/testh5diff_main.c new file mode 100644 index 0000000..70a1ff1 --- /dev/null +++ b/tools/h5diff/testh5diff_main.c @@ -0,0 +1,36 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include "testh5diff.h" + + + + +int main(int UNUSED argc, const UNUSED char *argv[]) +{ + + test_basic ("file1.h5","file2.h5"); + test_types ("file3.h5",NULL); + test_native("file4.h5",NULL); + + /* generate 2 files with attribute differences */ + test_attr("file5.h5",0); + test_attr("file6.h5",1); + + /* generate 2 files with all datatype differences */ + test_dsetall("file7.h5",0); + test_dsetall("file8.h5",1); + return 0; +} + diff --git a/tools/h5diff/testh5diff_util.c b/tools/h5diff/testh5diff_util.c new file mode 100644 index 0000000..b0abf81 --- /dev/null +++ b/tools/h5diff/testh5diff_util.c @@ -0,0 +1,99 @@ +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Copyright by the Board of Trustees of the University of Illinois. * + * All rights reserved. * + * * + * This file is part of HDF5. The full HDF5 copyright notice, including * + * terms governing use, modification, and redistribution, is contained in * + * the files COPYING and Copyright.html. COPYING can be found at the root * + * of the source code distribution tree; Copyright.html can be found at the * + * root level of an installed copy of the electronic HDF5 document set and * + * is linked from the top-level documents page. It can also be found at * + * http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have * + * access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu. * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +#include "testh5diff.h" + + +/*------------------------------------------------------------------------- + * Function: write_attr + * + * Purpose: utility function to write an attribute in LOC_ID + * + * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * + * Date: November 12, 2003 + * + *------------------------------------------------------------------------- + */ + + +int write_attr(hid_t loc_id, + int rank, + hsize_t *dims, + const char *attr_name, + hid_t type_id, + void *buf) +{ + hid_t attr_id; + hid_t space_id; + herr_t status; + + /* Create a buf space */ + space_id = H5Screate_simple(rank,dims,NULL); + + /* Create the attribute */ + attr_id = H5Acreate(loc_id,attr_name,type_id,space_id,H5P_DEFAULT); + + /* Write the buf */ + if ( buf ) + status = H5Awrite(attr_id,type_id,buf); + + /* Close */ + status = H5Aclose(attr_id); + status = H5Sclose(space_id); + return status; +} + +/*------------------------------------------------------------------------- + * Function: write_dset + * + * Purpose: utility function to create and write a dataset in LOC_ID + * + * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * + * Date: November 12, 2003 + * + *------------------------------------------------------------------------- + */ + + +int write_dset( hid_t loc_id, + int rank, + hsize_t *dims, + const char *dset_name, + hid_t type_id, + void *buf ) +{ + hid_t dset_id; + hid_t space_id; + herr_t status; + + /* Create a buf space */ + space_id = H5Screate_simple(rank,dims,NULL); + + /* Create a dataset */ + dset_id = H5Dcreate(loc_id,dset_name,type_id,space_id,H5P_DEFAULT); + + /* Write the buf */ + if ( buf ) + status = H5Dwrite(dset_id,type_id,H5S_ALL,H5S_ALL,H5P_DEFAULT,buf); + + /* Close */ + status = H5Dclose(dset_id); + status = H5Sclose(space_id); + + return status; + +} + diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index a02af47..5b38968 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -14,6 +14,7 @@ #include "h5diff.h" +#include "H5private.h" #include #include @@ -316,11 +317,10 @@ int diff_compare( hid_t file1_id, /* objects are not the same type */ if ( info1[i].type != info2[j].type && options->verbose) { - printf("Comparison not supported\n"); - printf("<%s> is of type %s and <%s> is of type %s\n", + printf("Comparison not possible: <%s> is of type %s and <%s> is of type %s\n", obj1_name, get_type(info1[i].type), obj2_name, get_type(info2[j].type) ); - return 0; + return 1; } nfound=diff( file1_id, obj1_name, file2_id, obj2_name, options, info1[i].type ); @@ -333,6 +333,11 @@ int diff_compare( hid_t file1_id, * Function: diff * * Purpose: switch between types and choose the diff function + * TYPE is either + * H5G_LINK Object is a symbolic link + * H5G_GROUP Object is a group + * H5G_DATASET Object is a dataset + * H5G_TYPE Object is a named data type * * Return: Number of differences found * @@ -340,42 +345,163 @@ int diff_compare( hid_t file1_id, * * Date: May 9, 2003 * - * Comments: - * - * Modifications: - * *------------------------------------------------------------------------- */ -int diff( hid_t file1_id, - const char *obj1_name, - hid_t file2_id, - const char *obj2_name, +int diff( hid_t file1_id, + const char *path1, + hid_t file2_id, + const char *path2, diff_opt_t *options, - int type ) + H5G_obj_t type ) { - int nfound=0; + hid_t type1_id; + hid_t type2_id; + hid_t grp1_id; + hid_t grp2_id; + int ret; + H5G_stat_t sb1; + H5G_stat_t sb2; + char *buf1=NULL; + char *buf2=NULL; + int nfound=-1; switch ( type ) { +/*------------------------------------------------------------------------- + * H5G_DATASET + *------------------------------------------------------------------------- + */ case H5G_DATASET: - nfound=diff_dataset(file1_id,file2_id,obj1_name,obj2_name,options); + if (options->verbose) + printf( "Dataset: <%s> and <%s>\n",path1,path2); + nfound=diff_dataset(file1_id,file2_id,path1,path2,options); + break; + +/*------------------------------------------------------------------------- + * H5G_TYPE + *------------------------------------------------------------------------- + */ + case H5G_TYPE: + if (options->verbose) + printf( "Datatype: <%s> and <%s>\n",path1,path2); + + if ((type1_id = H5Topen(file1_id, path1))<0) + goto out; + if ((type2_id = H5Topen(file2_id, path2))<0) + goto out; + + if ((ret = H5Tequal(type1_id,type2_id))<0) + goto out; + + /* if H5Tequal is > 0 then the datatypes refer to the same datatype */ + nfound = (ret>0) ? 0 : 1; + + /* compare attributes */ + diff_attr(type1_id,type2_id,path1,path2,options); + + if ( H5Tclose(type1_id)<0) + goto out; + if ( H5Tclose(type2_id)<0) + goto out; + + break; + +/*------------------------------------------------------------------------- + * H5G_GROUP + *------------------------------------------------------------------------- + */ + case H5G_GROUP: + if (options->verbose) + printf( "Group: <%s> and <%s>\n",path1,path2); + + if ((grp1_id = H5Gopen(file1_id, path1))<0) + goto out; + if ((grp2_id = H5Gopen(file2_id, path2))<0) + goto out; + + ret = HDstrcmp(path1,path2); + + /* if "path1" != "path2" then the groups are "different" */ + nfound = (ret!=0) ? 1 : 0; + + /* compare attributes */ + diff_attr(grp1_id,grp2_id,path1,path2,options); + + if ( H5Gclose(grp1_id)<0) + goto out; + if ( H5Gclose(grp2_id)<0) + goto out; + + break; + + +/*------------------------------------------------------------------------- + * H5G_LINK + *------------------------------------------------------------------------- + */ + case H5G_LINK: + if (options->verbose) + printf( "Link: <%s> and <%s>\n",path1,path2); + + if (H5Gget_objinfo(file1_id,path1,FALSE,&sb1)<0) + goto out; + if (H5Gget_objinfo(file1_id,path1,FALSE,&sb2)<0) + goto out; + + buf1 = malloc(sb1.linklen); + buf2 = malloc(sb2.linklen); + + if (H5Gget_linkval(file1_id,path1,sb1.linklen,buf1)<0) + goto out; + if (H5Gget_linkval(file2_id,path2,sb1.linklen,buf2)<0) + goto out; + + ret = HDstrcmp(buf1,buf2); + + /* if "buf1" != "buf2" then the links are "different" */ + nfound = (ret!=0) ? 1 : 0; + + if (buf1) { + free(buf1); + buf1=NULL; + } + + if (buf2) { + free(buf2); + buf2=NULL; + } + break; + default: + nfound=0; if (options->verbose) { - printf("Comparison not supported\n"); - printf("<%s> is of type %s and <%s> is of type %s\n", - obj1_name, get_type(type), - obj2_name, get_type(type) ); + printf("Comparison not supported: <%s> and <%s> are of type %s\n", + path1, path2, get_type(type) ); } break; } -#if 0 - if (options->verbose) - printf("\n"); -#endif + + out: + + /* close */ + /* disable error reporting */ + H5E_BEGIN_TRY { + H5Tclose(type1_id); + H5Tclose(type2_id); + H5Gclose(grp1_id); + H5Tclose(grp2_id); + /* enable error reporting */ + } H5E_END_TRY; + + if (buf1) + free(buf1); + if (buf2) + free(buf2); + return nfound; } diff --git a/tools/lib/h5diff.h b/tools/lib/h5diff.h index 10e190d..0c52f76 100644 --- a/tools/lib/h5diff.h +++ b/tools/lib/h5diff.h @@ -29,8 +29,10 @@ *------------------------------------------------------------------------- */ -#define FFORMAT "%-15.10g %-15.10g %-15.10g\n" +#define FFORMAT "%-15f %-15f %-15f\n" #define IFORMAT "%-15d %-15d %-15d\n" +#define CFORMAT "%-16c %-17c\n" +#define SFORMAT "%-16s %-17s\n" #define UIFORMAT "%-15u %-15u %-15u\n" #define LIFORMAT "%-15ld %-15ld %-15ld\n" #define ULIFORMAT "%-15lu %-15lu %-15lu\n" @@ -57,7 +59,6 @@ typedef struct { int n; /* count */ int count; /* count value */ int verbose; /* print information */ - int attr; /* compare attributes */ } diff_opt_t; @@ -96,12 +97,18 @@ int diff_dataset( hid_t file1_id, const char *obj2_name, diff_opt_t *options ); -int diff( hid_t file1_id, - const char *obj1_name, - hid_t file2_id, - const char *obj2_name, +int diff_datasetid( hid_t dset1_id, + hid_t dset2_id, + const char *obj1_name, + const char *obj2_name, + diff_opt_t *options ); + +int diff( hid_t file1_id, + const char *path1, + hid_t file2_id, + const char *path2, diff_opt_t *options, - int type ); + H5G_obj_t type ); int diff_compare( hid_t file1_id, const char *file1_name, @@ -123,15 +130,17 @@ int diff_match( hid_t file1_id, trav_info_t *info2, diff_opt_t *options ); -int diff_array( void *buf1, - void *buf2, - hsize_t tot_cnt, +int diff_array( void *_mem1, + void *_mem2, + hsize_t nelmts, int rank, hsize_t *dims, diff_opt_t *options, - const char *obj1, - const char *obj2, - hid_t m_type ); + const char *name1, + const char *name2, + hid_t m_type, + hid_t container1_id, + hid_t container2_id); /* dataset where the reference came from*/ int diff_can_type( hid_t f_type1, /* file data type */ @@ -147,8 +156,10 @@ int diff_can_type( hid_t f_type1, /* file data type */ diff_opt_t *options ); -int diff_attr(hid_t loc1_id, - hid_t loc2_id, +int diff_attr(hid_t loc1_id, + hid_t loc2_id, + const char *path1, + const char *path2, diff_opt_t *options ); @@ -158,15 +169,20 @@ int diff_attr(hid_t loc1_id, *------------------------------------------------------------------------- */ -int diff_can( hid_t type_id ); void print_type(hid_t type); const char* diff_basename(const char *name); const char* get_type(int type); const char* get_class(H5T_class_t tclass); const char* get_sign(H5T_sign_t sign); void print_dims( int r, hsize_t *d ); -void print_pos( int *ph, int p, unsigned int curr_pos, int *acc, - int *pos, int rank, const char *obj1, const char *obj2 ); +void print_pos( int *ph, + int per, + hsize_t curr_pos, + hsize_t *acc, + hsize_t *pos, + int rank, + const char *obj1, + const char *obj2 ); #if defined (H5DIFF_DEBUG) void print_sizes( const char *obj1, const char *obj2, diff --git a/tools/lib/h5diff_array.c b/tools/lib/h5diff_array.c index 0a2eb41..38f5ba9 100644 --- a/tools/lib/h5diff_array.c +++ b/tools/lib/h5diff_array.c @@ -18,57 +18,65 @@ #include #include + static -int diff_array_mem( void *_mem1, - void *_mem2, - hid_t m_type, - unsigned i, - int rank, - int *acc, - int *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2); +int diff_datum( void *_mem1, + void *_mem2, + hid_t m_type, + hsize_t i, + int rank, + hsize_t *acc, + hsize_t *pos, + diff_opt_t *options, + const char *obj1, + const char *obj2, + hid_t container1_id, + hid_t container2_id, + int *ph); static int diff_native_uchar(unsigned char *mem1, unsigned char *mem2, size_t type_size, - unsigned i, + hsize_t i, int rank, - int *acc, - int *pos, + hsize_t *acc, + hsize_t *pos, diff_opt_t *options, const char *obj1, const char *obj2, - int ph); + int *ph); + +static +int diff_char(unsigned char *mem1, + unsigned char *mem2, + size_t type_size, + hsize_t i, + int rank, + hsize_t *acc, + hsize_t *pos, + diff_opt_t *options, + const char *obj1, + const char *obj2, + int *ph); + +static +hbool_t is_zero(const void *_mem, size_t size); +static +void close_obj(H5G_obj_t obj_type, hid_t obj_id); /*------------------------------------------------------------------------- * Function: diff_array * - * Purpose: compare array; - * currenttly only the NATIVE types below are supported + * Purpose: compare two memory buffers; * - * Return: number of differences found + * Return: number of differences found, -1 on error * * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu * - * Date: May 30, 2003 - * - * Modifications: October 30, 2003 - * Added support for H5T_COMPOUND types; to handle compounds a recursive - * function is called. because of this , the data is compared datum by datum - * instead of the previous cycle that compared all the array the native - * types - * Added support for - * H5T_STRING - * H5T_BITFIELD - * H5T_OPAQUE - * H5T_ENUM - * H5T_VLEN - * H5T_ARRAY - * + * Date: November 12, 2003 + * *------------------------------------------------------------------------- */ @@ -80,7 +88,9 @@ int diff_array( void *_mem1, diff_opt_t *options, const char *name1, const char *name2, - hid_t m_type ) + hid_t m_type, + hid_t container1_id, + hid_t container2_id) /* dataset where the reference came from*/ { int nfound=0; /* number of differences found */ size_t size; /* size of datum */ @@ -88,23 +98,27 @@ int diff_array( void *_mem1, unsigned char *mem2 = (unsigned char*)_mem2; unsigned char *tmp1; unsigned char *tmp2; - int acc[32]; /* accumulator and matrix position */ - int pos[32]; - unsigned i; + hsize_t acc[32]; /* accumulator position */ + hsize_t pos[32]; /* matrix position */ + int ph=1; /* print header */ + hsize_t i; int j; + acc[rank-1]=1; for(j=(rank-2); j>=0; j--) { acc[j]=acc[j+1]*(int)dims[j+1]; } + for ( j = 0; j < rank; j++) + pos[j]=0; if(H5Tis_variable_str(m_type)) { tmp1 = ((unsigned char**)mem1)[0]; tmp2 = ((unsigned char**)mem2)[0]; - nfound+=diff_array_mem( + nfound+=diff_datum( tmp1, tmp2, m_type, @@ -114,7 +128,10 @@ int diff_array( void *_mem1, pos, options, name1, - name2); + name2, + container1_id, + container2_id, + &ph); } else @@ -126,7 +143,7 @@ int diff_array( void *_mem1, for ( i = 0; i < nelmts; i++) { - nfound+=diff_array_mem( + nfound+=diff_datum( mem1 + i * size, mem2 + i * size, /* offset */ m_type, @@ -136,7 +153,10 @@ int diff_array( void *_mem1, pos, options, name1, - name2); + name2, + container1_id, + container2_id, + &ph); if (options->n && nfound>=options->count) return nfound; } @@ -148,30 +168,57 @@ int diff_array( void *_mem1, /*------------------------------------------------------------------------- - * Function: diff_array_mem + * Function: diff_datum * * Purpose: Compare the values pointed to in _MEM1 and _MEM2 of type M_TYPE * - * Return: number of differences found + * Return: number of differences found, -1 on error * * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu * * Date: October 29, 2003 * + * The compare of the 2 buffers read from the files is made datum by datum. + * + * H5T_INTEGER and H5T_FLOAT + * Copy the buffer into a compatible local datum and do a numerical + * compare of this datum + * H5T_COMPOUND + * Recursively call this function for each member + * H5T_ARRAY + * Recursively call this function for each element  + * H5T_VLEN + * Recursively call this function for each element  + * H5T_STRING + * compare byte by byte in a cycle from 0 to type_size. this type_size is the + * value obtained by the get_size function but it is the string lenght for + * variable sized strings + * H5T_OPAQUE + * compare byte by byte in a cycle from 0 to type_size + * H5T_BITFIELD + * compare byte by byte in a cycle from 0 to type_size + * H5T_ENUM + * for each pair of elements being compared, both bit patterns are converted to + * their corresponding enumeration constant and a string comparison is made + * H5T_REFERENCE + * Dereference the object and compare the type (basic object type). *------------------------------------------------------------------------- */ static -int diff_array_mem( void *_mem1, - void *_mem2, - hid_t m_type, - unsigned i, - int rank, - int *acc, - int *pos, - diff_opt_t *options, - const char *obj1, - const char *obj2) +int diff_datum( void *_mem1, + void *_mem2, + hid_t m_type, + hsize_t i, + int rank, + hsize_t *acc, + hsize_t *pos, + diff_opt_t *options, + const char *obj1, + const char *obj2, + hid_t container1_id, + hid_t container2_id, /*where the reference came from*/ + int *ph) /*print header */ { char fmt_llong[255], fmt_ullong[255]; char fmt_llongp[255], fmt_ullongp[255]; @@ -187,8 +234,15 @@ int diff_array_mem( void *_mem1, hsize_t nelmts; hsize_t ndims; size_t size; - static int ph=1; /* print header */ - int nfound=0; /* differences found */ + int iszero1; + int iszero2; + H5G_obj_t obj1_type; + H5G_obj_t obj2_type; + hid_t obj1_id; + hid_t obj2_id; + H5G_stat_t sb1; + H5G_stat_t sb2; + int nfound=0; /* differences found */ /* Build default formats for long long types */ sprintf(fmt_llong, "%%%sd %%%sd %%%sd\n", @@ -200,11 +254,8 @@ int diff_array_mem( void *_mem1, sprintf(fmt_ullongp, "%%%su %%%su %%%su %%%su\n", H5_PRINTF_LL_WIDTH, H5_PRINTF_LL_WIDTH, H5_PRINTF_LL_WIDTH, H5_PRINTF_LL_WIDTH); - - /* Get the size. */ type_size = H5Tget_size( m_type ); - switch (H5Tget_class(m_type)) { default: @@ -213,9 +264,7 @@ int diff_array_mem( void *_mem1, case H5T_TIME: assert(0); break; - case H5T_REFERENCE: - assert(0); - break; + /*------------------------------------------------------------------------- * H5T_COMPOUND *------------------------------------------------------------------------- @@ -226,7 +275,7 @@ int diff_array_mem( void *_mem1, { offset = H5Tget_member_offset(m_type, j); memb_type = H5Tget_member_type(m_type, j); - nfound+=diff_array_mem( + nfound+=diff_datum( mem1+offset, mem2+offset, memb_type, @@ -236,7 +285,10 @@ int diff_array_mem( void *_mem1, pos, options, obj1, - obj2); + obj2, + container1_id, + container2_id, + ph); H5Tclose(memb_type); } break; @@ -248,16 +300,16 @@ int diff_array_mem( void *_mem1, case H5T_STRING: if(H5Tis_variable_str(m_type)) - type_size = HDstrlen(mem1); + type_size = HDstrlen((char*)mem1); else type_size = H5Tget_size(m_type); for (u=0; u= 0) && - (H5Tenum_nameof(m_type, mem2, enum_name2, sizeof enum_name2) >= 0)) - { - if (HDstrcmp(enum_name1,enum_name2)!=0) - nfound=1; - } - else - { - for (u=0; u= 0) && + (H5Tenum_nameof(m_type, mem2, enum_name2, sizeof enum_name2) >= 0)) + { + if (HDstrcmp(enum_name1,enum_name2)!=0) + { + nfound=1; + if ( options->r==0 ) + { + print_pos(ph,0,i,acc,pos,rank,obj1,obj2); + printf(SPACES); + printf(SFORMAT,enum_name1,enum_name2); + } + } + } + else + { + for (u=0; ulen; for (j = 0; j < nelmts; j++) - nfound+=diff_array_mem( + nfound+=diff_datum( ((char *)(((hvl_t *)mem1)->p)) + j * size, ((char *)(((hvl_t *)mem2)->p)) + j * size, /* offset */ memb_type, - j, + i, /* index position */ rank, acc, pos, options, obj1, - obj2); + obj2, + container1_id, + container2_id, + ph); H5Tclose(memb_type); break; + + + case H5T_REFERENCE: + + iszero1=is_zero(_mem1, H5Tget_size(m_type)); + iszero2=is_zero(_mem2, H5Tget_size(m_type)); + if (iszero1==1 && iszero2==1) + return 0; + else if (iszero1!=iszero2) + return 1; + else + { + +/*------------------------------------------------------------------------- + * H5T_STD_REF_DSETREG + * Dataset region reference + *------------------------------------------------------------------------- + */ + + if (H5Tequal(m_type, H5T_STD_REF_DSETREG)) + { + if ((obj1_id = H5Rdereference(container1_id, H5R_DATASET_REGION, _mem1))<0) + return -1; + if ((obj2_id = H5Rdereference(container2_id, H5R_DATASET_REGION, _mem2))<0) + return -1; + if (H5Gget_objinfo(obj1_id, ".", FALSE, &sb1)<0) + return -1; + if (H5Gget_objinfo(obj2_id, ".", FALSE, &sb2)<0) + return -1; + + /* compare OID */ + if (sb1.objno!=sb2.objno) + { + printf("Different OIDs in reference: <%s, %d> and <%s, %d>", + obj1, sb1.objno, obj2, sb2.objno); + nfound = 1; + } + close_obj(H5G_DATASET,obj1_id); + close_obj(H5G_DATASET,obj2_id); + + }/*dataset reference*/ + + +/*------------------------------------------------------------------------- + * H5T_STD_REF_OBJ + * Object references. get the type and OID of the referenced object + *------------------------------------------------------------------------- + */ + else if (H5Tequal(m_type, H5T_STD_REF_OBJ)) + { + + if ((obj1_type = H5Rget_obj_type(container1_id, H5R_OBJECT, _mem1))<0) + return -1; + if ((obj2_type = H5Rget_obj_type(container2_id, H5R_OBJECT, _mem2))<0) + return -1; + + /* check object type */ + if (obj1_type!=obj2_type) + { + printf("Different object types referenced: <%s> and <%s>", obj1, obj2); + return 1; + } + + if ((obj1_id = H5Rdereference(container1_id, H5R_OBJECT, _mem1))<0) + return -1; + if ((obj2_id = H5Rdereference(container2_id, H5R_OBJECT, _mem2))<0) + return -1; + + + /*deep compare */ + switch (obj1_type) { + case H5G_DATASET: + nfound=diff_datasetid(obj1_id, + obj2_id, + NULL, + NULL, + options); + break; + default: + printf("Warning: Comparison not possible of object types referenced: <%s> and <%s>", + obj1, obj2); + break; + } + + close_obj(obj1_type,obj1_id); + close_obj(obj2_type,obj2_id); + + }/*object reference*/ + + }/*is zero*/ + + + break; + + case H5T_INTEGER: @@ -437,7 +604,7 @@ int diff_array_mem( void *_mem1, { if ( options->r==0 ) { - print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); + print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); printf(IFORMAT,temp1_char,temp2_char,abs(temp1_char-temp2_char)); } @@ -451,7 +618,7 @@ int diff_array_mem( void *_mem1, { if ( options->r==0 ) { - print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); + print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); printf(IPFORMAT,temp1_char,temp2_char,abs(temp1_char-temp2_char), abs(1-temp2_char/temp1_char)); @@ -467,7 +634,7 @@ int diff_array_mem( void *_mem1, { if ( options->r==0 ) { - print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); + print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); printf(IPFORMAT,temp1_char,temp2_char,abs(temp1_char-temp2_char), abs(1-temp2_char/temp1_char)); @@ -479,7 +646,7 @@ int diff_array_mem( void *_mem1, { if ( options->r==0 ) { - print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); + print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); printf(IFORMAT,temp1_char,temp2_char,abs(temp1_char-temp2_char)); } @@ -507,7 +674,7 @@ int diff_array_mem( void *_mem1, { if ( options->r==0 ) { - print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); + print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); printf(IFORMAT,temp1_uchar,temp2_uchar,abs(temp1_uchar-temp2_uchar)); } @@ -521,7 +688,7 @@ int diff_array_mem( void *_mem1, { if ( options->r==0 ) { - print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); + print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); printf(IPFORMAT,temp1_uchar,temp2_uchar,abs(temp1_uchar-temp2_uchar), abs(1-temp2_uchar/temp1_uchar)); @@ -537,7 +704,7 @@ int diff_array_mem( void *_mem1, { if ( options->r==0 ) { - print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); + print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); printf(IPFORMAT,temp1_uchar,temp2_uchar,abs(temp1_uchar-temp2_uchar), abs(1-temp2_uchar/temp1_uchar)); @@ -549,7 +716,7 @@ int diff_array_mem( void *_mem1, { if ( options->r==0 ) { - print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); + print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); printf(IFORMAT,temp1_uchar,temp2_uchar,abs(temp1_uchar-temp2_uchar)); } @@ -579,7 +746,7 @@ int diff_array_mem( void *_mem1, { if ( options->r==0 ) { - print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); + print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); printf(IFORMAT,temp1_short,temp2_short,abs(temp1_short-temp2_short)); } @@ -593,7 +760,7 @@ int diff_array_mem( void *_mem1, { if ( options->r==0 ) { - print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); + print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); printf(IPFORMAT,temp1_short,temp2_short,abs(temp1_short-temp2_short), abs(1-temp2_short/temp1_short)); @@ -609,7 +776,7 @@ int diff_array_mem( void *_mem1, { if ( options->r==0 ) { - print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); + print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); printf(IPFORMAT,temp1_short,temp2_short,abs(temp1_short-temp2_short), abs(1-temp2_short/temp1_short)); @@ -621,7 +788,7 @@ int diff_array_mem( void *_mem1, { if ( options->r==0 ) { - print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); + print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); printf(IFORMAT,temp1_short,temp2_short,abs(temp1_short-temp2_short)); } @@ -652,7 +819,7 @@ int diff_array_mem( void *_mem1, if ( options->r==0 ) { - print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); + print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); printf(IFORMAT,temp1_ushort,temp2_ushort,abs(temp1_ushort-temp2_ushort)); } @@ -667,7 +834,7 @@ int diff_array_mem( void *_mem1, if ( options->r==0 ) { - print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); + print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); printf(IPFORMAT,temp1_ushort,temp2_ushort,abs(temp1_ushort-temp2_ushort), abs(1-temp2_ushort/temp1_ushort)); @@ -684,7 +851,7 @@ int diff_array_mem( void *_mem1, if ( options->r==0 ) { - print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); + print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); printf(IPFORMAT,temp1_ushort,temp2_ushort,abs(temp1_ushort-temp2_ushort), abs(1-temp2_ushort/temp1_ushort)); @@ -697,7 +864,7 @@ int diff_array_mem( void *_mem1, if ( options->r==0 ) { - print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); + print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); printf(IFORMAT,temp1_ushort,temp2_ushort,abs(temp1_ushort-temp2_ushort)); } @@ -729,7 +896,7 @@ int diff_array_mem( void *_mem1, if ( options->r==0 ) { - print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); + print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); printf(IFORMAT,temp1_int,temp2_int,abs(temp1_int-temp2_int)); } @@ -744,7 +911,7 @@ int diff_array_mem( void *_mem1, if ( options->r==0 ) { - print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); + print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); printf(IPFORMAT,temp1_int,temp2_int,abs(temp1_int-temp2_int), abs(1-temp2_int/temp1_int)); @@ -761,7 +928,7 @@ int diff_array_mem( void *_mem1, if ( options->r==0 ) { - print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); + print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); printf(IPFORMAT,temp1_int,temp2_int,abs(temp1_int-temp2_int), abs(1-temp2_int/temp1_int)); @@ -774,7 +941,7 @@ int diff_array_mem( void *_mem1, if ( options->r==0 ) { - print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); + print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); printf(IFORMAT,temp1_int,temp2_int,abs(temp1_int-temp2_int)); } @@ -806,7 +973,7 @@ int diff_array_mem( void *_mem1, if ( options->r==0 ) { - print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); + print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); printf(UIFORMAT,temp1_uint,temp2_uint,abs((int)(temp1_uint-temp2_uint))); } @@ -821,7 +988,7 @@ int diff_array_mem( void *_mem1, if ( options->r==0 ) { - print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); + print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); printf(UIPFORMAT,temp1_uint,temp2_uint,abs((int)(temp1_uint-temp2_uint)), abs((int)(1-temp2_uint/temp1_uint))); @@ -838,7 +1005,7 @@ int diff_array_mem( void *_mem1, if ( options->r==0 ) { - print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); + print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); printf(UIPFORMAT,temp1_uint,temp2_uint,abs((int)(temp1_uint-temp2_uint)), abs((int)(1-temp2_uint/temp1_uint))); @@ -851,7 +1018,7 @@ int diff_array_mem( void *_mem1, if ( options->r==0 ) { - print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); + print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); printf(UIFORMAT,temp1_uint,temp2_uint,abs((int)(temp1_uint-temp2_uint))); } @@ -884,7 +1051,7 @@ int diff_array_mem( void *_mem1, if ( options->r==0 ) { - print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); + print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); printf(LIFORMAT,temp1_long,temp2_long,labs(temp1_long-temp2_long)); } @@ -899,7 +1066,7 @@ int diff_array_mem( void *_mem1, if ( options->r==0 ) { - print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); + print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); printf(LPIFORMAT,temp1_long,temp2_long,labs(temp1_long-temp2_long), labs(1-temp2_long/temp1_long)); @@ -916,7 +1083,7 @@ int diff_array_mem( void *_mem1, if ( options->r==0 ) { - print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); + print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); printf(LPIFORMAT,temp1_long,temp2_long,labs(temp1_long-temp2_long), labs(1-temp2_long/temp1_long)); @@ -929,7 +1096,7 @@ int diff_array_mem( void *_mem1, if ( options->r==0 ) { - print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); + print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); printf(LIFORMAT,temp1_long,temp2_long,labs(temp1_long-temp2_long)); } @@ -961,7 +1128,7 @@ int diff_array_mem( void *_mem1, if ( options->r==0 ) { - print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); + print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); printf(ULIFORMAT,temp1_ulong,temp2_ulong,labs((long)(temp1_ulong-temp2_ulong))); } @@ -976,7 +1143,7 @@ int diff_array_mem( void *_mem1, if ( options->r==0 ) { - print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); + print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); printf(ULPIFORMAT,temp1_ulong,temp2_ulong,labs((long)(temp1_ulong-temp2_ulong)), labs((long)(1-temp2_ulong/temp1_ulong))); @@ -993,7 +1160,7 @@ int diff_array_mem( void *_mem1, if ( options->r==0 ) { - print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); + print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); printf(ULPIFORMAT,temp1_ulong,temp2_ulong,labs((long)(temp1_ulong-temp2_ulong)), labs((long)(1-temp2_ulong/temp1_ulong))); @@ -1006,7 +1173,7 @@ int diff_array_mem( void *_mem1, if ( options->r==0 ) { - print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); + print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); printf(ULIFORMAT,temp1_ulong,temp2_ulong,labs((long)(temp1_ulong-temp2_ulong))); } @@ -1037,7 +1204,7 @@ int diff_array_mem( void *_mem1, if ( options->r==0 ) { - print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); + print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); printf(fmt_llong,temp1_llong,temp2_llong,(long_long)labs((long)(temp1_llong-temp2_llong))); } @@ -1052,7 +1219,7 @@ int diff_array_mem( void *_mem1, if ( options->r==0 ) { - print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); + print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); printf(fmt_llongp,temp1_llong,temp2_llong,(long_long)labs((long)(temp1_llong-temp2_llong)), (long_long)labs((long)(1-temp2_llong/temp1_llong))); @@ -1069,7 +1236,7 @@ int diff_array_mem( void *_mem1, if ( options->r==0 ) { - print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); + print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); printf(fmt_llongp,temp1_llong,temp2_llong,(long_long)labs((long)(temp1_llong-temp2_llong)), (long_long)labs((long)(1-temp2_llong/temp1_llong))); @@ -1082,7 +1249,7 @@ int diff_array_mem( void *_mem1, if ( options->r==0 ) { - print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); + print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); printf(fmt_llong,temp1_llong,temp2_llong,(long_long)labs((long)(temp1_llong-temp2_llong))); } @@ -1113,7 +1280,7 @@ int diff_array_mem( void *_mem1, if ( options->r==0 ) { - print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); + print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); printf(fmt_ullong,temp1_ullong,temp2_ullong, (unsigned long_long)labs((long)(temp1_ullong-temp2_ullong))); @@ -1129,7 +1296,7 @@ int diff_array_mem( void *_mem1, if ( options->r==0 ) { - print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); + print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); printf(fmt_ullongp,temp1_ullong,temp2_ullong, (unsigned long_long)labs((long)(temp1_ullong-temp2_ullong)), @@ -1147,7 +1314,7 @@ int diff_array_mem( void *_mem1, if ( options->r==0 ) { - print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); + print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); printf(fmt_ullongp,temp1_ullong,temp2_ullong, (unsigned long_long)labs((long)(temp1_ullong-temp2_ullong)), @@ -1161,7 +1328,7 @@ int diff_array_mem( void *_mem1, if ( options->r==0 ) { - print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); + print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); printf(fmt_ullong,temp1_ullong,temp2_ullong, (unsigned long_long)labs((long)(temp1_ullong-temp2_ullong))); @@ -1198,7 +1365,7 @@ int diff_array_mem( void *_mem1, if ( options->r==0 ) { - print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); + print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); printf(FFORMAT,temp1_float,temp2_float,fabs(temp1_float-temp2_float)); } @@ -1213,7 +1380,7 @@ int diff_array_mem( void *_mem1, if ( options->r==0 ) { - print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); + print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); printf(FPFORMAT,temp1_float,temp2_float,fabs(temp1_float-temp2_float), fabs(1-temp2_float/temp1_float)); @@ -1230,7 +1397,7 @@ int diff_array_mem( void *_mem1, if ( options->r==0 ) { - print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); + print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); printf(FPFORMAT,temp1_float,temp2_float,fabs(temp1_float-temp2_float), fabs(1-temp2_float/temp1_float)); @@ -1243,7 +1410,7 @@ int diff_array_mem( void *_mem1, if ( options->r==0 ) { - print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); + print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); printf(FFORMAT,temp1_float,temp2_float,fabs(temp1_float-temp2_float)); } @@ -1273,7 +1440,7 @@ int diff_array_mem( void *_mem1, if ( options->r==0 ) { - print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); + print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); printf(FFORMAT,temp1_double,temp2_double,fabs(temp1_double-temp2_double)); } @@ -1288,7 +1455,7 @@ int diff_array_mem( void *_mem1, if ( options->r==0 ) { - print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); + print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); printf(FPFORMAT,temp1_double,temp2_double,fabs(temp1_double-temp2_double), fabs(1-temp2_double/temp1_double)); @@ -1305,7 +1472,7 @@ int diff_array_mem( void *_mem1, if ( options->r==0 ) { - print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); + print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); printf(FPFORMAT,temp1_double,temp2_double,fabs(temp1_double-temp2_double), fabs(1-temp2_double/temp1_double)); @@ -1318,7 +1485,7 @@ int diff_array_mem( void *_mem1, if ( options->r==0 ) { - print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); + print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); printf(FFORMAT,temp1_double,temp2_double,fabs(temp1_double-temp2_double)); } @@ -1341,7 +1508,7 @@ int diff_array_mem( void *_mem1, /*------------------------------------------------------------------------- * Function: diff_native_uchar * - * Purpose: do a byte-by-byte comparison + * Purpose: do a byte-by-byte comparison and print in numerical format * * Return: number of differences found * @@ -1352,25 +1519,23 @@ int diff_array_mem( void *_mem1, *------------------------------------------------------------------------- */ - static int diff_native_uchar(unsigned char *mem1, unsigned char *mem2, size_t type_size, - unsigned i, + hsize_t i, int rank, - int *acc, - int *pos, + hsize_t *acc, + hsize_t *pos, diff_opt_t *options, const char *obj1, const char *obj2, - int ph) + int *ph) { int nfound=0; /* differences found */ unsigned char temp1_uchar; unsigned char temp2_uchar; - memcpy(&temp1_uchar, mem1, sizeof(unsigned char)); memcpy(&temp2_uchar, mem2, sizeof(unsigned char)); @@ -1381,7 +1546,7 @@ int diff_native_uchar(unsigned char *mem1, { if ( options->r==0 ) { - print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); + print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); printf(IFORMAT,temp1_uchar,temp2_uchar,abs(temp1_uchar-temp2_uchar)); } @@ -1395,7 +1560,7 @@ int diff_native_uchar(unsigned char *mem1, { if ( options->r==0 ) { - print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); + print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); printf(IPFORMAT,temp1_uchar,temp2_uchar,abs(temp1_uchar-temp2_uchar), abs(1-temp2_uchar/temp1_uchar)); @@ -1411,7 +1576,7 @@ int diff_native_uchar(unsigned char *mem1, { if ( options->r==0 ) { - print_pos(&ph,1,i,acc,pos,rank,obj1,obj2); + print_pos(ph,1,i,acc,pos,rank,obj1,obj2); printf(SPACES); printf(IPFORMAT,temp1_uchar,temp2_uchar,abs(temp1_uchar-temp2_uchar), abs(1-temp2_uchar/temp1_uchar)); @@ -1423,7 +1588,7 @@ int diff_native_uchar(unsigned char *mem1, { if ( options->r==0 ) { - print_pos(&ph,0,i,acc,pos,rank,obj1,obj2); + print_pos(ph,0,i,acc,pos,rank,obj1,obj2); printf(SPACES); printf(IFORMAT,temp1_uchar,temp2_uchar,abs(temp1_uchar-temp2_uchar)); } @@ -1432,3 +1597,105 @@ int diff_native_uchar(unsigned char *mem1, return nfound; } + + +/*------------------------------------------------------------------------- + * Function: diff_char + * + * Purpose: do a byte-by-byte comparison and print in char format + * + * Return: number of differences found + * + * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * + * Date: October 29, 2003 + * + *------------------------------------------------------------------------- + */ + +static +int diff_char(unsigned char *mem1, + unsigned char *mem2, + size_t type_size, + hsize_t i, + int rank, + hsize_t *acc, + hsize_t *pos, + diff_opt_t *options, + const char *obj1, + const char *obj2, + int *ph) +{ + int nfound=0; /* differences found */ + unsigned char temp1_uchar; + unsigned char temp2_uchar; + + memcpy(&temp1_uchar, mem1, sizeof(unsigned char)); + memcpy(&temp2_uchar, mem2, sizeof(unsigned char)); + + if (temp1_uchar != temp2_uchar) + { + if ( options->r==0 ) + { + print_pos(ph,0,i,acc,pos,rank,obj1,obj2); + printf(SPACES); + printf(CFORMAT,temp1_uchar,temp2_uchar); + } + nfound++; + } + + return nfound; +} + + + + +/*------------------------------------------------------------------------- + * Function: is_zero + * + * Purpose: Determines if memory is initialized to all zero bytes. + * + * Return: TRUE if all bytes are zero; FALSE otherwise + * + *------------------------------------------------------------------------- + */ +static hbool_t +is_zero(const void *_mem, size_t size) +{ + const unsigned char *mem = (const unsigned char *)_mem; + + while (size-- > 0) + if (mem[size]) + return FALSE; + + return TRUE; +} + +/*------------------------------------------------------------------------- + * Function: close_obj + * + * Purpose: Auxialiary function to close an object + * + *------------------------------------------------------------------------- + */ + +static +void close_obj(H5G_obj_t obj_type, hid_t obj_id) +{ + + switch (obj_type) { + case H5G_GROUP: + H5Gclose(obj_id); + break; + case H5G_DATASET: + H5Dclose(obj_id); + break; + case H5G_TYPE: + H5Tclose(obj_id); + break; + default: + assert(0); + break; + } +} + diff --git a/tools/lib/h5diff_attr.c b/tools/lib/h5diff_attr.c index 2fbb2a4..c2e36ef 100644 --- a/tools/lib/h5diff_attr.c +++ b/tools/lib/h5diff_attr.c @@ -20,7 +20,7 @@ /*------------------------------------------------------------------------- * Function: diff_attr * - * Purpose: diff attributes located in LOC1_ID and LOC2_ID, which are + * Purpose: compare attributes located in LOC1_ID and LOC2_ID, which are * obtained either from * loc_id = H5Gopen( fid, name); * loc_id = H5Dopen( fid, name); @@ -38,8 +38,10 @@ *------------------------------------------------------------------------- */ -int diff_attr(hid_t loc1_id, - hid_t loc2_id, +int diff_attr(hid_t loc1_id, + hid_t loc2_id, + const char *path1, + const char *path2, diff_opt_t *options ) { @@ -92,7 +94,7 @@ int diff_attr(hid_t loc1_id, /* get name */ if (H5Aget_name( attr1_id, 255, name1 )<0) goto error; - if (H5Aget_name( attr1_id, 255, name2 )<0) + if (H5Aget_name( attr2_id, 255, name2 )<0) goto error; if (HDstrcmp(name1,name2)!=0) @@ -179,10 +181,23 @@ int diff_attr(hid_t loc1_id, */ if (options->verbose) - printf( "Comparing <%s> with <%s>\n", name1, name2 ); - nfound = diff_array(buf1,buf2,nelmts1,rank1,dims1,options,name1,name2,mtype1_id); - if (options->verbose) - printf("%d attribute differences found\n", nfound ); + printf( "Attribute: <%s> and <%s>\n",name1,name2); + sprintf(name1,"%s of <%s>",name1,path1); + sprintf(name2,"%s of <%s>",name2,path2); + nfound = diff_array(buf1, + buf2, + nelmts1, + rank1, + dims1, + options, + name1, + name2, + mtype1_id, + attr1_id, + attr2_id); + if (options->verbose && nfound) + printf("%d differences found\n", nfound ); + /*------------------------------------------------------------------------- * close diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c index 32ca66d..13dfe5f 100644 --- a/tools/lib/h5diff_dset.c +++ b/tools/lib/h5diff_dset.c @@ -28,9 +28,6 @@ * * Date: May 9, 2003 * - * Modifications: November 3, 2003 - * - * *------------------------------------------------------------------------- */ int diff_dataset( hid_t file1_id, @@ -41,29 +38,7 @@ int diff_dataset( hid_t file1_id, { hid_t dset1_id =-1; hid_t dset2_id =-1; - hid_t space1_id =-1; - hid_t space2_id =-1; - hid_t f_type1=-1, f_type2=-1; /* file data type */ - hid_t m_type1=-1, m_type2=-1; /* memory data type */ - size_t m_size1, m_size2; /* size of type in memory */ - H5T_sign_t sign1, sign2; /* sign of type */ - int rank1, rank2; - void *buf1=NULL, *buf2=NULL; - hsize_t tot_cnt1, tot_cnt2; - hsize_t dims1[H5S_MAX_RANK]; - hsize_t dims2[H5S_MAX_RANK]; - hsize_t maxdim1[H5S_MAX_RANK]; - hsize_t maxdim2[H5S_MAX_RANK]; - int nfound=0; /* number of differences found */ - const char *name1=NULL; /* relative names */ - const char *name2=NULL; - int maxdim_diff=0; /* maximum dimensions are different */ - int dim_diff=0; /* current dimensions are different */ - int can1, can2; /* supported diff */ - hsize_t storage_size1; - hsize_t storage_size2; - int i, gout=0; - + int gout=0, nfound; /* disable error reporting */ H5E_BEGIN_TRY { @@ -89,6 +64,77 @@ int diff_dataset( hid_t file1_id, if (gout) goto out; + nfound=diff_datasetid(dset1_id, + dset2_id, + obj1_name, + obj2_name, + options); + + + +/*------------------------------------------------------------------------- + * close + *------------------------------------------------------------------------- + */ + +out: + + /* disable error reporting */ + H5E_BEGIN_TRY { + H5Dclose(dset1_id); + H5Dclose(dset2_id); + /* enable error reporting */ + } H5E_END_TRY; + + return nfound; + +} + + + + +/*------------------------------------------------------------------------- + * Function: diff_datasetid + * + * Purpose: check for comparable datasets and read into a compatible + * memory type + * + * Return: Number of differences found + * + * Programmer: Pedro Vicente, pvn@ncsa.uiuc.edu + * + * Date: May 9, 2003 + * + *------------------------------------------------------------------------- + */ +int diff_datasetid( hid_t dset1_id, + hid_t dset2_id, + const char *obj1_name, + const char *obj2_name, + diff_opt_t *options ) +{ + hid_t space1_id =-1; + hid_t space2_id =-1; + hid_t f_type1=-1, f_type2=-1; /* file data type */ + hid_t m_type1=-1, m_type2=-1; /* memory data type */ + size_t m_size1, m_size2; /* size of type in memory */ + H5T_sign_t sign1, sign2; /* sign of type */ + int rank1, rank2; + void *buf1=NULL, *buf2=NULL; + hsize_t nelmts1, nelmts2; + hsize_t dims1[H5S_MAX_RANK]; + hsize_t dims2[H5S_MAX_RANK]; + hsize_t maxdim1[H5S_MAX_RANK]; + hsize_t maxdim2[H5S_MAX_RANK]; + int nfound=0; /* number of differences found */ + const char *name1=NULL; /* relative names */ + const char *name2=NULL; + int maxdim_diff=0; /* maximum dimensions are different */ + int dim_diff=0; /* current dimensions are different */ + hsize_t storage_size1; + hsize_t storage_size2; + int i, gout=0; + /* Get the dataspace handle */ if ( (space1_id = H5Dget_space(dset1_id)) < 0 ) goto out; @@ -136,7 +182,7 @@ int diff_dataset( hid_t file1_id, storage_size2=H5Dget_storage_size(dset2_id); if (storage_size1<=0 && storage_size2<=0) { - if (options->verbose) + if (options->verbose && obj1_name && obj2_name) printf("<%s> and <%s> are empty datasets\n", obj1_name, obj2_name); goto out; } @@ -167,26 +213,26 @@ int diff_dataset( hid_t file1_id, *------------------------------------------------------------------------- */ - tot_cnt1 = 1; + nelmts1 = 1; for (i = 0; i < rank1; i++) { - tot_cnt1 *= dims1[i]; + nelmts1 *= dims1[i]; } - tot_cnt2 = 1; + nelmts2 = 1; for (i = 0; i < rank2; i++) { - tot_cnt2 *= dims2[i]; + nelmts2 *= dims2[i]; } - assert(tot_cnt1==tot_cnt2); + assert(nelmts1==nelmts2); /*------------------------------------------------------------------------- * check for equal file datatype; warning only *------------------------------------------------------------------------- */ - if ( (H5Tequal(f_type1, f_type2)==0) && options->verbose) + if ( (H5Tequal(f_type1, f_type2)==0) && options->verbose && obj1_name) { printf("Warning: Different storage datatype\n"); printf("<%s> has file datatype ", obj1_name); @@ -209,29 +255,11 @@ int diff_dataset( hid_t file1_id, m_size2 = H5Tget_size( m_type2 ); #if defined (H5DIFF_DEBUG) - print_sizes(obj1_name,obj2_name,f_type1,f_type2,m_type1,m_type2); + if (obj1_name) + print_sizes(obj1_name,obj2_name,f_type1,f_type2,m_type1,m_type2); #endif /*------------------------------------------------------------------------- - * check for the comparable types in diff_array - *------------------------------------------------------------------------- - */ - - can1=diff_can(m_type1); - can2=diff_can(m_type2); - if ( (can1==0 || can2==0)) - { - if (options->verbose) { - printf("Comparison not supported\n"); - if ( can1==0 ) - printf("<%s> type is not supported\n", obj1_name); - if ( can2==0 ) - printf("<%s> type is not supported\n", obj2_name); - } - goto out; - } - -/*------------------------------------------------------------------------- * check for different signed/unsigned types *------------------------------------------------------------------------- */ @@ -240,15 +268,13 @@ int diff_dataset( hid_t file1_id, sign2=H5Tget_sign(m_type2); if ( sign1 != sign2 ) { - if (options->verbose) { - printf("Comparison not supported\n"); - printf("<%s> has sign %s\n", obj1_name, get_sign(sign1)); - printf("<%s> has sign %s", obj2_name, get_sign(sign2)); + if (options->verbose && obj1_name) { + printf("Comparison not supported: <%s> has sign %s ", obj1_name, get_sign(sign1)); + printf("and <%s> has sign %s\n", obj2_name, get_sign(sign2)); } goto out; } - /*------------------------------------------------------------------------- * "upgrade" the smaller memory size *------------------------------------------------------------------------- @@ -270,13 +296,14 @@ int diff_dataset( hid_t file1_id, } #if defined (H5DIFF_DEBUG) printf("WARNING: Size was upgraded\n"); + if (obj1_name) print_sizes(obj1_name,obj2_name,f_type1,f_type2,m_type1,m_type2); #endif } assert(m_size1==m_size2); - buf1 = (void *) HDmalloc((unsigned) (tot_cnt1*m_size1)); - buf2 = (void *) HDmalloc((unsigned) (tot_cnt2*m_size2)); + buf1 = (void *) HDmalloc((unsigned) (nelmts1*m_size1)); + buf2 = (void *) HDmalloc((unsigned) (nelmts2*m_size2)); if ( buf1 == NULL || buf2 == NULL ) { @@ -299,12 +326,23 @@ int diff_dataset( hid_t file1_id, * array compare *------------------------------------------------------------------------- */ - if (options->verbose) - printf( "Comparing <%s> with <%s>\n", obj1_name, obj2_name ); - name1=diff_basename(obj1_name); - name2=diff_basename(obj2_name); - nfound = diff_array(buf1,buf2,tot_cnt1,rank1,dims1,options,name1,name2,m_type1); - if (options->verbose) + if (obj1_name) + name1=diff_basename(obj1_name); + if (obj2_name) + name2=diff_basename(obj2_name); + nfound = diff_array(buf1, + buf2, + nelmts1, + rank1, + dims1, + options, + name1, + name2, + m_type1, + dset1_id, + dset2_id); + + if (options->verbose && nfound) printf("%d differences found\n", nfound ); /*------------------------------------------------------------------------- @@ -312,10 +350,7 @@ int diff_dataset( hid_t file1_id, *------------------------------------------------------------------------- */ - if (options->attr) - diff_attr(dset1_id,dset1_id,options); - - + diff_attr(dset1_id,dset2_id,obj1_name,obj2_name,options); /*------------------------------------------------------------------------- * close @@ -330,8 +365,6 @@ out: /* close */ /* disable error reporting */ H5E_BEGIN_TRY { - H5Dclose(dset1_id); - H5Dclose(dset2_id); H5Sclose(space1_id); H5Sclose(space2_id); H5Tclose(f_type1); @@ -345,6 +378,9 @@ out: } + + + /*------------------------------------------------------------------------- * Function: diff_can_type * @@ -398,9 +434,8 @@ int diff_can_type( hid_t f_type1, /* file data type */ if ( tclass1 != tclass2 ) { - if (options->verbose) { - printf("Comparison not supported\n"); - printf("<%s> is of class %s and <%s> is of class %s\n", + if (options->verbose && obj1_name) { + printf("Comparison not possible: <%s> is of class %s and <%s> is of class %s\n", obj1_name, get_class(tclass1), obj2_name, get_class(tclass2) ); } @@ -424,16 +459,14 @@ int diff_can_type( hid_t f_type1, /* file data type */ case H5T_OPAQUE: case H5T_ENUM: case H5T_VLEN: - return 1; + case H5T_REFERENCE: - default: /*H5T_TIME, H5T_REFERENCE */ - if (options->verbose ) { - printf("Comparison not supported\n"); - printf("<%s> is of class %s and <%s> is of class %s\n", - obj1_name, get_class(tclass1), - obj2_name, get_class(tclass2) ); - } + break; + default: /*H5T_TIME */ + if (options->verbose && obj1_name ) + printf("Comparison not supported: <%s> and <%s> are of class %s\n", + obj1_name,obj2_name,get_class(tclass2) ); return 0; } @@ -442,7 +475,7 @@ int diff_can_type( hid_t f_type1, /* file data type */ *------------------------------------------------------------------------- */ - if ( (H5Tequal(f_type1, f_type2)==0) && options->verbose) + if ( (H5Tequal(f_type1, f_type2)==0) && options->verbose && obj1_name) { printf("Warning: Different storage datatype\n"); printf("<%s> has file datatype ", obj1_name); @@ -460,9 +493,8 @@ int diff_can_type( hid_t f_type1, /* file data type */ if ( rank1 != rank2 ) { - if (options->verbose) { - printf("Comparison not supported\n"); - printf("<%s> has rank %d, dimensions ", obj1_name, rank1); + if (options->verbose && obj1_name) { + printf("Comparison not supported: <%s> has rank %d, dimensions ", obj1_name, rank1); print_dims(rank1,dims1); printf(", max dimensions "); print_dims(rank1,maxdim1); @@ -499,9 +531,8 @@ int diff_can_type( hid_t f_type1, /* file data type */ if (dim_diff==1) { - if (options->verbose) { - printf("Comparison not supported\n"); - printf("<%s> has rank %d, dimensions ", obj1_name, rank1); + if (options->verbose && obj1_name) { + printf("Comparison not supported: <%s> has rank %d, dimensions ", obj1_name, rank1); print_dims(rank1,dims1); if (maxdim1 && maxdim2) { printf(", max dimensions "); @@ -520,7 +551,7 @@ int diff_can_type( hid_t f_type1, /* file data type */ * maximum dimensions; just give a warning *------------------------------------------------------------------------- */ - if (maxdim1 && maxdim2 && maxdim_diff==1) + if (maxdim1 && maxdim2 && maxdim_diff==1 && obj1_name ) { if (options->verbose) { printf( "Warning: Different maximum dimensions\n"); diff --git a/tools/lib/h5diff_util.c b/tools/lib/h5diff_util.c index 3340e2d..673b67f 100644 --- a/tools/lib/h5diff_util.c +++ b/tools/lib/h5diff_util.c @@ -16,47 +16,6 @@ #include - -/*------------------------------------------------------------------------- - * Function: diff_can - * - * Purpose: Check if TYPE_ID is supported; only the listed types are - * supported in the current version - * Date: May 30, 2003 - * - * Modifications: October 29, 2003 - * Added support for H5T_COMPOUND, H5T_STRING, H5T_ARRAY types; - * - *------------------------------------------------------------------------- - */ -int diff_can(hid_t type_id) -{ - int ret=0; - - if ( ((H5Tget_class(type_id) == H5T_COMPOUND)==1)|| /* get class */ - ((H5Tget_class(type_id) == H5T_STRING)==1)|| /* get class */ - ((H5Tget_class(type_id) == H5T_ARRAY)==1)|| /* get class */ - - (H5Tequal(type_id, H5T_NATIVE_FLOAT)==1)|| - (H5Tequal(type_id, H5T_NATIVE_DOUBLE)==1)|| - (H5Tequal(type_id, H5T_NATIVE_INT)==1)|| - (H5Tequal(type_id, H5T_NATIVE_UINT)==1)|| - (H5Tequal(type_id, H5T_NATIVE_SCHAR)==1)|| - (H5Tequal(type_id, H5T_NATIVE_UCHAR)==1)|| - (H5Tequal(type_id, H5T_NATIVE_SHORT)==1)|| - (H5Tequal(type_id, H5T_NATIVE_USHORT)==1)|| - (H5Tequal(type_id, H5T_NATIVE_LONG)==1)|| - (H5Tequal(type_id, H5T_NATIVE_ULONG)==1)|| - (H5Tequal(type_id, H5T_NATIVE_LLONG)==1)|| - (H5Tequal(type_id, H5T_NATIVE_ULLONG)==1) - ) - ret=1; - return ret; -} - - - - /*------------------------------------------------------------------------- * Function: print_pos * @@ -70,8 +29,14 @@ int diff_can(hid_t type_id) * *------------------------------------------------------------------------- */ -void print_pos( int *ph, int p, unsigned int curr_pos, int *acc, - int *pos, int rank, const char *obj1, const char *obj2 ) +void print_pos( int *ph, + int per, + hsize_t curr_pos, + hsize_t *acc, + hsize_t *pos, + int rank, + const char *obj1, + const char *obj2 ) { int i; @@ -79,23 +44,28 @@ void print_pos( int *ph, int p, unsigned int curr_pos, int *acc, if ( *ph==1 ) { *ph=0; - if (p) + if (per) { - printf("%-15s %-15s %-15s %-15s %-15s\n", "position", obj1, obj2, "difference", + printf("%-15s %-15s %-15s %-15s %-15s\n", + "position", + (obj1!=NULL) ? obj1 : " ", + (obj2!=NULL) ? obj2 : " ", + "difference", "relative"); printf("------------------------------------------------------------------------\n"); } else { - printf("%-15s %-15s %-15s %-20s\n", "position", obj1, obj2, "difference"); + printf("%-15s %-15s %-15s %-20s\n", + "position", + (obj1!=NULL) ? obj1 : " ", + (obj2!=NULL) ? obj2 : " ", + "difference"); printf("------------------------------------------------------------\n"); } } for ( i = 0; i < rank; i++) - pos[i]=0; - - for ( i = 0; i < rank; i++) { pos[i] = curr_pos/acc[i]; curr_pos -= acc[i]*pos[i]; @@ -105,7 +75,7 @@ void print_pos( int *ph, int p, unsigned int curr_pos, int *acc, printf("[ " ); for ( i = 0; i < rank; i++) { - printf("%d ", pos[i] ); + HDfprintf(stdout,"%Hu ", pos[i] ); } printf("]" ); } diff --git a/tools/testfiles/file1.h5 b/tools/testfiles/file1.h5 index 11cd7b4..f7c115d 100644 Binary files a/tools/testfiles/file1.h5 and b/tools/testfiles/file1.h5 differ diff --git a/tools/testfiles/file2.h5 b/tools/testfiles/file2.h5 index 432d412..a7d7ed0 100644 Binary files a/tools/testfiles/file2.h5 and b/tools/testfiles/file2.h5 differ diff --git a/tools/testfiles/file3.h5 b/tools/testfiles/file3.h5 index 2f63b47..04483b4 100644 Binary files a/tools/testfiles/file3.h5 and b/tools/testfiles/file3.h5 differ diff --git a/tools/testfiles/file4.h5 b/tools/testfiles/file4.h5 index c4e511f..3aa87d9 100644 Binary files a/tools/testfiles/file4.h5 and b/tools/testfiles/file4.h5 differ diff --git a/tools/testfiles/file5.h5 b/tools/testfiles/file5.h5 index a1137f2..5646aa0 100644 Binary files a/tools/testfiles/file5.h5 and b/tools/testfiles/file5.h5 differ diff --git a/tools/testfiles/file6.h5 b/tools/testfiles/file6.h5 index bb9c043..c2de45c 100644 Binary files a/tools/testfiles/file6.h5 and b/tools/testfiles/file6.h5 differ diff --git a/tools/testfiles/file7.h5 b/tools/testfiles/file7.h5 new file mode 100644 index 0000000..de835ce Binary files /dev/null and b/tools/testfiles/file7.h5 differ diff --git a/tools/testfiles/file8.h5 b/tools/testfiles/file8.h5 new file mode 100644 index 0000000..7946faa Binary files /dev/null and b/tools/testfiles/file8.h5 differ diff --git a/tools/testfiles/h5diff_10.txt b/tools/testfiles/h5diff_10.txt index 4e6a015..f291c68 100644 --- a/tools/testfiles/h5diff_10.txt +++ b/tools/testfiles/h5diff_10.txt @@ -1,7 +1,6 @@ ############################# Expected output for 'h5diff -h' ############################# -$h5diff -h Usage: h5diff file1 file2 [OPTIONS] [obj1[obj2]] file1 File name of the first HDF5 file @@ -15,7 +14,6 @@ file2 File name of the second HDF5 file [-n count] Print difference up to count number [-d delta] Print difference when it is greater than limit delta [-p relative] Print difference when it is greater than a relative limit -[-a] Compare attributes Items in [] are optional [obj1] and [obj2] are HDF5 objects (datasets, groups or datatypes) diff --git a/tools/testfiles/h5diff_11.txt b/tools/testfiles/h5diff_11.txt index eba6de1..26214ab 100644 --- a/tools/testfiles/h5diff_11.txt +++ b/tools/testfiles/h5diff_11.txt @@ -1,7 +1,10 @@ ############################# -Expected output for 'h5diff file6.h5 file6.h5 -v dset3a dset3b' +Expected output for 'h5diff file1.h5 file2.h5 g1/dset1 g1/dset2' ############################# -$h5diff file6.h5 file6.h5 -v dset3a dset3b -Comparing with -0 differences found +position dset1 dset2 difference +------------------------------------------------------------ +[ 0 1 ] 1.000000 1.100000 0.100000 +[ 1 0 ] 1.000000 1.010000 0.010000 +[ 1 1 ] 1.000000 1.001000 0.001000 +[ 2 0 ] 1.000000 1.000100 0.000100 diff --git a/tools/testfiles/h5diff_12.txt b/tools/testfiles/h5diff_12.txt index 5fbd117..5c53bb7 100644 --- a/tools/testfiles/h5diff_12.txt +++ b/tools/testfiles/h5diff_12.txt @@ -2,10 +2,5 @@ Expected output for 'h5diff file1.h5 file2.h5 -v -n 2 g1/dset1 g1/dset2' ############################# $h5diff file1.h5 file2.h5 -v -n 2 g1/dset1 g1/dset2 -Comparing with -position dset1 dset2 difference ------------------------------------------------------------- -[ 0 1 ] 1 1.1 0.1 -[ 1 0 ] 1 1.01 0.01 -2 differences found +Object <2> could not be found in diff --git a/tools/testfiles/h5diff_13.txt b/tools/testfiles/h5diff_13.txt index 9d85608..406b01a 100644 --- a/tools/testfiles/h5diff_13.txt +++ b/tools/testfiles/h5diff_13.txt @@ -2,14 +2,14 @@ Expected output for 'h5diff file1.h5 file2.h5 -v -d 5 g1/dset3 g1/dset4' ############################# $h5diff file1.h5 file2.h5 -v -d 5 g1/dset3 g1/dset4 -Comparing with +Dataset: and position dset3 dset4 difference ------------------------------------------------------------ -[ 0 0 ] 100 110 10 -[ 0 1 ] 110 100 10 -[ 1 0 ] 100 90 10 -[ 1 1 ] 100 80 20 -[ 2 0 ] 100 140 40 -[ 2 1 ] 100 200 100 +[ 0 0 ] 100.000000 110.000000 10.000000 +[ 0 1 ] 110.000000 100.000000 10.000000 +[ 1 0 ] 100.000000 90.000000 10.000000 +[ 1 1 ] 100.000000 80.000000 20.000000 +[ 2 0 ] 100.000000 140.000000 40.000000 +[ 2 1 ] 100.000000 200.000000 100.000000 6 differences found diff --git a/tools/testfiles/h5diff_14.txt b/tools/testfiles/h5diff_14.txt index c69557c..8efcf83 100644 --- a/tools/testfiles/h5diff_14.txt +++ b/tools/testfiles/h5diff_14.txt @@ -2,7 +2,7 @@ Expected output for 'h5diff file1.h5 file2.h5 -v -p 0.05 g1/dset3 g1/dset4' ############################# $h5diff file1.h5 file2.h5 -v -p 0.05 g1/dset3 g1/dset4 -Comparing with +Dataset: and position dset3 dset4 difference relative ------------------------------------------------------------------------ [ 0 0 ] 100 110 10 0.1 diff --git a/tools/testfiles/h5diff_15.txt b/tools/testfiles/h5diff_15.txt index 20fc1d4..961c652 100644 --- a/tools/testfiles/h5diff_15.txt +++ b/tools/testfiles/h5diff_15.txt @@ -2,5 +2,6 @@ Expected output for 'h5diff file1.h5 file2.h5 -v -r g1/dset1 g1/dset2' ############################# $h5diff file1.h5 file2.h5 -v -r g1/dset1 g1/dset2 -Object could not be found in +Dataset: and +4 differences found diff --git a/tools/testfiles/h5diff_16.txt b/tools/testfiles/h5diff_16.txt index 7b063d5..56fde35 100644 --- a/tools/testfiles/h5diff_16.txt +++ b/tools/testfiles/h5diff_16.txt @@ -1,5 +1,10 @@ ############################# -Expected output for 'h5diff file6.h5 file6.h5' +Expected output for 'h5diff file1.h5 file2.h5' ############################# -$h5diff file6.h5 file6.h5 +position dset1 dset1 difference +------------------------------------------------------------ +[ 0 1 ] 1.000000 1.100000 0.100000 +[ 1 0 ] 1.000000 1.010000 0.010000 +[ 1 1 ] 1.000000 1.001000 0.001000 +[ 2 0 ] 1.000000 1.000100 0.000100 diff --git a/tools/testfiles/h5diff_20.txt b/tools/testfiles/h5diff_20.txt index 8403eed..6896f3e 100644 --- a/tools/testfiles/h5diff_20.txt +++ b/tools/testfiles/h5diff_20.txt @@ -2,6 +2,5 @@ Expected output for 'h5diff file3.h5 file3.h5 -v dset group' ############################# $h5diff file3.h5 file3.h5 -v dset group -Comparison not supported - is of type H5G_GROUP and is of type H5G_GROUP +Comparison not possible: is of type H5G_DATASET and is of type H5G_GROUP diff --git a/tools/testfiles/h5diff_21.txt b/tools/testfiles/h5diff_21.txt index 31b103e..15f91b6 100644 --- a/tools/testfiles/h5diff_21.txt +++ b/tools/testfiles/h5diff_21.txt @@ -2,6 +2,5 @@ Expected output for 'h5diff file3.h5 file3.h5 -v dset link' ############################# $h5diff file3.h5 file3.h5 -v dset link -Comparison not supported - is of type H5G_LINK and is of type H5G_LINK +Comparison not possible: is of type H5G_DATASET and is of type H5G_LINK diff --git a/tools/testfiles/h5diff_22.txt b/tools/testfiles/h5diff_22.txt index ac367bc..a518e7e 100644 --- a/tools/testfiles/h5diff_22.txt +++ b/tools/testfiles/h5diff_22.txt @@ -2,6 +2,5 @@ Expected output for 'h5diff file3.h5 file3.h5 -v dset type' ############################# $h5diff file3.h5 file3.h5 -v dset type -Comparison not supported - is of type H5G_TYPE and is of type H5G_TYPE +Comparison not possible: is of type H5G_DATASET and is of type H5G_TYPE diff --git a/tools/testfiles/h5diff_23.txt b/tools/testfiles/h5diff_23.txt index d3796e7..ee20e1d 100644 --- a/tools/testfiles/h5diff_23.txt +++ b/tools/testfiles/h5diff_23.txt @@ -2,6 +2,5 @@ Expected output for 'h5diff file3.h5 file3.h5 -v group group' ############################# $h5diff file3.h5 file3.h5 -v group group -Comparison not supported - is of type H5G_GROUP and is of type H5G_GROUP +Group: and diff --git a/tools/testfiles/h5diff_24.txt b/tools/testfiles/h5diff_24.txt index 228d857..dc1ebb0 100644 --- a/tools/testfiles/h5diff_24.txt +++ b/tools/testfiles/h5diff_24.txt @@ -2,6 +2,5 @@ Expected output for 'h5diff file3.h5 file3.h5 -v type type' ############################# $h5diff file3.h5 file3.h5 -v type type -Comparison not supported - is of type H5G_TYPE and is of type H5G_TYPE +Datatype: and diff --git a/tools/testfiles/h5diff_25.txt b/tools/testfiles/h5diff_25.txt index 56ea44e..1bbffac 100644 --- a/tools/testfiles/h5diff_25.txt +++ b/tools/testfiles/h5diff_25.txt @@ -2,6 +2,5 @@ Expected output for 'h5diff file3.h5 file3.h5 -v link link' ############################# $h5diff file3.h5 file3.h5 -v link link -Comparison not supported - is of type H5G_LINK and is of type H5G_LINK +Link: and diff --git a/tools/testfiles/h5diff_30.txt b/tools/testfiles/h5diff_30.txt deleted file mode 100644 index cc2498e..0000000 --- a/tools/testfiles/h5diff_30.txt +++ /dev/null @@ -1,29 +0,0 @@ -############################# -Expected output for 'h5diff file4.h5 file4.h5 -v string' -############################# -$h5diff file4.h5 file4.h5 -v string - -file1 file2 ---------------------------------------- - x x /array - x x /bitfield - x x /compound - x x /enum - x x /float - x x /integer - x x /opaque - x x /ref - x x /string - x x /vlen - - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - diff --git a/tools/testfiles/h5diff_31.txt b/tools/testfiles/h5diff_31.txt deleted file mode 100644 index c7ea23a..0000000 --- a/tools/testfiles/h5diff_31.txt +++ /dev/null @@ -1,29 +0,0 @@ -############################# -Expected output for 'h5diff file4.h5 file4.h5 -v bitfield' -############################# -$h5diff file4.h5 file4.h5 -v bitfield - -file1 file2 ---------------------------------------- - x x /array - x x /bitfield - x x /compound - x x /enum - x x /float - x x /integer - x x /opaque - x x /ref - x x /string - x x /vlen - - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - diff --git a/tools/testfiles/h5diff_32.txt b/tools/testfiles/h5diff_32.txt deleted file mode 100644 index 4872654..0000000 --- a/tools/testfiles/h5diff_32.txt +++ /dev/null @@ -1,29 +0,0 @@ -############################# -Expected output for 'h5diff file4.h5 file4.h5 -v opaque' -############################# -$h5diff file4.h5 file4.h5 -v opaque - -file1 file2 ---------------------------------------- - x x /array - x x /bitfield - x x /compound - x x /enum - x x /float - x x /integer - x x /opaque - x x /ref - x x /string - x x /vlen - - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - diff --git a/tools/testfiles/h5diff_33.txt b/tools/testfiles/h5diff_33.txt deleted file mode 100644 index 54350cb..0000000 --- a/tools/testfiles/h5diff_33.txt +++ /dev/null @@ -1,29 +0,0 @@ -############################# -Expected output for 'h5diff file4.h5 file4.h5 -v compound' -############################# -$h5diff file4.h5 file4.h5 -v compound - -file1 file2 ---------------------------------------- - x x /array - x x /bitfield - x x /compound - x x /enum - x x /float - x x /integer - x x /opaque - x x /ref - x x /string - x x /vlen - - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - diff --git a/tools/testfiles/h5diff_34.txt b/tools/testfiles/h5diff_34.txt deleted file mode 100644 index 20e5dc7..0000000 --- a/tools/testfiles/h5diff_34.txt +++ /dev/null @@ -1,29 +0,0 @@ -############################# -Expected output for 'h5diff file4.h5 file4.h5 -v ref' -############################# -$h5diff file4.h5 file4.h5 -v ref - -file1 file2 ---------------------------------------- - x x /array - x x /bitfield - x x /compound - x x /enum - x x /float - x x /integer - x x /opaque - x x /ref - x x /string - x x /vlen - - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - diff --git a/tools/testfiles/h5diff_35.txt b/tools/testfiles/h5diff_35.txt deleted file mode 100644 index ba08719..0000000 --- a/tools/testfiles/h5diff_35.txt +++ /dev/null @@ -1,29 +0,0 @@ -############################# -Expected output for 'h5diff file4.h5 file4.h5 -v enum' -############################# -$h5diff file4.h5 file4.h5 -v enum - -file1 file2 ---------------------------------------- - x x /array - x x /bitfield - x x /compound - x x /enum - x x /float - x x /integer - x x /opaque - x x /ref - x x /string - x x /vlen - - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - diff --git a/tools/testfiles/h5diff_36.txt b/tools/testfiles/h5diff_36.txt deleted file mode 100644 index a818cfd..0000000 --- a/tools/testfiles/h5diff_36.txt +++ /dev/null @@ -1,29 +0,0 @@ -############################# -Expected output for 'h5diff file4.h5 file4.h5 -v vlen' -############################# -$h5diff file4.h5 file4.h5 -v vlen - -file1 file2 ---------------------------------------- - x x /array - x x /bitfield - x x /compound - x x /enum - x x /float - x x /integer - x x /opaque - x x /ref - x x /string - x x /vlen - - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - diff --git a/tools/testfiles/h5diff_37.txt b/tools/testfiles/h5diff_37.txt deleted file mode 100644 index d6f4a01..0000000 --- a/tools/testfiles/h5diff_37.txt +++ /dev/null @@ -1,29 +0,0 @@ -############################# -Expected output for 'h5diff file4.h5 file4.h5 -v array' -############################# -$h5diff file4.h5 file4.h5 -v array - -file1 file2 ---------------------------------------- - x x /array - x x /bitfield - x x /compound - x x /enum - x x /float - x x /integer - x x /opaque - x x /ref - x x /string - x x /vlen - - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - and are empty datasets - diff --git a/tools/testfiles/h5diff_38.txt b/tools/testfiles/h5diff_38.txt deleted file mode 100644 index 35e3b62..0000000 --- a/tools/testfiles/h5diff_38.txt +++ /dev/null @@ -1,6 +0,0 @@ -############################# -Expected output for 'h5diff file4.h5 file4.h5 -v integer float' -############################# -$h5diff file4.h5 file4.h5 -v integer float - and are empty datasets - diff --git a/tools/testfiles/h5diff_50.txt b/tools/testfiles/h5diff_50.txt index 2b4a547..9fc3c7f 100644 --- a/tools/testfiles/h5diff_50.txt +++ b/tools/testfiles/h5diff_50.txt @@ -1,7 +1,19 @@ ############################# -Expected output for 'h5diff file6.h5 file6.h5 -v dset0a dset0b' +Expected output for 'h5diff file4.h5 file4.h5 -v dset0a dset0b' ############################# -$h5diff file6.h5 file6.h5 -v dset0a dset0b -Comparing with -0 differences found +$h5diff file4.h5 file4.h5 -v dset0a dset0b +Dataset: and +Warning: Different storage datatype + has file datatype H5T_STD_I16LE + has file datatype H5T_STD_I32LE +Warning: Different storage datatype + has file datatype H5T_STD_I16LE + has file datatype H5T_STD_I32LE +position dset0a dset0b difference +------------------------------------------------------------ +[ 1 0 ] 1 3 2 +[ 1 1 ] 1 4 3 +[ 2 0 ] 1 5 4 +[ 2 1 ] 1 6 5 +4 differences found diff --git a/tools/testfiles/h5diff_51.txt b/tools/testfiles/h5diff_51.txt index 8c98dc9..858ace2 100644 --- a/tools/testfiles/h5diff_51.txt +++ b/tools/testfiles/h5diff_51.txt @@ -1,7 +1,13 @@ ############################# -Expected output for 'h5diff file6.h5 file6.h5 -v dset1a dset1b' +Expected output for 'h5diff file4.h5 file4.h5 -v dset1a dset1b' ############################# -$h5diff file6.h5 file6.h5 -v dset1a dset1b -Comparing with -0 differences found +$h5diff file4.h5 file4.h5 -v dset1a dset1b +Dataset: and +position dset1a dset1b difference +------------------------------------------------------------ +[ 1 0 ] 1 3 2 +[ 1 1 ] 1 4 3 +[ 2 0 ] 1 5 4 +[ 2 1 ] 1 6 5 +4 differences found diff --git a/tools/testfiles/h5diff_52.txt b/tools/testfiles/h5diff_52.txt index b148a45..d3999ad 100644 --- a/tools/testfiles/h5diff_52.txt +++ b/tools/testfiles/h5diff_52.txt @@ -1,7 +1,13 @@ ############################# -Expected output for 'h5diff file6.h5 file6.h5 -v dset2a dset2b' +Expected output for 'h5diff file4.h5 file4.h5 -v dset2a dset2b' ############################# -$h5diff file6.h5 file6.h5 -v dset2a dset2b -Comparing with -0 differences found +$h5diff file4.h5 file4.h5 -v dset2a dset2b +Dataset: and +position dset2a dset2b difference +------------------------------------------------------------ +[ 1 0 ] 1 3 2 +[ 1 1 ] 1 4 3 +[ 2 0 ] 1 5 4 +[ 2 1 ] 1 6 5 +4 differences found diff --git a/tools/testfiles/h5diff_53.txt b/tools/testfiles/h5diff_53.txt index f34c172..e7e899e 100644 --- a/tools/testfiles/h5diff_53.txt +++ b/tools/testfiles/h5diff_53.txt @@ -1,7 +1,13 @@ ############################# -Expected output for 'h5diff file6.h5 file6.h5 -v dset3a dset4b' +Expected output for 'h5diff file4.h5 file4.h5 -v dset3a dset4b' ############################# -$h5diff file6.h5 file6.h5 -v dset3a dset4b -Comparing with -0 differences found +$h5diff file4.h5 file4.h5 -v dset3a dset4b +Dataset: and +position dset3a dset4b difference +------------------------------------------------------------ +[ 1 0 ] 1 3 2 +[ 1 1 ] 1 4 3 +[ 2 0 ] 1 5 4 +[ 2 1 ] 1 6 5 +4 differences found diff --git a/tools/testfiles/h5diff_54.txt b/tools/testfiles/h5diff_54.txt index eba9116..bd21628 100644 --- a/tools/testfiles/h5diff_54.txt +++ b/tools/testfiles/h5diff_54.txt @@ -1,7 +1,13 @@ ############################# -Expected output for 'h5diff file6.h5 file6.h5 -v dset4a dset4b' +Expected output for 'h5diff file4.h5 file4.h5 -v dset4a dset4b' ############################# -$h5diff file6.h5 file6.h5 -v dset4a dset4b -Comparing with -0 differences found +$h5diff file4.h5 file4.h5 -v dset4a dset4b +Dataset: and +position dset4a dset4b difference +------------------------------------------------------------ +[ 1 0 ] 1 3 2 +[ 1 1 ] 1 4 3 +[ 2 0 ] 1 5 4 +[ 2 1 ] 1 6 5 +4 differences found diff --git a/tools/testfiles/h5diff_55.txt b/tools/testfiles/h5diff_55.txt index 2b9f24f..69de2c1 100644 --- a/tools/testfiles/h5diff_55.txt +++ b/tools/testfiles/h5diff_55.txt @@ -1,7 +1,13 @@ ############################# -Expected output for 'h5diff file6.h5 file6.h5 -v dset5a dset5b' +Expected output for 'h5diff file4.h5 file4.h5 -v dset5a dset5b' ############################# -$h5diff file6.h5 file6.h5 -v dset5a dset5b -Comparing with -0 differences found +$h5diff file4.h5 file4.h5 -v dset5a dset5b +Dataset: and +position dset5a dset5b difference +------------------------------------------------------------ +[ 1 0 ] 1.000000 3.000000 2.000000 +[ 1 1 ] 1.000000 4.000000 3.000000 +[ 2 0 ] 1.000000 5.000000 4.000000 +[ 2 1 ] 1.000000 6.000000 5.000000 +4 differences found diff --git a/tools/testfiles/h5diff_56.txt b/tools/testfiles/h5diff_56.txt index d37dd59..0426f4d 100644 --- a/tools/testfiles/h5diff_56.txt +++ b/tools/testfiles/h5diff_56.txt @@ -1,7 +1,13 @@ ############################# -Expected output for 'h5diff file6.h5 file6.h5 -v dset6a dset6b' +Expected output for 'h5diff file4.h5 file4.h5 -v dset6a dset6b' ############################# -$h5diff file6.h5 file6.h5 -v dset6a dset6b -Comparing with -0 differences found +$h5diff file4.h5 file4.h5 -v dset6a dset6b +Dataset: and +position dset6a dset6b difference +------------------------------------------------------------ +[ 1 0 ] 1.000000 3.000000 2.000000 +[ 1 1 ] 1.000000 4.000000 3.000000 +[ 2 0 ] 1.000000 5.000000 4.000000 +[ 2 1 ] 1.000000 6.000000 5.000000 +4 differences found diff --git a/tools/testfiles/h5diff_57.txt b/tools/testfiles/h5diff_57.txt index 67dfad1..6794e73 100644 --- a/tools/testfiles/h5diff_57.txt +++ b/tools/testfiles/h5diff_57.txt @@ -1,7 +1,13 @@ ############################# -Expected output for 'h5diff file6.h5 file6.h5 -v dset7a dset7b' +Expected output for 'h5diff file4.h5 file4.h5 -v dset7a dset7b' ############################# -$h5diff file6.h5 file6.h5 -v dset7a dset7b -Comparing with -0 differences found +$h5diff file4.h5 file4.h5 -v dset7a dset7b +Dataset: and +Warning: Different storage datatype + has file datatype H5T_STD_I8LE + has file datatype H5T_STD_U8LE +Warning: Different storage datatype + has file datatype H5T_STD_I8LE + has file datatype H5T_STD_U8LE +Comparison not supported: has sign H5T_SGN_2 and has sign H5T_SGN_NONE diff --git a/tools/testfiles/h5diff_600.txt b/tools/testfiles/h5diff_600.txt index 9b69c4d..50254b0 100644 --- a/tools/testfiles/h5diff_600.txt +++ b/tools/testfiles/h5diff_600.txt @@ -1,7 +1,6 @@ ############################# Expected output for 'h5diff file1.h5' ############################# -$h5diff file1.h5 Number of arguments is only 2 Usage: h5diff file1 file2 [OPTIONS] [obj1[obj2]] @@ -16,7 +15,6 @@ file2 File name of the second HDF5 file [-n count] Print difference up to count number [-d delta] Print difference when it is greater than limit delta [-p relative] Print difference when it is greater than a relative limit -[-a] Compare attributes Items in [] are optional [obj1] and [obj2] are HDF5 objects (datasets, groups or datatypes) diff --git a/tools/testfiles/h5diff_601.txt b/tools/testfiles/h5diff_601.txt index 589240b..2896b76 100644 --- a/tools/testfiles/h5diff_601.txt +++ b/tools/testfiles/h5diff_601.txt @@ -1,7 +1,6 @@ ############################# Expected output for 'h5diff file1.h5 file2.h5 -x' ############################# -$h5diff file1.h5 file2.h5 -x -x is an invalid option Usage: h5diff file1 file2 [OPTIONS] [obj1[obj2]] @@ -16,7 +15,6 @@ file2 File name of the second HDF5 file [-n count] Print difference up to count number [-d delta] Print difference when it is greater than limit delta [-p relative] Print difference when it is greater than a relative limit -[-a] Compare attributes Items in [] are optional [obj1] and [obj2] are HDF5 objects (datasets, groups or datatypes) diff --git a/tools/testfiles/h5diff_602.txt b/tools/testfiles/h5diff_602.txt index 2441ab1..160b9e9b 100644 --- a/tools/testfiles/h5diff_602.txt +++ b/tools/testfiles/h5diff_602.txt @@ -1,7 +1,6 @@ ############################# Expected output for 'h5diff file1.h5 file2.h5 -d g1/dset3 g1/dset4' ############################# -$h5diff file1.h5 file2.h5 -d g1/dset3 g1/dset4 <-d g1/dset3> is not a valid option Usage: h5diff file1 file2 [OPTIONS] [obj1[obj2]] @@ -16,7 +15,6 @@ file2 File name of the second HDF5 file [-n count] Print difference up to count number [-d delta] Print difference when it is greater than limit delta [-p relative] Print difference when it is greater than a relative limit -[-a] Compare attributes Items in [] are optional [obj1] and [obj2] are HDF5 objects (datasets, groups or datatypes) diff --git a/tools/testfiles/h5diff_603.txt b/tools/testfiles/h5diff_603.txt index d1a39d1..6719ebd 100644 --- a/tools/testfiles/h5diff_603.txt +++ b/tools/testfiles/h5diff_603.txt @@ -1,7 +1,6 @@ ############################# Expected output for 'h5diff file1.h5 file2.h5 -d -4 g1/dset3 g1/dset4' ############################# -$h5diff file1.h5 file2.h5 -d -4 g1/dset3 g1/dset4 <-d -4> is not a valid option Usage: h5diff file1 file2 [OPTIONS] [obj1[obj2]] @@ -16,7 +15,6 @@ file2 File name of the second HDF5 file [-n count] Print difference up to count number [-d delta] Print difference when it is greater than limit delta [-p relative] Print difference when it is greater than a relative limit -[-a] Compare attributes Items in [] are optional [obj1] and [obj2] are HDF5 objects (datasets, groups or datatypes) diff --git a/tools/testfiles/h5diff_604.txt b/tools/testfiles/h5diff_604.txt index 2b158a8..58f3259 100644 --- a/tools/testfiles/h5diff_604.txt +++ b/tools/testfiles/h5diff_604.txt @@ -1,7 +1,6 @@ ############################# Expected output for 'h5diff file1.h5 file2.h5 -d 0 g1/dset3 g1/dset4' ############################# -$h5diff file1.h5 file2.h5 -d 0 g1/dset3 g1/dset4 <-d 0> is not a valid option Usage: h5diff file1 file2 [OPTIONS] [obj1[obj2]] @@ -16,7 +15,6 @@ file2 File name of the second HDF5 file [-n count] Print difference up to count number [-d delta] Print difference when it is greater than limit delta [-p relative] Print difference when it is greater than a relative limit -[-a] Compare attributes Items in [] are optional [obj1] and [obj2] are HDF5 objects (datasets, groups or datatypes) diff --git a/tools/testfiles/h5diff_605.txt b/tools/testfiles/h5diff_605.txt index 299a5e6..bef85ea 100644 --- a/tools/testfiles/h5diff_605.txt +++ b/tools/testfiles/h5diff_605.txt @@ -1,7 +1,6 @@ ############################# Expected output for 'h5diff file1.h5 file2.h5 -d u g1/dset3 g1/dset4' ############################# -$h5diff file1.h5 file2.h5 -d u g1/dset3 g1/dset4 <-d u> is not a valid option Usage: h5diff file1 file2 [OPTIONS] [obj1[obj2]] @@ -16,7 +15,6 @@ file2 File name of the second HDF5 file [-n count] Print difference up to count number [-d delta] Print difference when it is greater than limit delta [-p relative] Print difference when it is greater than a relative limit -[-a] Compare attributes Items in [] are optional [obj1] and [obj2] are HDF5 objects (datasets, groups or datatypes) diff --git a/tools/testfiles/h5diff_606.txt b/tools/testfiles/h5diff_606.txt index 6bdb8a5..fe5308c 100644 --- a/tools/testfiles/h5diff_606.txt +++ b/tools/testfiles/h5diff_606.txt @@ -1,7 +1,6 @@ ############################# Expected output for 'h5diff file1.h5 file2.h5 -d 0x1 g1/dset3 g1/dset4' ############################# -$h5diff file1.h5 file2.h5 -d 0x1 g1/dset3 g1/dset4 <-d 0x1> is not a valid option Usage: h5diff file1 file2 [OPTIONS] [obj1[obj2]] @@ -16,7 +15,6 @@ file2 File name of the second HDF5 file [-n count] Print difference up to count number [-d delta] Print difference when it is greater than limit delta [-p relative] Print difference when it is greater than a relative limit -[-a] Compare attributes Items in [] are optional [obj1] and [obj2] are HDF5 objects (datasets, groups or datatypes) diff --git a/tools/testfiles/h5diff_607.txt b/tools/testfiles/h5diff_607.txt index 50e8f8d..f7c37d7 100644 --- a/tools/testfiles/h5diff_607.txt +++ b/tools/testfiles/h5diff_607.txt @@ -1,13 +1,12 @@ ############################# Expected output for 'h5diff file1.h5 file2.h5 -d 1 g1/dset3 g1/dset4' ############################# -$h5diff file1.h5 file2.h5 -d 1 g1/dset3 g1/dset4 position dset3 dset4 difference ------------------------------------------------------------ -[ 0 0 ] 100 110 10 -[ 0 1 ] 110 100 10 -[ 1 0 ] 100 90 10 -[ 1 1 ] 100 80 20 -[ 2 0 ] 100 140 40 -[ 2 1 ] 100 200 100 +[ 0 0 ] 100.000000 110.000000 10.000000 +[ 0 1 ] 110.000000 100.000000 10.000000 +[ 1 0 ] 100.000000 90.000000 10.000000 +[ 1 1 ] 100.000000 80.000000 20.000000 +[ 2 0 ] 100.000000 140.000000 40.000000 +[ 2 1 ] 100.000000 200.000000 100.000000 diff --git a/tools/testfiles/h5diff_608.txt b/tools/testfiles/h5diff_608.txt index 50edd51..28bf0bf 100644 --- a/tools/testfiles/h5diff_608.txt +++ b/tools/testfiles/h5diff_608.txt @@ -1,13 +1,12 @@ ############################# Expected output for 'h5diff file1.h5 file2.h5 -d 1 -d 2 g1/dset3 g1/dset4' ############################# -$h5diff file1.h5 file2.h5 -d 1 -d 2 g1/dset3 g1/dset4 position dset3 dset4 difference ------------------------------------------------------------ -[ 0 0 ] 100 110 10 -[ 0 1 ] 110 100 10 -[ 1 0 ] 100 90 10 -[ 1 1 ] 100 80 20 -[ 2 0 ] 100 140 40 -[ 2 1 ] 100 200 100 +[ 0 0 ] 100.000000 110.000000 10.000000 +[ 0 1 ] 110.000000 100.000000 10.000000 +[ 1 0 ] 100.000000 90.000000 10.000000 +[ 1 1 ] 100.000000 80.000000 20.000000 +[ 2 0 ] 100.000000 140.000000 40.000000 +[ 2 1 ] 100.000000 200.000000 100.000000 diff --git a/tools/testfiles/h5diff_609.txt b/tools/testfiles/h5diff_609.txt index f118eb4..c66394a 100644 --- a/tools/testfiles/h5diff_609.txt +++ b/tools/testfiles/h5diff_609.txt @@ -1,5 +1,4 @@ ############################# Expected output for 'h5diff file1.h5 file2.h5 -d 200 g1/dset3 g1/dset4' ############################# -$h5diff file1.h5 file2.h5 -d 200 g1/dset3 g1/dset4 diff --git a/tools/testfiles/h5diff_610.txt b/tools/testfiles/h5diff_610.txt index 50e8f8d..f7c37d7 100644 --- a/tools/testfiles/h5diff_610.txt +++ b/tools/testfiles/h5diff_610.txt @@ -1,13 +1,12 @@ ############################# Expected output for 'h5diff file1.h5 file2.h5 -d 1 g1/dset3 g1/dset4' ############################# -$h5diff file1.h5 file2.h5 -d 1 g1/dset3 g1/dset4 position dset3 dset4 difference ------------------------------------------------------------ -[ 0 0 ] 100 110 10 -[ 0 1 ] 110 100 10 -[ 1 0 ] 100 90 10 -[ 1 1 ] 100 80 20 -[ 2 0 ] 100 140 40 -[ 2 1 ] 100 200 100 +[ 0 0 ] 100.000000 110.000000 10.000000 +[ 0 1 ] 110.000000 100.000000 10.000000 +[ 1 0 ] 100.000000 90.000000 10.000000 +[ 1 1 ] 100.000000 80.000000 20.000000 +[ 2 0 ] 100.000000 140.000000 40.000000 +[ 2 1 ] 100.000000 200.000000 100.000000 diff --git a/tools/testfiles/h5diff_611.txt b/tools/testfiles/h5diff_611.txt index a384386..10dec8f 100644 --- a/tools/testfiles/h5diff_611.txt +++ b/tools/testfiles/h5diff_611.txt @@ -1,7 +1,6 @@ ############################# Expected output for 'h5diff file1.h5 file2.h5 -p g1/dset3 g1/dset4' ############################# -$h5diff file1.h5 file2.h5 -p g1/dset3 g1/dset4 <-p g1/dset3> is not a valid option Usage: h5diff file1 file2 [OPTIONS] [obj1[obj2]] @@ -16,7 +15,6 @@ file2 File name of the second HDF5 file [-n count] Print difference up to count number [-d delta] Print difference when it is greater than limit delta [-p relative] Print difference when it is greater than a relative limit -[-a] Compare attributes Items in [] are optional [obj1] and [obj2] are HDF5 objects (datasets, groups or datatypes) diff --git a/tools/testfiles/h5diff_612.txt b/tools/testfiles/h5diff_612.txt index a327942..98a6183 100644 --- a/tools/testfiles/h5diff_612.txt +++ b/tools/testfiles/h5diff_612.txt @@ -1,7 +1,6 @@ ############################# Expected output for 'h5diff file1.h5 file2.h5 -p -4 g1/dset3 g1/dset4' ############################# -$h5diff file1.h5 file2.h5 -p -4 g1/dset3 g1/dset4 -4 is an invalid option Usage: h5diff file1 file2 [OPTIONS] [obj1[obj2]] @@ -16,7 +15,6 @@ file2 File name of the second HDF5 file [-n count] Print difference up to count number [-d delta] Print difference when it is greater than limit delta [-p relative] Print difference when it is greater than a relative limit -[-a] Compare attributes Items in [] are optional [obj1] and [obj2] are HDF5 objects (datasets, groups or datatypes) diff --git a/tools/testfiles/h5diff_613.txt b/tools/testfiles/h5diff_613.txt index 27ab9f7..61e1d91 100644 --- a/tools/testfiles/h5diff_613.txt +++ b/tools/testfiles/h5diff_613.txt @@ -1,7 +1,6 @@ ############################# Expected output for 'h5diff file1.h5 file2.h5 -p 0 g1/dset3 g1/dset4' ############################# -$h5diff file1.h5 file2.h5 -p 0 g1/dset3 g1/dset4 <-p 0> is not a valid option Usage: h5diff file1 file2 [OPTIONS] [obj1[obj2]] @@ -16,7 +15,6 @@ file2 File name of the second HDF5 file [-n count] Print difference up to count number [-d delta] Print difference when it is greater than limit delta [-p relative] Print difference when it is greater than a relative limit -[-a] Compare attributes Items in [] are optional [obj1] and [obj2] are HDF5 objects (datasets, groups or datatypes) diff --git a/tools/testfiles/h5diff_614.txt b/tools/testfiles/h5diff_614.txt index e7cf2d6..a0a8b49 100644 --- a/tools/testfiles/h5diff_614.txt +++ b/tools/testfiles/h5diff_614.txt @@ -1,7 +1,6 @@ ############################# Expected output for 'h5diff file1.h5 file2.h5 -p u g1/dset3 g1/dset4' ############################# -$h5diff file1.h5 file2.h5 -p u g1/dset3 g1/dset4 <-p u> is not a valid option Usage: h5diff file1 file2 [OPTIONS] [obj1[obj2]] @@ -16,7 +15,6 @@ file2 File name of the second HDF5 file [-n count] Print difference up to count number [-d delta] Print difference when it is greater than limit delta [-p relative] Print difference when it is greater than a relative limit -[-a] Compare attributes Items in [] are optional [obj1] and [obj2] are HDF5 objects (datasets, groups or datatypes) diff --git a/tools/testfiles/h5diff_615.txt b/tools/testfiles/h5diff_615.txt index dce86dc..2f19008 100644 --- a/tools/testfiles/h5diff_615.txt +++ b/tools/testfiles/h5diff_615.txt @@ -1,7 +1,6 @@ ############################# Expected output for 'h5diff file1.h5 file2.h5 -p 0x1 g1/dset3 g1/dset4' ############################# -$h5diff file1.h5 file2.h5 -p 0x1 g1/dset3 g1/dset4 <-p 0x1> is not a valid option Usage: h5diff file1 file2 [OPTIONS] [obj1[obj2]] @@ -16,7 +15,6 @@ file2 File name of the second HDF5 file [-n count] Print difference up to count number [-d delta] Print difference when it is greater than limit delta [-p relative] Print difference when it is greater than a relative limit -[-a] Compare attributes Items in [] are optional [obj1] and [obj2] are HDF5 objects (datasets, groups or datatypes) diff --git a/tools/testfiles/h5diff_616.txt b/tools/testfiles/h5diff_616.txt index d5bbbae..b81fb00 100644 --- a/tools/testfiles/h5diff_616.txt +++ b/tools/testfiles/h5diff_616.txt @@ -1,7 +1,6 @@ ############################# Expected output for 'h5diff file1.h5 file2.h5 -p 0.21 g1/dset3 g1/dset4' ############################# -$h5diff file1.h5 file2.h5 -p 0.21 g1/dset3 g1/dset4 position dset3 dset4 difference relative ------------------------------------------------------------------------ [ 2 0 ] 100 140 40 0.4 diff --git a/tools/testfiles/h5diff_617.txt b/tools/testfiles/h5diff_617.txt index d31c9c9..f6a4480 100644 --- a/tools/testfiles/h5diff_617.txt +++ b/tools/testfiles/h5diff_617.txt @@ -1,7 +1,6 @@ ############################# Expected output for 'h5diff file1.h5 file2.h5 -p 0.21 -p 0.22 g1/dset3 g1/dset4' ############################# -$h5diff file1.h5 file2.h5 -p 0.21 -p 0.22 g1/dset3 g1/dset4 position dset3 dset4 difference relative ------------------------------------------------------------------------ [ 2 0 ] 100 140 40 0.4 diff --git a/tools/testfiles/h5diff_618.txt b/tools/testfiles/h5diff_618.txt index 7ebd2fe..c4840e7 100644 --- a/tools/testfiles/h5diff_618.txt +++ b/tools/testfiles/h5diff_618.txt @@ -1,5 +1,4 @@ ############################# Expected output for 'h5diff file1.h5 file2.h5 -p 2 g1/dset3 g1/dset4' ############################# -$h5diff file1.h5 file2.h5 -p 2 g1/dset3 g1/dset4 diff --git a/tools/testfiles/h5diff_619.txt b/tools/testfiles/h5diff_619.txt index f6f2aa6..2b3987f 100644 --- a/tools/testfiles/h5diff_619.txt +++ b/tools/testfiles/h5diff_619.txt @@ -1,7 +1,6 @@ ############################# Expected output for 'h5diff file1.h5 file2.h5 -p 0.005 g1/dset3 g1/dset4' ############################# -$h5diff file1.h5 file2.h5 -p 0.005 g1/dset3 g1/dset4 position dset3 dset4 difference relative ------------------------------------------------------------------------ [ 0 0 ] 100 110 10 0.1 diff --git a/tools/testfiles/h5diff_620.txt b/tools/testfiles/h5diff_620.txt index fd1b155..2d01f76de 100644 --- a/tools/testfiles/h5diff_620.txt +++ b/tools/testfiles/h5diff_620.txt @@ -1,7 +1,6 @@ ############################# Expected output for 'h5diff file1.h5 file2.h5 -n g1/dset3 g1/dset4' ############################# -$h5diff file1.h5 file2.h5 -n g1/dset3 g1/dset4 <-n g1/dset3> is not a valid option Usage: h5diff file1 file2 [OPTIONS] [obj1[obj2]] @@ -16,7 +15,6 @@ file2 File name of the second HDF5 file [-n count] Print difference up to count number [-d delta] Print difference when it is greater than limit delta [-p relative] Print difference when it is greater than a relative limit -[-a] Compare attributes Items in [] are optional [obj1] and [obj2] are HDF5 objects (datasets, groups or datatypes) diff --git a/tools/testfiles/h5diff_621.txt b/tools/testfiles/h5diff_621.txt index 40f9d02..d6b2024 100644 --- a/tools/testfiles/h5diff_621.txt +++ b/tools/testfiles/h5diff_621.txt @@ -1,7 +1,6 @@ ############################# Expected output for 'h5diff file1.h5 file2.h5 -n -4 g1/dset3 g1/dset4' ############################# -$h5diff file1.h5 file2.h5 -n -4 g1/dset3 g1/dset4 -4 is an invalid option Usage: h5diff file1 file2 [OPTIONS] [obj1[obj2]] @@ -16,7 +15,6 @@ file2 File name of the second HDF5 file [-n count] Print difference up to count number [-d delta] Print difference when it is greater than limit delta [-p relative] Print difference when it is greater than a relative limit -[-a] Compare attributes Items in [] are optional [obj1] and [obj2] are HDF5 objects (datasets, groups or datatypes) diff --git a/tools/testfiles/h5diff_622.txt b/tools/testfiles/h5diff_622.txt index 98f1008..5d082eb 100644 --- a/tools/testfiles/h5diff_622.txt +++ b/tools/testfiles/h5diff_622.txt @@ -1,7 +1,6 @@ ############################# Expected output for 'h5diff file1.h5 file2.h5 -n 0 g1/dset3 g1/dset4' ############################# -$h5diff file1.h5 file2.h5 -n 0 g1/dset3 g1/dset4 <-n 0> is not a valid option Usage: h5diff file1 file2 [OPTIONS] [obj1[obj2]] @@ -16,7 +15,6 @@ file2 File name of the second HDF5 file [-n count] Print difference up to count number [-d delta] Print difference when it is greater than limit delta [-p relative] Print difference when it is greater than a relative limit -[-a] Compare attributes Items in [] are optional [obj1] and [obj2] are HDF5 objects (datasets, groups or datatypes) diff --git a/tools/testfiles/h5diff_623.txt b/tools/testfiles/h5diff_623.txt index cfb2e01..6bfe66b 100644 --- a/tools/testfiles/h5diff_623.txt +++ b/tools/testfiles/h5diff_623.txt @@ -1,7 +1,6 @@ ############################# Expected output for 'h5diff file1.h5 file2.h5 -n u g1/dset3 g1/dset4' ############################# -$h5diff file1.h5 file2.h5 -n u g1/dset3 g1/dset4 <-n u> is not a valid option Usage: h5diff file1 file2 [OPTIONS] [obj1[obj2]] @@ -16,7 +15,6 @@ file2 File name of the second HDF5 file [-n count] Print difference up to count number [-d delta] Print difference when it is greater than limit delta [-p relative] Print difference when it is greater than a relative limit -[-a] Compare attributes Items in [] are optional [obj1] and [obj2] are HDF5 objects (datasets, groups or datatypes) diff --git a/tools/testfiles/h5diff_624.txt b/tools/testfiles/h5diff_624.txt index a547aa5..9feda50 100644 --- a/tools/testfiles/h5diff_624.txt +++ b/tools/testfiles/h5diff_624.txt @@ -1,7 +1,6 @@ ############################# Expected output for 'h5diff file1.h5 file2.h5 -n 0x1 g1/dset3 g1/dset4' ############################# -$h5diff file1.h5 file2.h5 -n 0x1 g1/dset3 g1/dset4 <-n 0x1> is not a valid option Usage: h5diff file1 file2 [OPTIONS] [obj1[obj2]] @@ -16,7 +15,6 @@ file2 File name of the second HDF5 file [-n count] Print difference up to count number [-d delta] Print difference when it is greater than limit delta [-p relative] Print difference when it is greater than a relative limit -[-a] Compare attributes Items in [] are optional [obj1] and [obj2] are HDF5 objects (datasets, groups or datatypes) diff --git a/tools/testfiles/h5diff_625.txt b/tools/testfiles/h5diff_625.txt index e354988..7aab196 100644 --- a/tools/testfiles/h5diff_625.txt +++ b/tools/testfiles/h5diff_625.txt @@ -1,9 +1,6 @@ ############################# Expected output for 'h5diff file1.h5 file2.h5 -n 2 g1/dset3 g1/dset4' ############################# -$h5diff file1.h5 file2.h5 -n 2 g1/dset3 g1/dset4 -position dset3 dset4 difference ------------------------------------------------------------- -[ 0 0 ] 100 110 10 -[ 0 1 ] 110 100 10 +Object <2> could not be found in +Object could not be found in diff --git a/tools/testfiles/h5diff_626.txt b/tools/testfiles/h5diff_626.txt index 4e23b34..498f9df 100644 --- a/tools/testfiles/h5diff_626.txt +++ b/tools/testfiles/h5diff_626.txt @@ -1,10 +1,6 @@ ############################# Expected output for 'h5diff file1.h5 file2.h5 -n 2 -n 3 g1/dset3 g1/dset4' ############################# -$h5diff file1.h5 file2.h5 -n 2 -n 3 g1/dset3 g1/dset4 -position dset3 dset4 difference ------------------------------------------------------------- -[ 0 0 ] 100 110 10 -[ 0 1 ] 110 100 10 -[ 1 0 ] 100 90 10 +Object <2> could not be found in +Object <2> could not be found in diff --git a/tools/testfiles/h5diff_627.txt b/tools/testfiles/h5diff_627.txt index 6523010..4e26443 100644 --- a/tools/testfiles/h5diff_627.txt +++ b/tools/testfiles/h5diff_627.txt @@ -1,13 +1,6 @@ ############################# Expected output for 'h5diff file1.h5 file2.h5 -n 200 g1/dset3 g1/dset4' ############################# -$h5diff file1.h5 file2.h5 -n 200 g1/dset3 g1/dset4 -position dset3 dset4 difference ------------------------------------------------------------- -[ 0 0 ] 100 110 10 -[ 0 1 ] 110 100 10 -[ 1 0 ] 100 90 10 -[ 1 1 ] 100 80 20 -[ 2 0 ] 100 140 40 -[ 2 1 ] 100 200 100 +Object <200> could not be found in +Object could not be found in diff --git a/tools/testfiles/h5diff_628.txt b/tools/testfiles/h5diff_628.txt index ab6585b..ddf9e7d 100644 --- a/tools/testfiles/h5diff_628.txt +++ b/tools/testfiles/h5diff_628.txt @@ -1,8 +1,6 @@ ############################# Expected output for 'h5diff file1.h5 file2.h5 -n 1 g1/dset3 g1/dset4' ############################# -$h5diff file1.h5 file2.h5 -n 1 g1/dset3 g1/dset4 -position dset3 dset4 difference ------------------------------------------------------------- -[ 0 0 ] 100 110 10 +Object <1> could not be found in +Object could not be found in diff --git a/tools/testfiles/h5diff_629.txt b/tools/testfiles/h5diff_629.txt index 75015f1..f41a971 100644 --- a/tools/testfiles/h5diff_629.txt +++ b/tools/testfiles/h5diff_629.txt @@ -1,7 +1,6 @@ ############################# Expected output for 'h5diff file1.h6 file2.h6' ############################# -$h5diff file1.h6 file2.h6 h5diff: file1.h6: No such file or directory h5diff: file2.h6: No such file or directory diff --git a/tools/testfiles/h5diff_70.txt b/tools/testfiles/h5diff_70.txt new file mode 100644 index 0000000..45ba341 --- /dev/null +++ b/tools/testfiles/h5diff_70.txt @@ -0,0 +1,514 @@ +############################# +Expected output for 'h5diff file5.h5 file6.h5' +############################# +position string of string of difference +------------------------------------------------------------ +[ 0 ] a z +[ 0 ] b z +[ 1 ] d z +[ 1 ] e z +position bitfield of bitfield of difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 1 ] 2 0 2 +position opaque of opaque of difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 1 ] 2 0 2 +position compound of compound of difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 0 ] 2.000000 0.000000 2.000000 +[ 1 ] 3 0 3 +[ 1 ] 4.000000 0.000000 4.000000 +position enum of enum of difference +------------------------------------------------------------ +[ 0 ] RED GREEN +[ 1 ] RED GREEN +position vlen of vlen of difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 1 ] 2 0 2 +[ 1 ] 3 0 3 +position array of array of difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 0 ] 2 0 2 +[ 0 ] 3 0 3 +[ 1 ] 4 0 4 +[ 1 ] 5 0 5 +[ 1 ] 6 0 6 +position integer of integer of difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 1 ] 2 0 2 +position float of float of difference +------------------------------------------------------------ +[ 0 ] 1.000000 0.000000 1.000000 +[ 1 ] 2.000000 0.000000 2.000000 +position string2D of string2D of difference +------------------------------------------------------------ +[ 0 0 ] a z +[ 0 0 ] b z +[ 0 1 ] c z +[ 0 1 ] d z +[ 1 0 ] e z +[ 1 0 ] f z +[ 1 1 ] g z +[ 1 1 ] h z +[ 2 0 ] i z +[ 2 0 ] j z +[ 2 1 ] k z +[ 2 1 ] l z +position bitfield2D of bitfield2D of difference +------------------------------------------------------------ +[ 0 0 ] 1 0 1 +[ 0 1 ] 2 0 2 +[ 1 0 ] 3 0 3 +[ 1 1 ] 4 0 4 +[ 2 0 ] 5 0 5 +[ 2 1 ] 6 0 6 +position opaque2D of opaque2D of difference +------------------------------------------------------------ +[ 0 0 ] 1 0 1 +[ 0 1 ] 2 0 2 +[ 1 0 ] 3 0 3 +[ 1 1 ] 4 0 4 +[ 2 0 ] 5 0 5 +[ 2 1 ] 6 0 6 +position compound2D of compound2D of difference +------------------------------------------------------------ +[ 0 0 ] 1 0 1 +[ 0 0 ] 2.000000 0.000000 2.000000 +[ 0 1 ] 3 0 3 +[ 0 1 ] 4.000000 0.000000 4.000000 +[ 1 0 ] 5 0 5 +[ 1 0 ] 6.000000 0.000000 6.000000 +[ 1 1 ] 7 0 7 +[ 1 1 ] 8.000000 0.000000 8.000000 +[ 2 0 ] 9 0 9 +[ 2 0 ] 10.000000 0.000000 10.000000 +[ 2 1 ] 11 0 11 +[ 2 1 ] 12.000000 0.000000 12.000000 +position enum2D of enum2D of difference +------------------------------------------------------------ +[ 0 0 ] RED GREEN +[ 0 1 ] RED GREEN +[ 1 0 ] RED GREEN +[ 1 1 ] RED GREEN +[ 2 0 ] RED GREEN +[ 2 1 ] RED GREEN +position vlen2D of vlen2D of difference +------------------------------------------------------------ +[ 0 1 ] 1 0 1 +[ 1 0 ] 2 0 2 +[ 1 0 ] 3 0 3 +[ 1 1 ] 4 0 4 +[ 1 1 ] 5 0 5 +[ 2 0 ] 6 0 6 +[ 2 0 ] 7 0 7 +[ 2 0 ] 8 0 8 +[ 2 1 ] 9 0 9 +[ 2 1 ] 10 0 10 +[ 2 1 ] 11 0 11 +position array2D of array2D of difference +------------------------------------------------------------ +[ 0 0 ] 1 0 1 +[ 0 0 ] 2 0 2 +[ 0 0 ] 3 0 3 +[ 0 1 ] 4 0 4 +[ 0 1 ] 5 0 5 +[ 0 1 ] 6 0 6 +[ 1 0 ] 7 0 7 +[ 1 0 ] 8 0 8 +[ 1 0 ] 9 0 9 +[ 1 1 ] 10 0 10 +[ 1 1 ] 11 0 11 +[ 1 1 ] 12 0 12 +[ 2 0 ] 13 0 13 +[ 2 0 ] 14 0 14 +[ 2 0 ] 15 0 15 +[ 2 1 ] 16 0 16 +[ 2 1 ] 17 0 17 +[ 2 1 ] 18 0 18 +position integer2D of integer2D of difference +------------------------------------------------------------ +[ 0 0 ] 1 0 1 +[ 0 1 ] 2 0 2 +[ 1 0 ] 3 0 3 +[ 1 1 ] 4 0 4 +[ 2 0 ] 5 0 5 +[ 2 1 ] 6 0 6 +position float2D of float2D of difference +------------------------------------------------------------ +[ 0 0 ] 1.000000 0.000000 1.000000 +[ 0 1 ] 2.000000 0.000000 2.000000 +[ 1 0 ] 3.000000 0.000000 3.000000 +[ 1 1 ] 4.000000 0.000000 4.000000 +[ 2 0 ] 5.000000 0.000000 5.000000 +[ 2 1 ] 6.000000 0.000000 6.000000 +position string3D of string3D of difference +------------------------------------------------------------ +[ 0 0 0 ] a z +[ 0 0 0 ] b z +[ 0 0 1 ] c z +[ 0 0 1 ] d z +[ 0 1 0 ] e z +[ 0 1 0 ] f z +[ 0 1 1 ] g z +[ 0 1 1 ] h z +[ 0 2 0 ] i z +[ 0 2 0 ] j z +[ 0 2 1 ] k z +[ 0 2 1 ] l z +[ 1 0 0 ] m z +[ 1 0 0 ] n z +[ 1 0 1 ] p z +[ 1 0 1 ] q z +[ 1 1 0 ] r z +[ 1 1 0 ] s z +[ 1 1 1 ] t z +[ 1 1 1 ] u z +[ 1 2 0 ] v z +[ 1 2 0 ] w z +[ 1 2 1 ] x z +[ 2 0 0 ] A z +[ 2 0 0 ] B z +[ 2 0 1 ] C z +[ 2 0 1 ] D z +[ 2 1 0 ] E z +[ 2 1 0 ] F z +[ 2 1 1 ] G z +[ 2 1 1 ] H z +[ 2 2 0 ] I z +[ 2 2 0 ] J z +[ 2 2 1 ] K z +[ 2 2 1 ] L z +[ 3 0 0 ] M z +[ 3 0 0 ] N z +[ 3 0 1 ] P z +[ 3 0 1 ] Q z +[ 3 1 0 ] R z +[ 3 1 0 ] S z +[ 3 1 1 ] T z +[ 3 1 1 ] U z +[ 3 2 0 ] V z +[ 3 2 0 ] W z +[ 3 2 1 ] X z +[ 3 2 1 ] Z z +position bitfield3D of bitfield3D of difference +------------------------------------------------------------ +[ 0 0 0 ] 1 0 1 +[ 0 0 1 ] 2 0 2 +[ 0 1 0 ] 3 0 3 +[ 0 1 1 ] 4 0 4 +[ 0 2 0 ] 5 0 5 +[ 0 2 1 ] 6 0 6 +[ 1 0 0 ] 7 0 7 +[ 1 0 1 ] 8 0 8 +[ 1 1 0 ] 9 0 9 +[ 1 1 1 ] 10 0 10 +[ 1 2 0 ] 11 0 11 +[ 1 2 1 ] 12 0 12 +[ 2 0 0 ] 13 0 13 +[ 2 0 1 ] 14 0 14 +[ 2 1 0 ] 15 0 15 +[ 2 1 1 ] 16 0 16 +[ 2 2 0 ] 17 0 17 +[ 2 2 1 ] 18 0 18 +[ 3 0 0 ] 19 0 19 +[ 3 0 1 ] 20 0 20 +[ 3 1 0 ] 21 0 21 +[ 3 1 1 ] 22 0 22 +[ 3 2 0 ] 23 0 23 +[ 3 2 1 ] 24 0 24 +position opaque3D of opaque3D of difference +------------------------------------------------------------ +[ 0 0 0 ] 1 0 1 +[ 0 0 1 ] 2 0 2 +[ 0 1 0 ] 3 0 3 +[ 0 1 1 ] 4 0 4 +[ 0 2 0 ] 5 0 5 +[ 0 2 1 ] 6 0 6 +[ 1 0 0 ] 7 0 7 +[ 1 0 1 ] 8 0 8 +[ 1 1 0 ] 9 0 9 +[ 1 1 1 ] 10 0 10 +[ 1 2 0 ] 11 0 11 +[ 1 2 1 ] 12 0 12 +[ 2 0 0 ] 13 0 13 +[ 2 0 1 ] 14 0 14 +[ 2 1 0 ] 15 0 15 +[ 2 1 1 ] 16 0 16 +[ 2 2 0 ] 17 0 17 +[ 2 2 1 ] 18 0 18 +[ 3 0 0 ] 19 0 19 +[ 3 0 1 ] 20 0 20 +[ 3 1 0 ] 21 0 21 +[ 3 1 1 ] 22 0 22 +[ 3 2 0 ] 23 0 23 +[ 3 2 1 ] 24 0 24 +position compound3D of compound3D of difference +------------------------------------------------------------ +[ 0 0 0 ] 1 0 1 +[ 0 0 0 ] 2.000000 0.000000 2.000000 +[ 0 0 1 ] 3 0 3 +[ 0 0 1 ] 4.000000 0.000000 4.000000 +[ 0 1 0 ] 5 0 5 +[ 0 1 0 ] 6.000000 0.000000 6.000000 +[ 0 1 1 ] 7 0 7 +[ 0 1 1 ] 8.000000 0.000000 8.000000 +[ 0 2 0 ] 9 0 9 +[ 0 2 0 ] 10.000000 0.000000 10.000000 +[ 0 2 1 ] 11 0 11 +[ 0 2 1 ] 12.000000 0.000000 12.000000 +[ 1 0 0 ] 13 0 13 +[ 1 0 0 ] 14.000000 0.000000 14.000000 +[ 1 0 1 ] 15 0 15 +[ 1 0 1 ] 16.000000 0.000000 16.000000 +[ 1 1 0 ] 17 0 17 +[ 1 1 0 ] 18.000000 0.000000 18.000000 +[ 1 1 1 ] 19 0 19 +[ 1 1 1 ] 20.000000 0.000000 20.000000 +[ 1 2 0 ] 21 0 21 +[ 1 2 0 ] 22.000000 0.000000 22.000000 +[ 1 2 1 ] 23 0 23 +[ 1 2 1 ] 24.000000 0.000000 24.000000 +[ 2 0 0 ] 25 0 25 +[ 2 0 0 ] 26.000000 0.000000 26.000000 +[ 2 0 1 ] 27 0 27 +[ 2 0 1 ] 28.000000 0.000000 28.000000 +[ 2 1 0 ] 29 0 29 +[ 2 1 0 ] 30.000000 0.000000 30.000000 +[ 2 1 1 ] 31 0 31 +[ 2 1 1 ] 32.000000 0.000000 32.000000 +[ 2 2 0 ] 33 0 33 +[ 2 2 0 ] 34.000000 0.000000 34.000000 +[ 2 2 1 ] 35 0 35 +[ 2 2 1 ] 36.000000 0.000000 36.000000 +[ 3 0 0 ] 37 0 37 +[ 3 0 0 ] 38.000000 0.000000 38.000000 +[ 3 0 1 ] 39 0 39 +[ 3 0 1 ] 40.000000 0.000000 40.000000 +[ 3 1 0 ] 41 0 41 +[ 3 1 0 ] 42.000000 0.000000 42.000000 +[ 3 1 1 ] 43 0 43 +[ 3 1 1 ] 44.000000 0.000000 44.000000 +[ 3 2 0 ] 45 0 45 +[ 3 2 0 ] 46.000000 0.000000 46.000000 +[ 3 2 1 ] 47 0 47 +[ 3 2 1 ] 48.000000 0.000000 48.000000 +position enum3D of enum3D of difference +------------------------------------------------------------ +[ 0 0 0 ] GREEN RED +[ 0 0 1 ] GREEN RED +[ 0 1 0 ] GREEN RED +[ 0 1 1 ] GREEN RED +[ 0 2 0 ] GREEN RED +[ 0 2 1 ] GREEN RED +[ 1 0 0 ] GREEN RED +[ 1 0 1 ] GREEN RED +[ 1 1 0 ] GREEN RED +[ 1 1 1 ] GREEN RED +[ 1 2 0 ] GREEN RED +[ 1 2 1 ] GREEN RED +[ 2 0 0 ] GREEN RED +[ 2 0 1 ] GREEN RED +[ 2 1 0 ] GREEN RED +[ 2 1 1 ] GREEN RED +[ 2 2 0 ] GREEN RED +[ 2 2 1 ] GREEN RED +[ 3 0 0 ] GREEN RED +[ 3 0 1 ] GREEN RED +[ 3 1 0 ] GREEN RED +[ 3 1 1 ] GREEN RED +[ 3 2 0 ] GREEN RED +[ 3 2 1 ] GREEN RED +position vlen3D of vlen3D of difference +------------------------------------------------------------ +[ 0 0 1 ] 1 0 1 +[ 0 1 0 ] 2 0 2 +[ 0 1 1 ] 3 0 3 +[ 0 2 0 ] 4 0 4 +[ 0 2 1 ] 5 0 5 +[ 1 0 0 ] 6 0 6 +[ 1 0 0 ] 7 0 7 +[ 1 0 1 ] 8 0 8 +[ 1 0 1 ] 9 0 9 +[ 1 1 0 ] 10 0 10 +[ 1 1 0 ] 11 0 11 +[ 1 1 1 ] 12 0 12 +[ 1 1 1 ] 13 0 13 +[ 1 2 0 ] 14 0 14 +[ 1 2 0 ] 15 0 15 +[ 1 2 1 ] 16 0 16 +[ 1 2 1 ] 17 0 17 +[ 2 0 0 ] 18 0 18 +[ 2 0 0 ] 19 0 19 +[ 2 0 0 ] 20 0 20 +[ 2 0 1 ] 21 0 21 +[ 2 0 1 ] 22 0 22 +[ 2 0 1 ] 23 0 23 +[ 2 1 0 ] 24 0 24 +[ 2 1 0 ] 25 0 25 +[ 2 1 0 ] 26 0 26 +[ 2 1 1 ] 27 0 27 +[ 2 1 1 ] 28 0 28 +[ 2 1 1 ] 29 0 29 +[ 2 2 0 ] 30 0 30 +[ 2 2 0 ] 31 0 31 +[ 2 2 0 ] 32 0 32 +[ 2 2 1 ] 33 0 33 +[ 2 2 1 ] 34 0 34 +[ 2 2 1 ] 35 0 35 +[ 3 0 0 ] 36 0 36 +[ 3 0 0 ] 37 0 37 +[ 3 0 0 ] 38 0 38 +[ 3 0 0 ] 39 0 39 +[ 3 0 1 ] 40 0 40 +[ 3 0 1 ] 41 0 41 +[ 3 0 1 ] 42 0 42 +[ 3 0 1 ] 43 0 43 +[ 3 1 0 ] 44 0 44 +[ 3 1 0 ] 45 0 45 +[ 3 1 0 ] 46 0 46 +[ 3 1 0 ] 47 0 47 +[ 3 1 1 ] 48 0 48 +[ 3 1 1 ] 49 0 49 +[ 3 1 1 ] 50 0 50 +[ 3 1 1 ] 51 0 51 +[ 3 2 0 ] 52 0 52 +[ 3 2 0 ] 53 0 53 +[ 3 2 0 ] 54 0 54 +[ 3 2 0 ] 55 0 55 +[ 3 2 1 ] 56 0 56 +[ 3 2 1 ] 57 0 57 +[ 3 2 1 ] 58 0 58 +[ 3 2 1 ] 59 0 59 +position array3D of array3D of difference +------------------------------------------------------------ +[ 0 0 0 ] 1 0 1 +[ 0 0 0 ] 2 0 2 +[ 0 0 0 ] 3 0 3 +[ 0 0 1 ] 4 0 4 +[ 0 0 1 ] 5 0 5 +[ 0 0 1 ] 6 0 6 +[ 0 1 0 ] 7 0 7 +[ 0 1 0 ] 8 0 8 +[ 0 1 0 ] 9 0 9 +[ 0 1 1 ] 10 0 10 +[ 0 1 1 ] 11 0 11 +[ 0 1 1 ] 12 0 12 +[ 0 2 0 ] 13 0 13 +[ 0 2 0 ] 14 0 14 +[ 0 2 0 ] 15 0 15 +[ 0 2 1 ] 16 0 16 +[ 0 2 1 ] 17 0 17 +[ 0 2 1 ] 18 0 18 +[ 1 0 0 ] 19 0 19 +[ 1 0 0 ] 20 0 20 +[ 1 0 0 ] 21 0 21 +[ 1 0 1 ] 22 0 22 +[ 1 0 1 ] 23 0 23 +[ 1 0 1 ] 24 0 24 +[ 1 1 0 ] 25 0 25 +[ 1 1 0 ] 26 0 26 +[ 1 1 0 ] 27 0 27 +[ 1 1 1 ] 28 0 28 +[ 1 1 1 ] 29 0 29 +[ 1 1 1 ] 30 0 30 +[ 1 2 0 ] 31 0 31 +[ 1 2 0 ] 32 0 32 +[ 1 2 0 ] 33 0 33 +[ 1 2 1 ] 34 0 34 +[ 1 2 1 ] 35 0 35 +[ 1 2 1 ] 36 0 36 +[ 2 0 0 ] 37 0 37 +[ 2 0 0 ] 38 0 38 +[ 2 0 0 ] 39 0 39 +[ 2 0 1 ] 40 0 40 +[ 2 0 1 ] 41 0 41 +[ 2 0 1 ] 42 0 42 +[ 2 1 0 ] 43 0 43 +[ 2 1 0 ] 44 0 44 +[ 2 1 0 ] 45 0 45 +[ 2 1 1 ] 46 0 46 +[ 2 1 1 ] 47 0 47 +[ 2 1 1 ] 48 0 48 +[ 2 2 0 ] 49 0 49 +[ 2 2 0 ] 50 0 50 +[ 2 2 0 ] 51 0 51 +[ 2 2 1 ] 52 0 52 +[ 2 2 1 ] 53 0 53 +[ 2 2 1 ] 54 0 54 +[ 3 0 0 ] 55 0 55 +[ 3 0 0 ] 56 0 56 +[ 3 0 0 ] 57 0 57 +[ 3 0 1 ] 58 0 58 +[ 3 0 1 ] 59 0 59 +[ 3 0 1 ] 60 0 60 +[ 3 1 0 ] 61 0 61 +[ 3 1 0 ] 62 0 62 +[ 3 1 0 ] 63 0 63 +[ 3 1 1 ] 64 0 64 +[ 3 1 1 ] 65 0 65 +[ 3 1 1 ] 66 0 66 +[ 3 2 0 ] 67 0 67 +[ 3 2 0 ] 68 0 68 +[ 3 2 0 ] 69 0 69 +[ 3 2 1 ] 70 0 70 +[ 3 2 1 ] 71 0 71 +[ 3 2 1 ] 72 0 72 +position integer3D of integer3D of difference +------------------------------------------------------------ +[ 0 0 0 ] 1 0 1 +[ 0 0 1 ] 2 0 2 +[ 0 1 0 ] 3 0 3 +[ 0 1 1 ] 4 0 4 +[ 0 2 0 ] 5 0 5 +[ 0 2 1 ] 6 0 6 +[ 1 0 0 ] 7 0 7 +[ 1 0 1 ] 8 0 8 +[ 1 1 0 ] 9 0 9 +[ 1 1 1 ] 10 0 10 +[ 1 2 0 ] 11 0 11 +[ 1 2 1 ] 12 0 12 +[ 2 0 0 ] 13 0 13 +[ 2 0 1 ] 14 0 14 +[ 2 1 0 ] 15 0 15 +[ 2 1 1 ] 16 0 16 +[ 2 2 0 ] 17 0 17 +[ 2 2 1 ] 18 0 18 +[ 3 0 0 ] 19 0 19 +[ 3 0 1 ] 20 0 20 +[ 3 1 0 ] 21 0 21 +[ 3 1 1 ] 22 0 22 +[ 3 2 0 ] 23 0 23 +[ 3 2 1 ] 24 0 24 +position float3D of float3D of difference +------------------------------------------------------------ +[ 0 0 0 ] 1.000000 0.000000 1.000000 +[ 0 0 1 ] 2.000000 0.000000 2.000000 +[ 0 1 0 ] 3.000000 0.000000 3.000000 +[ 0 1 1 ] 4.000000 0.000000 4.000000 +[ 0 2 0 ] 5.000000 0.000000 5.000000 +[ 0 2 1 ] 6.000000 0.000000 6.000000 +[ 1 0 0 ] 7.000000 0.000000 7.000000 +[ 1 0 1 ] 8.000000 0.000000 8.000000 +[ 1 1 0 ] 9.000000 0.000000 9.000000 +[ 1 1 1 ] 10.000000 0.000000 10.000000 +[ 1 2 0 ] 11.000000 0.000000 11.000000 +[ 1 2 1 ] 12.000000 0.000000 12.000000 +[ 2 0 0 ] 13.000000 0.000000 13.000000 +[ 2 0 1 ] 14.000000 0.000000 14.000000 +[ 2 1 0 ] 15.000000 0.000000 15.000000 +[ 2 1 1 ] 16.000000 0.000000 16.000000 +[ 2 2 0 ] 17.000000 0.000000 17.000000 +[ 2 2 1 ] 18.000000 0.000000 18.000000 +[ 3 0 0 ] 19.000000 0.000000 19.000000 +[ 3 0 1 ] 20.000000 0.000000 20.000000 +[ 3 1 0 ] 21.000000 0.000000 21.000000 +[ 3 1 1 ] 22.000000 0.000000 22.000000 +[ 3 2 0 ] 23.000000 0.000000 23.000000 +[ 3 2 1 ] 24.000000 0.000000 24.000000 + diff --git a/tools/testfiles/h5diff_80.txt b/tools/testfiles/h5diff_80.txt new file mode 100644 index 0000000..44cf823 --- /dev/null +++ b/tools/testfiles/h5diff_80.txt @@ -0,0 +1,611 @@ +############################# +Expected output for 'h5diff file7.h5 file8.h5' +############################# +position dset dset difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 1 ] 2 0 2 +position array array difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 0 ] 2 0 2 +[ 0 ] 3 0 3 +[ 1 ] 4 0 4 +[ 1 ] 5 0 5 +[ 1 ] 6 0 6 +position array2D array2D difference +------------------------------------------------------------ +[ 0 0 ] 1 0 1 +[ 0 0 ] 2 0 2 +[ 0 0 ] 3 0 3 +[ 0 1 ] 4 0 4 +[ 0 1 ] 5 0 5 +[ 0 1 ] 6 0 6 +[ 1 0 ] 7 0 7 +[ 1 0 ] 8 0 8 +[ 1 0 ] 9 0 9 +[ 1 1 ] 10 0 10 +[ 1 1 ] 11 0 11 +[ 1 1 ] 12 0 12 +[ 2 0 ] 13 0 13 +[ 2 0 ] 14 0 14 +[ 2 0 ] 15 0 15 +[ 2 1 ] 16 0 16 +[ 2 1 ] 17 0 17 +[ 2 1 ] 18 0 18 +position array3D array3D difference +------------------------------------------------------------ +[ 0 0 0 ] 1 0 1 +[ 0 0 0 ] 2 0 2 +[ 0 0 0 ] 3 0 3 +[ 0 0 1 ] 4 0 4 +[ 0 0 1 ] 5 0 5 +[ 0 0 1 ] 6 0 6 +[ 0 1 0 ] 7 0 7 +[ 0 1 0 ] 8 0 8 +[ 0 1 0 ] 9 0 9 +[ 0 1 1 ] 10 0 10 +[ 0 1 1 ] 11 0 11 +[ 0 1 1 ] 12 0 12 +[ 0 2 0 ] 13 0 13 +[ 0 2 0 ] 14 0 14 +[ 0 2 0 ] 15 0 15 +[ 0 2 1 ] 16 0 16 +[ 0 2 1 ] 17 0 17 +[ 0 2 1 ] 18 0 18 +[ 1 0 0 ] 19 0 19 +[ 1 0 0 ] 20 0 20 +[ 1 0 0 ] 21 0 21 +[ 1 0 1 ] 22 0 22 +[ 1 0 1 ] 23 0 23 +[ 1 0 1 ] 24 0 24 +[ 1 1 0 ] 25 0 25 +[ 1 1 0 ] 26 0 26 +[ 1 1 0 ] 27 0 27 +[ 1 1 1 ] 28 0 28 +[ 1 1 1 ] 29 0 29 +[ 1 1 1 ] 30 0 30 +[ 1 2 0 ] 31 0 31 +[ 1 2 0 ] 32 0 32 +[ 1 2 0 ] 33 0 33 +[ 1 2 1 ] 34 0 34 +[ 1 2 1 ] 35 0 35 +[ 1 2 1 ] 36 0 36 +[ 2 0 0 ] 37 0 37 +[ 2 0 0 ] 38 0 38 +[ 2 0 0 ] 39 0 39 +[ 2 0 1 ] 40 0 40 +[ 2 0 1 ] 41 0 41 +[ 2 0 1 ] 42 0 42 +[ 2 1 0 ] 43 0 43 +[ 2 1 0 ] 44 0 44 +[ 2 1 0 ] 45 0 45 +[ 2 1 1 ] 46 0 46 +[ 2 1 1 ] 47 0 47 +[ 2 1 1 ] 48 0 48 +[ 2 2 0 ] 49 0 49 +[ 2 2 0 ] 50 0 50 +[ 2 2 0 ] 51 0 51 +[ 2 2 1 ] 52 0 52 +[ 2 2 1 ] 53 0 53 +[ 2 2 1 ] 54 0 54 +[ 3 0 0 ] 55 0 55 +[ 3 0 0 ] 56 0 56 +[ 3 0 0 ] 57 0 57 +[ 3 0 1 ] 58 0 58 +[ 3 0 1 ] 59 0 59 +[ 3 0 1 ] 60 0 60 +[ 3 1 0 ] 61 0 61 +[ 3 1 0 ] 62 0 62 +[ 3 1 0 ] 63 0 63 +[ 3 1 1 ] 64 0 64 +[ 3 1 1 ] 65 0 65 +[ 3 1 1 ] 66 0 66 +[ 3 2 0 ] 67 0 67 +[ 3 2 0 ] 68 0 68 +[ 3 2 0 ] 69 0 69 +[ 3 2 1 ] 70 0 70 +[ 3 2 1 ] 71 0 71 +[ 3 2 1 ] 72 0 72 +position bitfield bitfield difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 1 ] 2 0 2 +position bitfield2D bitfield2D difference +------------------------------------------------------------ +[ 0 0 ] 1 0 1 +[ 0 1 ] 2 0 2 +[ 1 0 ] 3 0 3 +[ 1 1 ] 4 0 4 +[ 2 0 ] 5 0 5 +[ 2 1 ] 6 0 6 +position bitfield3D bitfield3D difference +------------------------------------------------------------ +[ 0 0 0 ] 1 0 1 +[ 0 0 1 ] 2 0 2 +[ 0 1 0 ] 3 0 3 +[ 0 1 1 ] 4 0 4 +[ 0 2 0 ] 5 0 5 +[ 0 2 1 ] 6 0 6 +[ 1 0 0 ] 7 0 7 +[ 1 0 1 ] 8 0 8 +[ 1 1 0 ] 9 0 9 +[ 1 1 1 ] 10 0 10 +[ 1 2 0 ] 11 0 11 +[ 1 2 1 ] 12 0 12 +[ 2 0 0 ] 13 0 13 +[ 2 0 1 ] 14 0 14 +[ 2 1 0 ] 15 0 15 +[ 2 1 1 ] 16 0 16 +[ 2 2 0 ] 17 0 17 +[ 2 2 1 ] 18 0 18 +[ 3 0 0 ] 19 0 19 +[ 3 0 1 ] 20 0 20 +[ 3 1 0 ] 21 0 21 +[ 3 1 1 ] 22 0 22 +[ 3 2 0 ] 23 0 23 +[ 3 2 1 ] 24 0 24 +position compound compound difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 0 ] 2.000000 0.000000 2.000000 +[ 1 ] 3 0 3 +[ 1 ] 4.000000 0.000000 4.000000 +position compound2D compound2D difference +------------------------------------------------------------ +[ 0 0 ] 1 0 1 +[ 0 0 ] 2.000000 0.000000 2.000000 +[ 0 1 ] 3 0 3 +[ 0 1 ] 4.000000 0.000000 4.000000 +[ 1 0 ] 5 0 5 +[ 1 0 ] 6.000000 0.000000 6.000000 +[ 1 1 ] 7 0 7 +[ 1 1 ] 8.000000 0.000000 8.000000 +[ 2 0 ] 9 0 9 +[ 2 0 ] 10.000000 0.000000 10.000000 +[ 2 1 ] 11 0 11 +[ 2 1 ] 12.000000 0.000000 12.000000 +position compound3D compound3D difference +------------------------------------------------------------ +[ 0 0 0 ] 1 0 1 +[ 0 0 0 ] 2.000000 0.000000 2.000000 +[ 0 0 1 ] 3 0 3 +[ 0 0 1 ] 4.000000 0.000000 4.000000 +[ 0 1 0 ] 5 0 5 +[ 0 1 0 ] 6.000000 0.000000 6.000000 +[ 0 1 1 ] 7 0 7 +[ 0 1 1 ] 8.000000 0.000000 8.000000 +[ 0 2 0 ] 9 0 9 +[ 0 2 0 ] 10.000000 0.000000 10.000000 +[ 0 2 1 ] 11 0 11 +[ 0 2 1 ] 12.000000 0.000000 12.000000 +[ 1 0 0 ] 13 0 13 +[ 1 0 0 ] 14.000000 0.000000 14.000000 +[ 1 0 1 ] 15 0 15 +[ 1 0 1 ] 16.000000 0.000000 16.000000 +[ 1 1 0 ] 17 0 17 +[ 1 1 0 ] 18.000000 0.000000 18.000000 +[ 1 1 1 ] 19 0 19 +[ 1 1 1 ] 20.000000 0.000000 20.000000 +[ 1 2 0 ] 21 0 21 +[ 1 2 0 ] 22.000000 0.000000 22.000000 +[ 1 2 1 ] 23 0 23 +[ 1 2 1 ] 24.000000 0.000000 24.000000 +[ 2 0 0 ] 25 0 25 +[ 2 0 0 ] 26.000000 0.000000 26.000000 +[ 2 0 1 ] 27 0 27 +[ 2 0 1 ] 28.000000 0.000000 28.000000 +[ 2 1 0 ] 29 0 29 +[ 2 1 0 ] 30.000000 0.000000 30.000000 +[ 2 1 1 ] 31 0 31 +[ 2 1 1 ] 32.000000 0.000000 32.000000 +[ 2 2 0 ] 33 0 33 +[ 2 2 0 ] 34.000000 0.000000 34.000000 +[ 2 2 1 ] 35 0 35 +[ 2 2 1 ] 36.000000 0.000000 36.000000 +[ 3 0 0 ] 37 0 37 +[ 3 0 0 ] 38.000000 0.000000 38.000000 +[ 3 0 1 ] 39 0 39 +[ 3 0 1 ] 40.000000 0.000000 40.000000 +[ 3 1 0 ] 41 0 41 +[ 3 1 0 ] 42.000000 0.000000 42.000000 +[ 3 1 1 ] 43 0 43 +[ 3 1 1 ] 44.000000 0.000000 44.000000 +[ 3 2 0 ] 45 0 45 +[ 3 2 0 ] 46.000000 0.000000 46.000000 +[ 3 2 1 ] 47 0 47 +[ 3 2 1 ] 48.000000 0.000000 48.000000 +position enum enum difference +------------------------------------------------------------ +[ 0 ] RED GREEN +position float float difference +------------------------------------------------------------ +[ 0 ] 1.000000 0.000000 1.000000 +[ 1 ] 2.000000 0.000000 2.000000 +position float2D float2D difference +------------------------------------------------------------ +[ 0 0 ] 1.000000 0.000000 1.000000 +[ 0 1 ] 2.000000 0.000000 2.000000 +[ 1 0 ] 3.000000 0.000000 3.000000 +[ 1 1 ] 4.000000 0.000000 4.000000 +[ 2 0 ] 5.000000 0.000000 5.000000 +[ 2 1 ] 6.000000 0.000000 6.000000 +position float3D float3D difference +------------------------------------------------------------ +[ 0 0 0 ] 1.000000 0.000000 1.000000 +[ 0 0 1 ] 2.000000 0.000000 2.000000 +[ 0 1 0 ] 3.000000 0.000000 3.000000 +[ 0 1 1 ] 4.000000 0.000000 4.000000 +[ 0 2 0 ] 5.000000 0.000000 5.000000 +[ 0 2 1 ] 6.000000 0.000000 6.000000 +[ 1 0 0 ] 7.000000 0.000000 7.000000 +[ 1 0 1 ] 8.000000 0.000000 8.000000 +[ 1 1 0 ] 9.000000 0.000000 9.000000 +[ 1 1 1 ] 10.000000 0.000000 10.000000 +[ 1 2 0 ] 11.000000 0.000000 11.000000 +[ 1 2 1 ] 12.000000 0.000000 12.000000 +[ 2 0 0 ] 13.000000 0.000000 13.000000 +[ 2 0 1 ] 14.000000 0.000000 14.000000 +[ 2 1 0 ] 15.000000 0.000000 15.000000 +[ 2 1 1 ] 16.000000 0.000000 16.000000 +[ 2 2 0 ] 17.000000 0.000000 17.000000 +[ 2 2 1 ] 18.000000 0.000000 18.000000 +[ 3 0 0 ] 19.000000 0.000000 19.000000 +[ 3 0 1 ] 20.000000 0.000000 20.000000 +[ 3 1 0 ] 21.000000 0.000000 21.000000 +[ 3 1 1 ] 22.000000 0.000000 22.000000 +[ 3 2 0 ] 23.000000 0.000000 23.000000 +[ 3 2 1 ] 24.000000 0.000000 24.000000 +position integer integer difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 1 ] 2 0 2 +position integer2D integer2D difference +------------------------------------------------------------ +[ 0 0 ] 1 0 1 +[ 0 1 ] 2 0 2 +[ 1 0 ] 3 0 3 +[ 1 1 ] 4 0 4 +[ 2 0 ] 5 0 5 +[ 2 1 ] 6 0 6 +position integer3D integer3D difference +------------------------------------------------------------ +[ 0 0 0 ] 1 0 1 +[ 0 0 1 ] 2 0 2 +[ 0 1 0 ] 3 0 3 +[ 0 1 1 ] 4 0 4 +[ 0 2 0 ] 5 0 5 +[ 0 2 1 ] 6 0 6 +[ 1 0 0 ] 7 0 7 +[ 1 0 1 ] 8 0 8 +[ 1 1 0 ] 9 0 9 +[ 1 1 1 ] 10 0 10 +[ 1 2 0 ] 11 0 11 +[ 1 2 1 ] 12 0 12 +[ 2 0 0 ] 13 0 13 +[ 2 0 1 ] 14 0 14 +[ 2 1 0 ] 15 0 15 +[ 2 1 1 ] 16 0 16 +[ 2 2 0 ] 17 0 17 +[ 2 2 1 ] 18 0 18 +[ 3 0 0 ] 19 0 19 +[ 3 0 1 ] 20 0 20 +[ 3 1 0 ] 21 0 21 +[ 3 1 1 ] 22 0 22 +[ 3 2 0 ] 23 0 23 +[ 3 2 1 ] 24 0 24 +position opaque opaque difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 1 ] 2 0 2 +position opaque2D opaque2D difference +------------------------------------------------------------ +[ 0 0 ] 1 0 1 +[ 0 1 ] 2 0 2 +[ 1 0 ] 3 0 3 +[ 1 1 ] 4 0 4 +[ 2 0 ] 5 0 5 +[ 2 1 ] 6 0 6 +position opaque3D opaque3D difference +------------------------------------------------------------ +[ 0 0 0 ] 1 0 1 +[ 0 0 1 ] 2 0 2 +[ 0 1 0 ] 3 0 3 +[ 0 1 1 ] 4 0 4 +[ 0 2 0 ] 5 0 5 +[ 0 2 1 ] 6 0 6 +[ 1 0 0 ] 7 0 7 +[ 1 0 1 ] 8 0 8 +[ 1 1 0 ] 9 0 9 +[ 1 1 1 ] 10 0 10 +[ 1 2 0 ] 11 0 11 +[ 1 2 1 ] 12 0 12 +[ 2 0 0 ] 13 0 13 +[ 2 0 1 ] 14 0 14 +[ 2 1 0 ] 15 0 15 +[ 2 1 1 ] 16 0 16 +[ 2 2 0 ] 17 0 17 +[ 2 2 1 ] 18 0 18 +[ 3 0 0 ] 19 0 19 +[ 3 0 1 ] 20 0 20 +[ 3 1 0 ] 21 0 21 +[ 3 1 1 ] 22 0 22 +[ 3 2 0 ] 23 0 23 +[ 3 2 1 ] 24 0 24 +position difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 1 ] 2 0 2 +position difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 1 ] 2 0 2 +position difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 1 ] 2 0 2 +position difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 1 ] 2 0 2 +position difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 1 ] 2 0 2 +position difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 1 ] 2 0 2 +position difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 1 ] 2 0 2 +position difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 1 ] 2 0 2 +position difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 1 ] 2 0 2 +position difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 1 ] 2 0 2 +position difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 1 ] 2 0 2 +position difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 1 ] 2 0 2 +position difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 1 ] 2 0 2 +position difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 1 ] 2 0 2 +position difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 1 ] 2 0 2 +position difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 1 ] 2 0 2 +position difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 1 ] 2 0 2 +position difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 1 ] 2 0 2 +position difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 1 ] 2 0 2 +position difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 1 ] 2 0 2 +position difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 1 ] 2 0 2 +position difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 1 ] 2 0 2 +position difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 1 ] 2 0 2 +position difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 1 ] 2 0 2 +position difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 1 ] 2 0 2 +position difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 1 ] 2 0 2 +position difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 1 ] 2 0 2 +position difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 1 ] 2 0 2 +position difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 1 ] 2 0 2 +position difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 1 ] 2 0 2 +position difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 1 ] 2 0 2 +position difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 1 ] 2 0 2 +position string string difference +------------------------------------------------------------ +[ 0 ] a z +[ 0 ] b z +[ 1 ] d z +[ 1 ] e z +position string2D string2D difference +------------------------------------------------------------ +[ 0 0 ] a z +[ 0 0 ] b z +[ 0 1 ] c z +[ 0 1 ] d z +[ 1 0 ] e z +[ 1 0 ] f z +[ 1 1 ] g z +[ 1 1 ] h z +[ 2 0 ] i z +[ 2 0 ] j z +[ 2 1 ] k z +[ 2 1 ] l z +position string3D string3D difference +------------------------------------------------------------ +[ 0 0 0 ] a z +[ 0 0 0 ] b z +[ 0 0 1 ] c z +[ 0 0 1 ] d z +[ 0 1 0 ] e z +[ 0 1 0 ] f z +[ 0 1 1 ] g z +[ 0 1 1 ] h z +[ 0 2 0 ] i z +[ 0 2 0 ] j z +[ 0 2 1 ] k z +[ 0 2 1 ] l z +[ 1 0 0 ] m z +[ 1 0 0 ] n z +[ 1 0 1 ] p z +[ 1 0 1 ] q z +[ 1 1 0 ] r z +[ 1 1 0 ] s z +[ 1 1 1 ] t z +[ 1 1 1 ] u z +[ 1 2 0 ] v z +[ 1 2 0 ] w z +[ 1 2 1 ] x z +[ 2 0 0 ] A z +[ 2 0 0 ] B z +[ 2 0 1 ] C z +[ 2 0 1 ] D z +[ 2 1 0 ] E z +[ 2 1 0 ] F z +[ 2 1 1 ] G z +[ 2 1 1 ] H z +[ 2 2 0 ] I z +[ 2 2 0 ] J z +[ 2 2 1 ] K z +[ 2 2 1 ] L z +[ 3 0 0 ] M z +[ 3 0 0 ] N z +[ 3 0 1 ] P z +[ 3 0 1 ] Q z +[ 3 1 0 ] R z +[ 3 1 0 ] S z +[ 3 1 1 ] T z +[ 3 1 1 ] U z +[ 3 2 0 ] V z +[ 3 2 0 ] W z +[ 3 2 1 ] X z +[ 3 2 1 ] Z z +position vlen vlen difference +------------------------------------------------------------ +[ 0 ] 1 0 1 +[ 1 ] 2 0 2 +[ 1 ] 3 0 3 +position vlen2D vlen2D difference +------------------------------------------------------------ +[ 0 1 ] 1 0 1 +[ 1 0 ] 2 0 2 +[ 1 0 ] 3 0 3 +[ 1 1 ] 4 0 4 +[ 1 1 ] 5 0 5 +[ 2 0 ] 6 0 6 +[ 2 0 ] 7 0 7 +[ 2 0 ] 8 0 8 +[ 2 1 ] 9 0 9 +[ 2 1 ] 10 0 10 +[ 2 1 ] 11 0 11 +position vlen3D vlen3D difference +------------------------------------------------------------ +[ 0 0 1 ] 1 0 1 +[ 0 1 0 ] 2 0 2 +[ 0 1 1 ] 3 0 3 +[ 0 2 0 ] 4 0 4 +[ 0 2 1 ] 5 0 5 +[ 1 0 0 ] 6 0 6 +[ 1 0 0 ] 7 0 7 +[ 1 0 1 ] 8 0 8 +[ 1 0 1 ] 9 0 9 +[ 1 1 0 ] 10 0 10 +[ 1 1 0 ] 11 0 11 +[ 1 1 1 ] 12 0 12 +[ 1 1 1 ] 13 0 13 +[ 1 2 0 ] 14 0 14 +[ 1 2 0 ] 15 0 15 +[ 1 2 1 ] 16 0 16 +[ 1 2 1 ] 17 0 17 +[ 2 0 0 ] 18 0 18 +[ 2 0 0 ] 19 0 19 +[ 2 0 0 ] 20 0 20 +[ 2 0 1 ] 21 0 21 +[ 2 0 1 ] 22 0 22 +[ 2 0 1 ] 23 0 23 +[ 2 1 0 ] 24 0 24 +[ 2 1 0 ] 25 0 25 +[ 2 1 0 ] 26 0 26 +[ 2 1 1 ] 27 0 27 +[ 2 1 1 ] 28 0 28 +[ 2 1 1 ] 29 0 29 +[ 2 2 0 ] 30 0 30 +[ 2 2 0 ] 31 0 31 +[ 2 2 0 ] 32 0 32 +[ 2 2 1 ] 33 0 33 +[ 2 2 1 ] 34 0 34 +[ 2 2 1 ] 35 0 35 +[ 3 0 0 ] 36 0 36 +[ 3 0 0 ] 37 0 37 +[ 3 0 0 ] 38 0 38 +[ 3 0 0 ] 39 0 39 +[ 3 0 1 ] 40 0 40 +[ 3 0 1 ] 41 0 41 +[ 3 0 1 ] 42 0 42 +[ 3 0 1 ] 43 0 43 +[ 3 1 0 ] 44 0 44 +[ 3 1 0 ] 45 0 45 +[ 3 1 0 ] 46 0 46 +[ 3 1 0 ] 47 0 47 +[ 3 1 1 ] 48 0 48 +[ 3 1 1 ] 49 0 49 +[ 3 1 1 ] 50 0 50 +[ 3 1 1 ] 51 0 51 +[ 3 2 0 ] 52 0 52 +[ 3 2 0 ] 53 0 53 +[ 3 2 0 ] 54 0 54 +[ 3 2 0 ] 55 0 55 +[ 3 2 1 ] 56 0 56 +[ 3 2 1 ] 57 0 57 +[ 3 2 1 ] 58 0 58 +[ 3 2 1 ] 59 0 59 + -- cgit v0.12