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 /hl/test/test_lite.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 'hl/test/test_lite.c')
-rw-r--r-- | hl/test/test_lite.c | 149 |
1 files changed, 72 insertions, 77 deletions
diff --git a/hl/test/test_lite.c b/hl/test/test_lite.c index 5055099..61d9bca 100644 --- a/hl/test/test_lite.c +++ b/hl/test/test_lite.c @@ -398,87 +398,82 @@ out: *------------------------------------------------------------------------- */ -static int test_attr( void ) +static int test_attr(void) { + hid_t file_id; + hid_t dataset_id; + hid_t group_id; + hid_t space_id; + hsize_t dims[1] = { 5 }; + + /* Create a new file using default properties. */ + file_id = H5Fcreate(FILE_NAME2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + + /*------------------------------------------------------------------------- + * Create a dataset named "dset" on the root group + *------------------------------------------------------------------------- + */ + + /* Create the data space */ + if((space_id = H5Screate_simple(1, dims, NULL)) < 0) goto out; + + /* Create the dataset */ + if((dataset_id = H5Dcreate(file_id , "dset", H5T_NATIVE_INT, space_id, H5P_DEFAULT)) < 0) goto out; + + /* Close */ + H5Dclose(dataset_id); + + /*------------------------------------------------------------------------- + * Create a group named "grp" on the root group + *------------------------------------------------------------------------- + */ + + /* Create a group. */ + if((group_id = H5Gcreate2(file_id, "grp", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; + + /* Close */ + H5Gclose(group_id); + + /*------------------------------------------------------------------------- + * + * Create attributes in the root group + * Note that we are calling the H5LTset_attribute functions with the name "." + * + *------------------------------------------------------------------------- + */ + if(make_attributes(file_id, ".") < 0) goto out; + + /*------------------------------------------------------------------------- + * + * Create attributes in the dataset "dset" + * + *------------------------------------------------------------------------- + */ + if(make_attributes(file_id, "dset") < 0) goto out; + + /*------------------------------------------------------------------------- + * + * Create attributes in the group "grp" + * + *------------------------------------------------------------------------- + */ + if(make_attributes(file_id, "grp") < 0) goto out; + + /*------------------------------------------------------------------------- + * end + *------------------------------------------------------------------------- + */ + /* Close the file. */ + H5Fclose(file_id); - hid_t file_id; - hid_t dataset_id; - hid_t group_id; - hid_t space_id; - hsize_t dims[1] = { 5 }; - - /* Create a new file using default properties. */ - file_id = H5Fcreate( FILE_NAME2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT ); - -/*------------------------------------------------------------------------- - * Create a dataset named "dset" on the root group - *------------------------------------------------------------------------- - */ - - /* Create the data space */ - if ((space_id = H5Screate_simple( 1, dims, NULL ))<0) goto out; - - /* Create the dataset */ - if ((dataset_id = H5Dcreate( file_id , "dset", H5T_NATIVE_INT, space_id, - H5P_DEFAULT ))<0) goto out; - - /* Close */ - H5Dclose( dataset_id ); - -/*------------------------------------------------------------------------- - * Create a group named "grp" on the root group - *------------------------------------------------------------------------- - */ - - /* Create a group. */ - if ((group_id = H5Gcreate( file_id, "grp", (size_t)0 ))<0) - goto out; - - /* Close */ - H5Gclose( group_id ); - -/*------------------------------------------------------------------------- - * - * Create attributes in the root group - * Note that we are calling the H5LTset_attribute functions with the name "." - * - *------------------------------------------------------------------------- - */ - if (make_attributes( file_id, "." )<0) - goto out; - -/*------------------------------------------------------------------------- - * - * Create attributes in the dataset "dset" - * - *------------------------------------------------------------------------- - */ - if (make_attributes( file_id, "dset" )<0) - goto out; - -/*------------------------------------------------------------------------- - * - * Create attributes in the group "grp" - * - *------------------------------------------------------------------------- - */ - if (make_attributes( file_id, "grp" )<0) - goto out; - -/*------------------------------------------------------------------------- - * end - *------------------------------------------------------------------------- - */ - /* Close the file. */ - H5Fclose( file_id ); - - return 0; + return 0; out: - /* Close the file. */ - H5Fclose( file_id ); - H5_FAILED(); - return -1; + /* Close the file. */ + H5Fclose(file_id); + + H5_FAILED(); + return -1; } /*------------------------------------------------------------------------- |