diff options
author | Raymond Lu <songyulu@hdfgroup.org> | 2004-05-26 15:46:19 (GMT) |
---|---|---|
committer | Raymond Lu <songyulu@hdfgroup.org> | 2004-05-26 15:46:19 (GMT) |
commit | 8ea17935698f11f851a883f275bc4fe75c572f76 (patch) | |
tree | a859639505f3c2dc2cfb3b56bce7f24d1125053e /tools/h5diff/testh5diff_dset.c | |
parent | 80816a3dde8614c52d80f0090f8a5d08fc4546e7 (diff) | |
download | hdf5-8ea17935698f11f851a883f275bc4fe75c572f76.zip hdf5-8ea17935698f11f851a883f275bc4fe75c572f76.tar.gz hdf5-8ea17935698f11f851a883f275bc4fe75c572f76.tar.bz2 |
[svn-r8578] Purpose: new test
Description: Add null dataspace test for dataset and attribute to h5diff
Platforms tested: RH 8(fuss). Simple change, only h5diff is involved.
Diffstat (limited to 'tools/h5diff/testh5diff_dset.c')
-rw-r--r-- | tools/h5diff/testh5diff_dset.c | 37 |
1 files changed, 32 insertions, 5 deletions
diff --git a/tools/h5diff/testh5diff_dset.c b/tools/h5diff/testh5diff_dset.c index 8158c5e..8ea892b 100644 --- a/tools/h5diff/testh5diff_dset.c +++ b/tools/h5diff/testh5diff_dset.c @@ -602,6 +602,37 @@ static void write_dset_in(hid_t loc_id, write_dset(loc_id,3,dims3,"float3D",H5T_NATIVE_FLOAT,buf83); } +/*------------------------------------------------------------------------- + * Function: write_null_dset + * + * Purpose: write null dataset in LOC_ID + * + * Programmer: Raymond Lu, slu@ncsa.uiuc.edu + * + * Date: May 24, 2004 + * + *------------------------------------------------------------------------- + */ +static void write_null_dset(hid_t loc_id, int make_diffs) +{ + hid_t sid, dset_id; + int val = 2; + double dval = 7.8; + + /* Create the null attribute */ + sid = H5Screate(H5S_NULL); + if(make_diffs) { + dset_id = H5Dcreate(loc_id,"null_dset",H5T_NATIVE_INT,sid,H5P_DEFAULT); + H5Dwrite(dset_id,H5T_NATIVE_INT,H5S_ALL,H5S_ALL,H5P_DEFAULT,&val); + } else { + dset_id = H5Dcreate(loc_id,"null_dset",H5T_NATIVE_DOUBLE,sid,H5P_DEFAULT); + H5Dwrite(dset_id,H5T_NATIVE_DOUBLE,H5S_ALL,H5S_ALL,H5P_DEFAULT,&dval); + } + + /* Close */ + H5Dclose(dset_id); + H5Sclose(sid); +} /*------------------------------------------------------------------------- * Check all HDF5 classes @@ -610,8 +641,6 @@ static void write_dset_in(hid_t loc_id, * H5T_ENUM, H5T_VLEN, H5T_ARRAY *------------------------------------------------------------------------- */ - - int test_dsetall(const char *file, int make_diffs /* flag to modify data buffers */) { @@ -648,6 +677,7 @@ int test_dsetall(const char *file, */ write_dset_in(group_id,"/dset",file_id,make_diffs); + write_null_dset(file_id, make_diffs); /* Close */ status = H5Dclose(dset_id); @@ -660,6 +690,3 @@ int test_dsetall(const char *file, assert(status>=0); return status; } - - - |