summaryrefslogtreecommitdiffstats
path: root/test/dsets.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2006-12-03 15:29:41 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2006-12-03 15:29:41 (GMT)
commit9f39e59d913b10429bc64fb0497cfaa02d256c51 (patch)
tree187ce3e49fe13475dbce4a588b174c088f54b7e4 /test/dsets.c
parentcf925456704a232e626377f33b890461b9aa6b6d (diff)
downloadhdf5-9f39e59d913b10429bc64fb0497cfaa02d256c51.zip
hdf5-9f39e59d913b10429bc64fb0497cfaa02d256c51.tar.gz
hdf5-9f39e59d913b10429bc64fb0497cfaa02d256c51.tar.bz2
[svn-r13012] Description:
Refactor object header code to separate process of creating an object header message from the process of writing to an existing one. Start renaming operations that deal with object header messages to have "H5O_msg_" prefix... Tested on: Mac OS X/32 10.4.8 (amazon) FreeBSD/32 4.11 (sleipnir) Linux/32 2.4 (heping) AIX/32 5.? (copper)
Diffstat (limited to 'test/dsets.c')
-rw-r--r--test/dsets.c52
1 files changed, 23 insertions, 29 deletions
diff --git a/test/dsets.c b/test/dsets.c
index 9e79b41..b6182f1 100644
--- a/test/dsets.c
+++ b/test/dsets.c
@@ -542,61 +542,54 @@ test_compact_io(hid_t fapl)
TESTING("compact dataset I/O");
/* Initialize data */
- n=0;
- for(i=0; i<16; i++) {
- for(j=0; j<8; j++) {
+ n = 0;
+ for(i = 0; i < 16; i++)
+ for(j = 0; j < 8; j++)
wbuf[i][j] = n++;
- }
- }
/* Create a small data space for compact dataset */
dims[0] = 16;
dims[1] = 8;
- space = H5Screate_simple(2, dims, NULL);
- assert(space>=0);
+ if((space = H5Screate_simple(2, dims, NULL)) < 0) TEST_ERROR
/* Create a file */
h5_fixname(FILENAME[1], fapl, filename, sizeof filename);
if((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0)
- goto error;
+ TEST_ERROR
/* Create property list for compact dataset creation */
- plist = H5Pcreate(H5P_DATASET_CREATE);
- assert(plist >= 0);
- status = H5Pset_layout(plist, H5D_COMPACT);
- assert(status >= 0);
- status = H5Pset_alloc_time(plist, H5D_ALLOC_TIME_EARLY);
- assert(status >= 0);
+ if((plist = H5Pcreate(H5P_DATASET_CREATE)) < 0) TEST_ERROR
+ if(H5Pset_layout(plist, H5D_COMPACT) < 0) TEST_ERROR
+ if(H5Pset_alloc_time(plist, H5D_ALLOC_TIME_EARLY) < 0) TEST_ERROR
/* Create and write to a compact dataset */
- if((dataset = H5Dcreate(file, DSET_COMPACT_IO_NAME, H5T_NATIVE_INT, space,
- plist))<0)
- goto error;
+ if((dataset = H5Dcreate(file, DSET_COMPACT_IO_NAME, H5T_NATIVE_INT, space, plist))<0)
+ TEST_ERROR
/* Test dataset address. Should be undefined. */
- if(H5Dget_offset(dataset)!=HADDR_UNDEF) goto error;
+ if(H5Dget_offset(dataset)!=HADDR_UNDEF) TEST_ERROR
if(H5Dwrite(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, wbuf)<0)
- goto error;
+ TEST_ERROR
/* Test dataset address. Should be undefined. */
- if(H5Dget_offset(dataset)!=HADDR_UNDEF) goto error;
+ if(H5Dget_offset(dataset)!=HADDR_UNDEF) TEST_ERROR
/* Close file */
- H5Sclose(space);
- H5Pclose(plist);
- H5Dclose(dataset);
- H5Fclose(file);
+ if(H5Sclose(space) < 0) TEST_ERROR
+ if(H5Pclose(plist) < 0) TEST_ERROR
+ if(H5Dclose(dataset) < 0) TEST_ERROR
+ if(H5Fclose(file) < 0) TEST_ERROR
/*
* Open the file and check data
*/
if((file=H5Fopen(filename, H5F_ACC_RDONLY, fapl))<0)
- goto error;
+ TEST_ERROR
if((dataset = H5Dopen(file, DSET_COMPACT_IO_NAME))<0)
- goto error;
+ TEST_ERROR
if(H5Dread(dataset, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf)<0)
- goto error;
+ TEST_ERROR
/* Check that the values read are the same as the values written */
for (i = 0; i < 16; i++) {
@@ -612,8 +605,9 @@ test_compact_io(hid_t fapl)
}
}
- H5Dclose(dataset);
- H5Fclose(file);
+ if(H5Dclose(dataset) < 0) TEST_ERROR
+ if(H5Fclose(file) < 0) TEST_ERROR
+
PASSED();
return 0;