diff options
author | Raymond Lu <songyulu@hdfgroup.org> | 2004-06-21 20:59:07 (GMT) |
---|---|---|
committer | Raymond Lu <songyulu@hdfgroup.org> | 2004-06-21 20:59:07 (GMT) |
commit | 18a656663a73a693cabf49d6f4858f7af311e6f5 (patch) | |
tree | 330352ae6f1ea7b53b70281231ec4e7f4c22e610 /tools/h5dump | |
parent | e8309603cd45cdfa4c831e659c529f51b117ef39 (diff) | |
download | hdf5-18a656663a73a693cabf49d6f4858f7af311e6f5.zip hdf5-18a656663a73a693cabf49d6f4858f7af311e6f5.tar.gz hdf5-18a656663a73a693cabf49d6f4858f7af311e6f5.tar.bz2 |
[svn-r8714] *** empty log message ***
Diffstat (limited to 'tools/h5dump')
-rw-r--r-- | tools/h5dump/h5dump.c | 5 | ||||
-rw-r--r-- | tools/h5dump/h5dumpgentest.c | 55 | ||||
-rw-r--r-- | tools/h5dump/testh5dump.sh.in | 5 | ||||
-rwxr-xr-x | tools/h5dump/testh5dumpxml.sh | 3 |
4 files changed, 47 insertions, 21 deletions
diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c index 57af6d7..9c50fbf 100644 --- a/tools/h5dump/h5dump.c +++ b/tools/h5dump/h5dump.c @@ -1068,7 +1068,7 @@ dump_dataspace(hid_t space) break; case H5S_NULL: - /* nulldataspace */ + /* null dataspace */ HDfprintf(stdout, "%s %s", dump_header_format->dataspacedescriptionbegin, S_NULL); break; @@ -4740,11 +4740,14 @@ xml_dump_dataspace(hid_t space) printf("</%sSimpleDataspace>\n", xmlnsprefix ); break; +#ifdef TMP + /* Commented out: wait until the schema is updated first */ case H5S_NULL: /* null dataspace (just a tag, no XML attrs. defined */ printf("<%sNullDataspace />\n",xmlnsprefix); break; +#endif /* TMP */ case H5S_COMPLEX: printf("<!-- not yet implemented -->\n"); diff --git a/tools/h5dump/h5dumpgentest.c b/tools/h5dump/h5dumpgentest.c index f540c25..ffe24b1 100644 --- a/tools/h5dump/h5dumpgentest.c +++ b/tools/h5dump/h5dumpgentest.c @@ -70,6 +70,7 @@ #define FILE42 "tnamed_dtype_attr.h5" #define FILE43 "tvldtypes5.h5" #define FILE44 "tfilters.h5" +#define FILE45 "tnullspace.h5" /*------------------------------------------------------------------------- @@ -236,7 +237,6 @@ 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); @@ -264,18 +264,9 @@ static void gent_dataset(void) dset2[i][j] = 0.0001*j+i; H5Dwrite(dataset, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset2); - 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); } @@ -386,14 +377,7 @@ static void gent_attribute(void) 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); - H5Aclose(attr); H5Gclose(root); H5Fclose(fid); } @@ -4880,8 +4864,41 @@ set_local_myfilter(hid_t dcpl_id, hid_t UNUSED type_id, hid_t UNUSED space_id) return(FAIL); return(SUCCEED); -} +} +/*------------------------------------------------------------------------- + * Function: gent_null_space + * + * Purpose: generates dataset and attribute of null dataspace + *------------------------------------------------------------------------- + */ +static void gent_null_space(void) +{ + hid_t fid, root, dataset, space, attr; + int dset_buf = 10; + int point = 4; + + fid = H5Fcreate(FILE45, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + root = H5Gopen (fid, "/"); + + /* null space */ + space = H5Screate(H5S_NULL); + + /* dataset */ + dataset = H5Dcreate(fid, "dset", H5T_STD_I32BE, space, H5P_DEFAULT); + /* nothing should be written */ + H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &dset_buf); + + /* attribute */ + attr = H5Acreate (root, "attr", H5T_NATIVE_UINT, space, H5P_DEFAULT); + H5Awrite(attr, H5T_NATIVE_INT, &point); /* Nothing can be written */ + + H5Dclose(dataset); + H5Aclose(attr); + H5Gclose(root); + H5Sclose(space); + H5Fclose(fid); +} /*------------------------------------------------------------------------- * Function: main @@ -4952,5 +4969,7 @@ int main(void) gent_filters(); + gent_null_space(); + return 0; } diff --git a/tools/h5dump/testh5dump.sh.in b/tools/h5dump/testh5dump.sh.in index 067d0f0..19aa89a 100644 --- a/tools/h5dump/testh5dump.sh.in +++ b/tools/h5dump/testh5dump.sh.in @@ -112,7 +112,7 @@ TOOLTEST tgroup-2.ddl --group=/g2 --group / -g /y tgroup.h5 # test for displaying simple space datasets TOOLTEST tdset-1.ddl tdset.h5 # test for displaying selected datasets -TOOLTEST tdset-2.ddl -H -d dset1 -d /dset2 --dataset=dset3 tdset.h5 +TOOLTEST tdset-2.ddl -H -d dset1 -d /dset2 tdset.h5 # test for displaying attributes TOOLTEST tattr-1.ddl tattr.h5 @@ -272,7 +272,8 @@ fi # user defined TOOLTEST tuserfilter.ddl -H -d myfilter tfilters.h5 - +# test for displaying dataset and attribute of null space +TOOLTEST tnullspace.ddl tnullspace.h5 if test $nerrors -eq 0 ; then diff --git a/tools/h5dump/testh5dumpxml.sh b/tools/h5dump/testh5dumpxml.sh index d5e3ad5..6af3836 100755 --- a/tools/h5dump/testh5dumpxml.sh +++ b/tools/h5dump/testh5dumpxml.sh @@ -132,6 +132,9 @@ TOOLTEST tvlstr.h5.xml --xml tvlstr.h5 TOOLTEST tsaf.h5.xml --xml tsaf.h5 TOOLTEST tempty.h5.xml --xml tempty.h5 TOOLTEST tnamed_dtype_attr.h5.xml --xml tnamed_dtype_attr.h5 +##Test dataset and attribute of null space. Commented out: +## wait until the XML schema is updated for null space. +##TOOLTEST tnullspace.h5.xml --xml tnulspace.h5 # other options for xml |