mirror of
https://github.com/HDFGroup/hdf5.git
synced 2024-11-27 02:10:55 +08:00
[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)
This commit is contained in:
parent
298276970f
commit
19fef59d90
32
test/tfile.c
32
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");
|
||||
|
Loading…
Reference in New Issue
Block a user