summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2001-04-23 20:05:15 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2001-04-23 20:05:15 (GMT)
commit19fef59d90d3500c12d72a49095a29c12dea877a (patch)
tree9fbe4813842783ee0d50941a216a32483637be7b
parent298276970f0324764feb920b3480f25c9e2b98a3 (diff)
downloadhdf5-19fef59d90d3500c12d72a49095a29c12dea877a.zip
hdf5-19fef59d90d3500c12d72a49095a29c12dea877a.tar.gz
hdf5-19fef59d90d3500c12d72a49095a29c12dea877a.tar.bz2
[svn-r3833] Purpose:
More tests Description: Added test to verify non-zero userblocks working correctly with dataset I/O code. Platforms tested: FreeBSD 4.3 (hawkwind)
-rw-r--r--test/tfile.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/tfile.c b/test/tfile.c
index c2bf726..f5247a9 100644
--- a/test/tfile.c
+++ b/test/tfile.c
@@ -38,6 +38,9 @@
#define F2_LENGTH_SIZE 8
#define F2_SYM_LEAF_K 8
#define F2_SYM_INTERN_K 32
+#define F2_RANK 2
+#define F2_DIM0 4
+#define F2_DIM1 6
#define FILE2 "tfile2.h5"
#define F3_USERBLOCK_SIZE (hsize_t)0
@@ -167,6 +170,35 @@ test_file_create(void)
ret = H5Pclose(tmpl1);
CHECK(ret, FAIL, "H5Pclose");
+ /* Make certain we can create a dataset properly in the file with the userblock */
+ {
+ hid_t dataset_id, dataspace_id; /* identifiers */
+ hsize_t dims[F2_RANK];
+ int data[F2_DIM0][F2_DIM1];
+
+ /* Create the data space for the dataset. */
+ dims[0] = F2_DIM0;
+ dims[1] = F2_DIM1;
+ dataspace_id = H5Screate_simple(F2_RANK, dims, NULL);
+ CHECK(dataspace_id, FAIL, "H5Screate_simple");
+
+ /* Create the dataset. */
+ dataset_id = H5Dcreate(fid2, "/dset", H5T_NATIVE_INT, dataspace_id, H5P_DEFAULT);
+ CHECK(dataset_id, FAIL, "H5Dcreate");
+
+ /* Write data to the new dataset */
+ ret = H5Dwrite(dataset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data);
+ CHECK(ret, FAIL, "H5Dwrite");
+
+ /* End access to the dataset and release resources used by it. */
+ ret = H5Dclose(dataset_id);
+ CHECK(ret, FAIL, "H5Dclose");
+
+ /* Terminate access to the data space. */
+ ret = H5Sclose(dataspace_id);
+ CHECK(ret, FAIL, "H5Sclose");
+ }
+
/* Get the file-creation template */
tmpl1 = H5Fget_create_plist(fid2);
CHECK(tmpl1, FAIL, "H5Fget_create_plist");