diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2007-05-23 02:16:41 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2007-05-23 02:16:41 (GMT) |
commit | c04a55d65e694b7c3e36813f48c24d43118f8e87 (patch) | |
tree | 545de5a9735eab1e44964c20c979565f0fa040d9 /test/tsohm.c | |
parent | 2232cf942df7b81ce44888a33e91fbe7077a1f6b (diff) | |
download | hdf5-c04a55d65e694b7c3e36813f48c24d43118f8e87.zip hdf5-c04a55d65e694b7c3e36813f48c24d43118f8e87.tar.gz hdf5-c04a55d65e694b7c3e36813f48c24d43118f8e87.tar.bz2 |
[svn-r13796] Description:
Clean up ISOHM code further and get rid of several non-optimal ways
of working with object headers.
Tested on:
FreeBSD/32 6.2 (duty)
Mac OS X/32 10.4.9 (amazon)
Diffstat (limited to 'test/tsohm.c')
-rw-r--r-- | test/tsohm.c | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/test/tsohm.c b/test/tsohm.c index cae7a8f..d0459a80 100644 --- a/test/tsohm.c +++ b/test/tsohm.c @@ -566,8 +566,6 @@ size1_helper(hid_t file, const char* filename, hid_t fapl_id, int test_file_clos dtype1_struct wdata = {11, "string", 22, 33, 44, 55, 66, 77, 88, 0.0}; dtype1_struct rdata; hid_t dtype1_id = -1; - hid_t dup_tid = -1; - hid_t type_id = -1; hid_t space_id = -1; hid_t dset_id = -1; hsize_t dim1[1]; @@ -642,13 +640,11 @@ size1_helper(hid_t file, const char* filename, hid_t fapl_id, int test_file_clos if((dtype1_id = H5Dget_type(dset_id))<0) TEST_ERROR - if((dup_tid = H5Tcopy(dtype1_id))<0) TEST_ERROR - rdata.i1 = rdata.i2 = 0; strcpy(rdata.str, "\0"); /* Read data back again */ - if(H5Dread(dset_id,dup_tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,&rdata)<0) { + if(H5Dread(dset_id,dtype1_id,H5S_ALL,H5S_ALL,H5P_DEFAULT,&rdata)<0) { H5_FAILED(); AT(); printf("Can't read data\n"); goto error; @@ -661,15 +657,12 @@ size1_helper(hid_t file, const char* filename, hid_t fapl_id, int test_file_clos } /* end if */ if(H5Dclose(dset_id)<0) TEST_ERROR - if(H5Tclose(dup_tid)<0) TEST_ERROR /* Create several copies of the dataset (this increases the amount of space saved by sharing the datatype message) */ for(x=0; x<SOHM_HELPER_NUM_EX_DSETS; x++) { - if((type_id = H5Tcopy(dtype1_id)) < 0) TEST_ERROR - if((dset_id = H5Dcreate(file,EXTRA_DSETNAME[x],type_id,space_id,H5P_DEFAULT)) < 0) TEST_ERROR - - if(H5Tclose(type_id)<0) TEST_ERROR + if((dset_id = H5Dcreate(file,EXTRA_DSETNAME[x],dtype1_id,space_id,H5P_DEFAULT)) < 0) TEST_ERROR if(H5Dclose(dset_id)<0) TEST_ERROR + /* Close and re-open the file if requested*/ if(test_file_closing) { if((file = close_reopen_file(file, filename, fapl_id)) < 0) TEST_ERROR @@ -684,12 +677,10 @@ size1_helper(hid_t file, const char* filename, hid_t fapl_id, int test_file_clos if((dtype1_id = H5Dget_type(dset_id))<0) TEST_ERROR - if((dup_tid = H5Tcopy(dtype1_id))<0) TEST_ERROR - rdata.i1 = rdata.i2 = 0; /* Read data back again */ - if(H5Dread(dset_id,dup_tid,H5S_ALL,H5S_ALL,H5P_DEFAULT,&rdata)<0) { + if(H5Dread(dset_id,dtype1_id,H5S_ALL,H5S_ALL,H5P_DEFAULT,&rdata)<0) { H5_FAILED(); AT(); printf("Can't read data\n"); goto error; @@ -703,14 +694,12 @@ size1_helper(hid_t file, const char* filename, hid_t fapl_id, int test_file_clos if(H5Dclose(dset_id)<0) TEST_ERROR if(H5Tclose(dtype1_id)<0) TEST_ERROR - if(H5Tclose(dup_tid)<0) TEST_ERROR return file; error: H5E_BEGIN_TRY { + H5Sclose(space_id); H5Tclose(dtype1_id); - H5Tclose(type_id); - H5Tclose(dup_tid); H5Dclose(dset_id); H5Fclose(file); } H5E_END_TRY |