diff options
Diffstat (limited to 'hl/test')
-rw-r--r-- | hl/test/test_ds.c | 6 | ||||
-rw-r--r-- | hl/test/test_lite.c | 149 |
2 files changed, 75 insertions, 80 deletions
diff --git a/hl/test/test_ds.c b/hl/test/test_ds.c index 92365ee..265a45e 100644 --- a/hl/test/test_ds.c +++ b/hl/test/test_ds.c @@ -854,7 +854,7 @@ static int test_simple(void) */ /* create a group */ - if ((gid=H5Gcreate(fid,"grp",(size_t)0))<0) + if((gid = H5Gcreate2(fid, "grp", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; /* create the data space for the dataset */ @@ -1733,7 +1733,7 @@ static int test_errors(void) if ((fid=H5Fcreate(FILE2,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT))<0) goto out; /* create a group */ - if ((gid=H5Gcreate(fid,"grp",(size_t)0))<0) + if((gid = H5Gcreate2(fid, "grp", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; /* create the data space for the dataset */ if ((sid=H5Screate_simple(rank,dims,NULL))<0) @@ -2111,7 +2111,7 @@ static int test_iterators(void) if ((fid=H5Fcreate(FILE3,H5F_ACC_TRUNC,H5P_DEFAULT,H5P_DEFAULT))<0) goto out; /* create a group */ - if ((gid=H5Gcreate(fid,"grp",(size_t)0))<0) + if((gid = H5Gcreate2(fid, "grp", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; /* close */ if (H5Gclose(gid)<0) 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; } /*------------------------------------------------------------------------- |