diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2007-08-23 20:25:25 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2007-08-23 20:25:25 (GMT) |
commit | 63eb5b9ebbf4b9d63ee9173fec73027a0da1e33e (patch) | |
tree | f0947a1f2d2d60d55935f092cbb7071b4e62b301 /test/flush1.c | |
parent | 3183d38231c3d2de3dd9e18abac1e753ca727013 (diff) | |
download | hdf5-63eb5b9ebbf4b9d63ee9173fec73027a0da1e33e.zip hdf5-63eb5b9ebbf4b9d63ee9173fec73027a0da1e33e.tar.gz hdf5-63eb5b9ebbf4b9d63ee9173fec73027a0da1e33e.tar.bz2 |
[svn-r14104] Description:
Pursue calls to H5Gcreate() relentlessly and ruthlessly exterminate
them, leaving only a few tame specimens in text files and comments. ;-)
Tested on:
Mac OS X/32 10.4.10 (amazon)
FreeBSD/32 6.2 (duty)
FreeBSD/64 6.2 (liberty)
Linux/32 2.6 (kagiso)
Linux/64 2.6 (smirom)
Solaris/32 5.10 (linew)
Diffstat (limited to 'test/flush1.c')
-rw-r--r-- | test/flush1.c | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/test/flush1.c b/test/flush1.c index 5f8eefc..04345e0 100644 --- a/test/flush1.c +++ b/test/flush1.c @@ -58,42 +58,37 @@ create_file(char* name, hid_t fapl) hsize_t ch_size[2] = {5, 5}; size_t i, j; - if ((file=H5Fcreate(name, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0) goto error; + if((file = H5Fcreate(name, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR /* Create a chunked dataset */ - if ((dcpl=H5Pcreate(H5P_DATASET_CREATE))<0) goto error; - if (H5Pset_chunk(dcpl, 2, ch_size)<0) goto error; - if ((space=H5Screate_simple(2, ds_size, NULL))<0) goto error; - if ((dset=H5Dcreate(file, "dset", H5T_NATIVE_FLOAT, space, H5P_DEFAULT))<0) - goto error; + if((dcpl = H5Pcreate(H5P_DATASET_CREATE)) < 0) FAIL_STACK_ERROR + if(H5Pset_chunk(dcpl, 2, ch_size) < 0) FAIL_STACK_ERROR + if((space = H5Screate_simple(2, ds_size, NULL)) < 0) FAIL_STACK_ERROR + if((dset = H5Dcreate(file, "dset", H5T_NATIVE_FLOAT, space, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Write some data */ - for (i=0; i<ds_size[0]; i++) { + for(i = 0; i < ds_size[0]; i++) /* * The extra cast in the following statement is a bug workaround * for the Win32 version 5.0 compiler. * 1998-11-06 ptl */ - for (j=0; j<(size_t)ds_size[1]; j++) { + for(j = 0; j < (size_t)ds_size[1]; j++) the_data[i][j] = (double)(hssize_t)i/(hssize_t)(j+1); - } - } - if (H5Dwrite(dset, H5T_NATIVE_DOUBLE, space, space, H5P_DEFAULT, - the_data)<0) goto error; + if(H5Dwrite(dset, H5T_NATIVE_DOUBLE, space, space, H5P_DEFAULT, the_data) < 0) FAIL_STACK_ERROR /* Create some groups */ - if ((groups=H5Gcreate(file, "some_groups", 0))<0) goto error; - for (i=0; i<100; i++) { + if((groups = H5Gcreate2(file, "some_groups", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + for(i = 0; i < 100; i++) { sprintf(name, "grp%02u", (unsigned)i); - if ((grp=H5Gcreate(groups, name, 0))<0) goto error; - if (H5Gclose(grp)<0) goto error; - } + if((grp = H5Gcreate2(groups, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR + if(H5Gclose(grp)<0) FAIL_STACK_ERROR + } /* end for */ return file; error: - HD_exit(1); - + HD_exit(1); } |