summaryrefslogtreecommitdiffstats
path: root/tools/h5diff
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2009-02-24 17:59:14 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2009-02-24 17:59:14 (GMT)
commit33a65add7db18a4efd2b34ac8261c2065820ebf9 (patch)
tree782730a42955d1a247fec9356c5d05f83cce4903 /tools/h5diff
parente63f0baf7e3a8e36c19f52d7692b483b7440e5eb (diff)
downloadhdf5-33a65add7db18a4efd2b34ac8261c2065820ebf9.zip
hdf5-33a65add7db18a4efd2b34ac8261c2065820ebf9.tar.gz
hdf5-33a65add7db18a4efd2b34ac8261c2065820ebf9.tar.bz2
[svn-r16514] Description:
Merge r16440:16500 from trunk into revise_chunks branch. Tested on: FreeBSD/32 6.3 (duty) in debug mode FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (jam) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode Mac OS X/32 10.5.6 (amazon) in debug mode Mac OS X/32 10.5.6 (amazon) w/C++ & FORTRAN, w/threadsafe, in production mode
Diffstat (limited to 'tools/h5diff')
-rw-r--r--tools/h5diff/h5diffgentest.c68
-rw-r--r--tools/h5diff/testfiles/h5diff_17.txt3
-rw-r--r--tools/h5diff/testfiles/h5diff_206.txt1
-rw-r--r--tools/h5diff/testfiles/h5diff_207.txt2
-rw-r--r--tools/h5diff/testfiles/h5diff_90.txt10
-rw-r--r--tools/h5diff/testfiles/h5diff_basic2.h5bin7688 -> 9008 bytes
-rwxr-xr-xtools/h5diff/testh5diff.sh10
7 files changed, 83 insertions, 11 deletions
diff --git a/tools/h5diff/h5diffgentest.c b/tools/h5diff/h5diffgentest.c
index ec379be..d9495e5 100644
--- a/tools/h5diff/h5diffgentest.c
+++ b/tools/h5diff/h5diffgentest.c
@@ -43,7 +43,7 @@
#define FILE11 "h5diff_empty.h5"
#define UIMAX 4294967295u /*Maximum value for a variable of type unsigned int */
#define STR_SIZE 3
-#define GBLL ((unsigned long_long) 1024 * 1024 *1024 )
+#define GBLL ((unsigned long long) 1024 * 1024 *1024 )
#define MY_LINKCLASS 187
@@ -202,12 +202,12 @@ int test_basic(const char *fname1, const char *fname2, const char *fname3)
/*-------------------------------------------------------------------------
* relative error, compare divide by zero, both zero
- * # 1.6.2 with -p (unsigned long_long)
+ * # 1.6.2 with -p (unsigned long long)
*-------------------------------------------------------------------------
*/
{
- unsigned long_long data7[3][2] = {{100,100},{100,0},{0,100}};
- unsigned long_long data8[3][2] = {{120,80}, {0,100},{0,50}};
+ unsigned long long data7[3][2] = {{100,100},{100,0},{0,100}};
+ unsigned long long data8[3][2] = {{120,80}, {0,100},{0,50}};
write_dset(gid1,2,dims2,"dset7",H5T_NATIVE_ULLONG,data7);
write_dset(gid1,2,dims2,"dset8",H5T_NATIVE_ULLONG,data8);
@@ -331,12 +331,37 @@ int test_basic(const char *fname1, const char *fname2, const char *fname3)
/* not comparable objects */
{
+
+ typedef struct cmp1_t
+ {
+ double d;
+ int i;
+ } cmp1_t;
+
+ typedef struct cmp2_t
+ {
+ int i;
+ double d;
+ } cmp2_t;
+
+ typedef struct cmp3_t
+ {
+ int i;
+ } cmp3_t;
+
double data2[6] = {0,0,0,0,0,0};
int data3[6] = {0,0,0,0,0,0};
int data4[3][2] = {{0,0},{0,0},{0,0}};
- hsize_t dims3[2] = { 2,2 };
int data5[2][2] = {{0,0},{0,0}};
unsigned int data6[3][2] = {{0,0},{0,0},{0,0}};
+ cmp1_t data7[1] = {1,2};
+ cmp2_t data8[1] = {1,2};
+ hsize_t dims3[2] = { 2,2 };
+ hsize_t dims4[1] = { 1 };
+ size_t type_size;
+ hid_t tid;
+
+
write_dset(gid3,1,dims1,"dset1",H5T_NATIVE_DOUBLE,NULL);
write_dset(gid3,1,dims1,"dset2",H5T_NATIVE_DOUBLE,data2);
@@ -344,7 +369,28 @@ int test_basic(const char *fname1, const char *fname2, const char *fname3)
write_dset(gid3,2,dims2,"dset4",H5T_NATIVE_INT,data4);
write_dset(gid3,2,dims3,"dset5",H5T_NATIVE_INT,data5);
write_dset(gid3,2,dims2,"dset6",H5T_NATIVE_UINT,data6);
-
+
+ /* case of compound with different type members */
+ type_size = sizeof( cmp1_t );
+ tid = H5Tcreate (H5T_COMPOUND, type_size );
+ H5Tinsert(tid, "d", HOFFSET( cmp1_t, d ), H5T_NATIVE_DOUBLE );
+ H5Tinsert(tid, "i", HOFFSET( cmp1_t, i ), H5T_NATIVE_INT );
+ write_dset(gid3,1,dims4,"dset7",tid,data7);
+ H5Tclose(tid);
+
+ type_size = sizeof( cmp2_t );
+ tid = H5Tcreate (H5T_COMPOUND, type_size );
+ H5Tinsert(tid, "i", HOFFSET( cmp2_t, i ), H5T_NATIVE_INT );
+ H5Tinsert(tid, "d", HOFFSET( cmp2_t, d ), H5T_NATIVE_DOUBLE );
+ write_dset(gid3,1,dims4,"dset8",tid,data8);
+ H5Tclose(tid);
+
+ /* case of compound with different number of members */
+ type_size = sizeof( cmp3_t );
+ tid = H5Tcreate (H5T_COMPOUND, type_size );
+ H5Tinsert(tid, "i", HOFFSET( cmp2_t, i ), H5T_NATIVE_INT );
+ write_dset(gid3,1,dims4,"dset9",tid,NULL);
+ H5Tclose(tid);
}
@@ -529,11 +575,11 @@ int test_datatypes(const char *fname)
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}};
+ /* 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}};
diff --git a/tools/h5diff/testfiles/h5diff_17.txt b/tools/h5diff/testfiles/h5diff_17.txt
index 2ffbda9..ac04bd4 100644
--- a/tools/h5diff/testfiles/h5diff_17.txt
+++ b/tools/h5diff/testfiles/h5diff_17.txt
@@ -29,6 +29,9 @@ file1 file2
x /g2/dset4
x /g2/dset5
x /g2/dset6
+ x /g2/dset7
+ x /g2/dset8
+ x /g2/dset9
group : </> and </>
0 differences found
diff --git a/tools/h5diff/testfiles/h5diff_206.txt b/tools/h5diff/testfiles/h5diff_206.txt
new file mode 100644
index 0000000..8bbbb9a
--- /dev/null
+++ b/tools/h5diff/testfiles/h5diff_206.txt
@@ -0,0 +1 @@
+</g2/dset7> has a class H5T_FLOAT and </g2/dset8> has a class H5T_INTEGER
diff --git a/tools/h5diff/testfiles/h5diff_207.txt b/tools/h5diff/testfiles/h5diff_207.txt
new file mode 100644
index 0000000..833afe8
--- /dev/null
+++ b/tools/h5diff/testfiles/h5diff_207.txt
@@ -0,0 +1,2 @@
+</g2/dset8> or </g2/dset9> are empty datasets
+</g2/dset8> has 2 members </g2/dset9> has 1 members
diff --git a/tools/h5diff/testfiles/h5diff_90.txt b/tools/h5diff/testfiles/h5diff_90.txt
index cfef527..71b960e 100644
--- a/tools/h5diff/testfiles/h5diff_90.txt
+++ b/tools/h5diff/testfiles/h5diff_90.txt
@@ -13,6 +13,9 @@ file1 file2
x x /g2/dset4
x x /g2/dset5
x x /g2/dset6
+ x x /g2/dset7
+ x x /g2/dset8
+ x x /g2/dset9
group : </> and </>
0 differences found
@@ -39,6 +42,13 @@ dataset: </g2/dset5> and </g2/dset5>
0 differences found
dataset: </g2/dset6> and </g2/dset6>
0 differences found
+dataset: </g2/dset7> and </g2/dset7>
+0 differences found
+dataset: </g2/dset8> and </g2/dset8>
+0 differences found
+dataset: </g2/dset9> and </g2/dset9>
+</g2/dset9> or </g2/dset9> are empty datasets
+0 differences found
--------------------------------
Some objects are not comparable
--------------------------------
diff --git a/tools/h5diff/testfiles/h5diff_basic2.h5 b/tools/h5diff/testfiles/h5diff_basic2.h5
index edb0c65..c0795b6 100644
--- a/tools/h5diff/testfiles/h5diff_basic2.h5
+++ b/tools/h5diff/testfiles/h5diff_basic2.h5
Binary files differ
diff --git a/tools/h5diff/testh5diff.sh b/tools/h5diff/testh5diff.sh
index e37a047..4854e3e 100755
--- a/tools/h5diff/testh5diff.sh
+++ b/tools/h5diff/testh5diff.sh
@@ -598,6 +598,16 @@ TESTING $H5DIFF -c $SRCFILE2 $SRCFILE2 g2/dset5 g2/dset6
TOOLTEST h5diff_205.txt -c $FILE2 $FILE2 g2/dset5 g2/dset6
+# not comparable in compound
+TESTING $H5DIFF -c $SRCFILE2 $SRCFILE2 g2/dset7 g2/dset8
+TOOLTEST h5diff_206.txt -c $FILE2 $FILE2 g2/dset7 g2/dset8
+
+TESTING $H5DIFF -c $SRCFILE2 $SRCFILE2 g2/dset8 g2/dset9
+TOOLTEST h5diff_207.txt -c $FILE2 $FILE2 g2/dset8 g2/dset9
+
+
+
+
# ##############################################################################
# # END
# ##############################################################################