summaryrefslogtreecommitdiffstats
path: root/tools/h5diff/h5diffgentest.c
diff options
context:
space:
mode:
authorJonathan Kim <jkm@hdfgroup.org>2012-08-20 20:11:58 (GMT)
committerJonathan Kim <jkm@hdfgroup.org>2012-08-20 20:11:58 (GMT)
commitdc7748afb99372d4f3c4ce8e6612bd3d5e6ff481 (patch)
tree590b39a31bf70f143489e6185e72c8939ac4be78 /tools/h5diff/h5diffgentest.c
parentb169fa28ff3eaa249cc9309c5c16c0ca28b9e06f (diff)
downloadhdf5-dc7748afb99372d4f3c4ce8e6612bd3d5e6ff481.zip
hdf5-dc7748afb99372d4f3c4ce8e6612bd3d5e6ff481.tar.gz
hdf5-dc7748afb99372d4f3c4ce8e6612bd3d5e6ff481.tar.bz2
[svn-r22701] Purpose:
Address HDFFV-7942 - h5diff: incorrect result for comparing attribute data with different type size in same class Description: When comparing attribute data values with same type class but different size, the result was incorrect. It was due to the size difference and got truncated. Fixed to match up the smaller type size to big type size like what dataset does. Merged from HDF5 trunk r22684 and r22691. Tested: jam (linux32-LE), koala (linux64-LE), ostrich (linuxppc64-BE), tejeda (mac32-LE), Windows (32-LE cmake), cmake (jam)
Diffstat (limited to 'tools/h5diff/h5diffgentest.c')
-rw-r--r--tools/h5diff/h5diffgentest.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/h5diff/h5diffgentest.c b/tools/h5diff/h5diffgentest.c
index c370f79..7c69154 100644
--- a/tools/h5diff/h5diffgentest.c
+++ b/tools/h5diff/h5diffgentest.c
@@ -759,6 +759,7 @@ int test_datatypes(const char *fname)
{
hid_t fid1;
+ hid_t dset;
hsize_t dims[2]={3,2};
herr_t status;
char buf1a[3][2] = {{1,1},{1,1},{1,1}};
@@ -790,6 +791,9 @@ int test_datatypes(const char *fname)
unsigned int buf10a[3][2] = {{UIMAX,1},{1,1},{1,1}};
unsigned int buf10b[3][2] = {{UIMAX-1,1},{3,4},{5,6}};
+ unsigned short buf11a[3][2] = {{204,205},{2,3},{1,1}};
+ unsigned int buf11b[3][2] = {{204,205},{2,3},{1,1}};
+
/*-------------------------------------------------------------------------
* Create a file
@@ -880,6 +884,19 @@ int test_datatypes(const char *fname)
write_dset(fid1,2,dims,"dset10a",H5T_NATIVE_UINT,buf10a);
write_dset(fid1,2,dims,"dset10b",H5T_NATIVE_UINT,buf10b);
+ /*-------------------------------------------------------------------------
+ * Same type class, different size
+ *-------------------------------------------------------------------------
+ */
+ write_dset(fid1,2,dims,"dset11a",H5T_STD_U16LE,buf11a);
+ dset=H5Dopen2 (fid1, "dset11a", H5P_DEFAULT);
+ write_attr(dset,2,dims,"attr",H5T_STD_U16LE,buf11a);
+ H5Dclose (dset);
+
+ write_dset(fid1,2,dims,"dset11b",H5T_STD_U32LE,buf11b);
+ dset=H5Dopen2 (fid1, "dset11b", H5P_DEFAULT);
+ write_attr(dset,2,dims,"attr",H5T_STD_U32LE,buf11b);
+ H5Dclose (dset);
/*-------------------------------------------------------------------------
* Close