summaryrefslogtreecommitdiffstats
path: root/tools/lib/h5diff_dset.c
diff options
context:
space:
mode:
authorPedro Vicente Nunes <pvn@hdfgroup.org>2003-10-30 14:40:01 (GMT)
committerPedro Vicente Nunes <pvn@hdfgroup.org>2003-10-30 14:40:01 (GMT)
commit46646fc6548090c2c88d96fb4991165885b1a223 (patch)
tree318e8bb6e05eb2bf6d5a54ecba36a4c29700fc5b /tools/lib/h5diff_dset.c
parent9ed099022e7c976cda3d3daadf84bc4b92a847f6 (diff)
downloadhdf5-46646fc6548090c2c88d96fb4991165885b1a223.zip
hdf5-46646fc6548090c2c88d96fb4991165885b1a223.tar.gz
hdf5-46646fc6548090c2c88d96fb4991165885b1a223.tar.bz2
[svn-r7792] Purpose:
h5diff new features bug fix Description: implemented the diff for STRING and ARRAY types fixed a bug. when the datasets are empty, do not try to compare them . the check empty is made with H5Dgetstorage_size Solution: Platforms tested: linux solaris 5.7 IRIX Misc. update:
Diffstat (limited to 'tools/lib/h5diff_dset.c')
-rw-r--r--tools/lib/h5diff_dset.c31
1 files changed, 26 insertions, 5 deletions
diff --git a/tools/lib/h5diff_dset.c b/tools/lib/h5diff_dset.c
index f5e2188..0db6bf9 100644
--- a/tools/lib/h5diff_dset.c
+++ b/tools/lib/h5diff_dset.c
@@ -63,6 +63,8 @@ int diff_dataset( hid_t file1_id,
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;
@@ -156,17 +158,21 @@ int diff_dataset( hid_t file1_id,
assert(tclass1==tclass2);
switch (tclass1)
{
- case H5T_TIME:
- case H5T_STRING:
- case H5T_BITFIELD:
- case H5T_OPAQUE:
#if 0
case H5T_COMPOUND:
+ case H5T_STRING:
+ case H5T_ARRAY:
+
#endif
+
+
+ case H5T_TIME:
+ case H5T_BITFIELD:
+ case H5T_OPAQUE:
+
case H5T_REFERENCE:
case H5T_ENUM:
case H5T_VLEN:
- case H5T_ARRAY:
if (options->verbose ) {
printf("Comparison not supported\n");
printf("<%s> is of class %s and <%s> is of class %s\n",
@@ -178,6 +184,19 @@ int diff_dataset( hid_t file1_id,
break;
}
+
+
+/*-------------------------------------------------------------------------
+ * check for empty datasets
+ *-------------------------------------------------------------------------
+ */
+
+ storage_size1=H5Dget_storage_size(dset1_id);
+ storage_size2=H5Dget_storage_size(dset2_id);
+ if (storage_size1<=0 && storage_size2<=0)
+ goto out;
+
+
/*-------------------------------------------------------------------------
* check for the same rank
*-------------------------------------------------------------------------
@@ -375,6 +394,8 @@ int diff_dataset( hid_t file1_id,
goto out;
}
+
+
/*-------------------------------------------------------------------------
* read
*-------------------------------------------------------------------------