summaryrefslogtreecommitdiffstats
path: root/test
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
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')
-rw-r--r--test/dsets.c52
-rw-r--r--test/ohdr.c12
2 files changed, 29 insertions, 35 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;
diff --git a/test/ohdr.c b/test/ohdr.c
index cc8841e..bd220d5 100644
--- a/test/ohdr.c
+++ b/test/ohdr.c
@@ -95,7 +95,7 @@ main(void)
/* create a new message */
TESTING("message creation");
time_new = 11111111;
- if (H5O_modify(&oh_loc, H5O_MTIME_NEW_ID, H5O_NEW_MESG, 0, 0, &time_new, H5P_DATASET_XFER_DEFAULT)<0) {
+ if(H5O_msg_create(&oh_loc, H5O_MTIME_NEW_ID, 0, 0, &time_new, H5P_DATASET_XFER_DEFAULT) < 0) {
H5_FAILED();
H5Eprint_stack(H5E_DEFAULT, stdout);
goto error;
@@ -123,7 +123,7 @@ main(void)
*/
TESTING("message modification");
time_new = 33333333;
- if (H5O_modify(&oh_loc, H5O_MTIME_NEW_ID, 0, 0, 0, &time_new, H5P_DATASET_XFER_DEFAULT)<0) {
+ if (H5O_write(&oh_loc, H5O_MTIME_NEW_ID, 0, 0, 0, &time_new, H5P_DATASET_XFER_DEFAULT)<0) {
H5_FAILED();
H5Eprint_stack(H5E_DEFAULT, stdout);
goto error;
@@ -152,7 +152,7 @@ main(void)
*/
TESTING("duplicate message creation");
time_new = 55555555;
- if (H5O_modify(&oh_loc, H5O_MTIME_NEW_ID, H5O_NEW_MESG, 0, 0, &time_new, H5P_DATASET_XFER_DEFAULT)<0) {
+ if(H5O_msg_create(&oh_loc, H5O_MTIME_NEW_ID, 0, 0, &time_new, H5P_DATASET_XFER_DEFAULT) < 0) {
H5_FAILED();
H5Eprint_stack(H5E_DEFAULT, stdout);
goto error;
@@ -180,7 +180,7 @@ main(void)
*/
TESTING("duplicate message modification");
time_new = 77777777;
- if (H5O_modify(&oh_loc, H5O_MTIME_NEW_ID, 1, 0, 0, &time_new, H5P_DATASET_XFER_DEFAULT)<0) {
+ if (H5O_write(&oh_loc, H5O_MTIME_NEW_ID, 1, 0, 0, &time_new, H5P_DATASET_XFER_DEFAULT)<0) {
H5_FAILED();
H5Eprint_stack(H5E_DEFAULT, stdout);
goto error;
@@ -214,7 +214,7 @@ main(void)
TESTING("object header overflow in memory");
for (i=0; i<40; i++) {
time_new = (i+1)*1000+1;
- if (H5O_modify(&oh_loc, H5O_MTIME_ID, H5O_NEW_MESG, 0, 0, &time_new, H5P_DATASET_XFER_DEFAULT)<0) {
+ if(H5O_msg_create(&oh_loc, H5O_MTIME_ID, 0, 0, &time_new, H5P_DATASET_XFER_DEFAULT) < 0) {
H5_FAILED();
H5Eprint_stack(H5E_DEFAULT, stdout);
goto error;
@@ -234,7 +234,7 @@ main(void)
TESTING("object header overflow on disk");
for (i=0; i<10; i++) {
time_new = (i + 1) * 1000 + 10;
- if (H5O_modify(&oh_loc, H5O_MTIME_NEW_ID, H5O_NEW_MESG, 0, 0, &time_new, H5P_DATASET_XFER_DEFAULT)<0) {
+ if(H5O_msg_create(&oh_loc, H5O_MTIME_NEW_ID, 0, 0, &time_new, H5P_DATASET_XFER_DEFAULT) < 0) {
H5_FAILED();
H5Eprint_stack(H5E_DEFAULT, stdout);
goto error;