diff options
author | Raymond Lu <songyulu@hdfgroup.org> | 2004-05-21 15:58:38 (GMT) |
---|---|---|
committer | Raymond Lu <songyulu@hdfgroup.org> | 2004-05-21 15:58:38 (GMT) |
commit | d77fc6af739944c0ebbc362d4710da4696dccad0 (patch) | |
tree | ebeed11922002b84fc10d58ff2ce9707de205a25 /tools/h5dump/h5dumpgentest.c | |
parent | b03c529cdcdee921a0379bc6ce208e4083dd1d0d (diff) | |
download | hdf5-d77fc6af739944c0ebbc362d4710da4696dccad0.zip hdf5-d77fc6af739944c0ebbc362d4710da4696dccad0.tar.gz hdf5-d77fc6af739944c0ebbc362d4710da4696dccad0.tar.bz2 |
[svn-r8562] Purpose: New feature
Description: Add null dataspace to h5dump and h5ls.
Platforms tested: h5committest
Diffstat (limited to 'tools/h5dump/h5dumpgentest.c')
-rw-r--r-- | tools/h5dump/h5dumpgentest.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c index 8eb50e1..b3c55a6 100644 --- a/tools/h5dump/h5dumpgentest.c +++ b/tools/h5dump/h5dumpgentest.c @@ -201,6 +201,7 @@ static void gent_dataset(void) hsize_t dims[2]; int dset1[10][20]; double dset2[30][20]; + int dset3 = 10; int i, j; fid = H5Fcreate(FILE2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); @@ -231,6 +232,15 @@ static void gent_dataset(void) H5Sclose(space); H5Dclose(dataset); + + /* dset3 - null space */ + space = H5Screate(H5S_NULL); + dataset = H5Dcreate(fid, "/dset3", H5T_STD_I32BE, space, H5P_DEFAULT); + /* nothing should be written */ + H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &dset3); + + H5Sclose(space); + H5Dclose(dataset); H5Fclose(fid); } @@ -338,6 +348,13 @@ static void gent_attribute(void) H5Tset_size(type, 17); attr = H5Acreate (root, "attr5", type, space, H5P_DEFAULT); H5Awrite(attr, type, string); + H5Sclose(space); + H5Aclose(attr); + + /* attribute 6 - null dataspace */ + space = H5Screate(H5S_NULL); + attr = H5Acreate (root, "attr6", H5T_NATIVE_UINT, space, H5P_DEFAULT); + H5Awrite(attr, H5T_NATIVE_INT, &point); /* Nothing can be written */ H5Tclose(type); H5Sclose(space); |