diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/dangle.c | 7 | ||||
-rw-r--r-- | test/dt_arith.c | 54 | ||||
-rw-r--r-- | test/dtypes.c | 48 | ||||
-rw-r--r-- | test/getname.c | 115 | ||||
-rw-r--r-- | test/links.c | 25 | ||||
-rwxr-xr-x | test/objcopy.c | 14 | ||||
-rw-r--r-- | test/tfile.c | 12 | ||||
-rw-r--r-- | test/th5o.c | 16 | ||||
-rw-r--r-- | test/tmisc.c | 46 | ||||
-rw-r--r-- | test/ttime.c | 16 | ||||
-rw-r--r-- | test/tunicode.c | 8 | ||||
-rw-r--r-- | test/tvlstr.c | 8 | ||||
-rw-r--r-- | test/unlink.c | 2 |
13 files changed, 166 insertions, 205 deletions
diff --git a/test/dangle.c b/test/dangle.c index 7b657ac..cbd29a1 100644 --- a/test/dangle.c +++ b/test/dangle.c @@ -285,10 +285,9 @@ test_dangle_datatype1(H5F_close_degree_t degree) TEST_ERROR; /* Leave open a _lot_ of objects */ - for(u = 0; u < MAX_DANGLE; u++) { - if((tid = H5Topen(fid, TYPENAME)) < 0) - TEST_ERROR; - } /* end for */ + for(u = 0; u < MAX_DANGLE; u++) + if((tid = H5Topen2(fid, TYPENAME, H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR if(degree == H5F_CLOSE_SEMI) { H5E_BEGIN_TRY { diff --git a/test/dt_arith.c b/test/dt_arith.c index e27176d..67885a3 100644 --- a/test/dt_arith.c +++ b/test/dt_arith.c @@ -1001,23 +1001,20 @@ test_derived_flt(void) goto error; } - if((tid1 = H5Topen(file, "new float type 1")) < 0) { - H5_FAILED(); - printf("Can't open datatype\n"); - goto error; - } - if(H5Tget_fields(tid1, &spos, &epos, &esize, &mpos, &msize)<0) { + if((tid1 = H5Topen2(file, "new float type 1", H5P_DEFAULT)) < 0) + FAIL_PUTS_ERROR("Can't open datatype") + if(H5Tget_fields(tid1, &spos, &epos, &esize, &mpos, &msize) < 0) { H5_FAILED(); printf("Can't get fields\n"); goto error; } - if(spos!=44 || epos!=34 || esize!=10 || mpos!=3 || msize!=31) { + if(spos != 44 || epos != 34 || esize != 10 || mpos != 3 || msize != 31) { H5_FAILED(); printf("Wrong field values\n"); goto error; } - if(H5Tget_precision(tid1)!=42) { + if(H5Tget_precision(tid1) != 42) { H5_FAILED(); printf("Can't get precision or wrong precision\n"); goto error; @@ -1163,23 +1160,20 @@ test_derived_flt(void) goto error; } - if((tid2 = H5Topen(file, "new float type 2")) < 0) { - H5_FAILED(); - printf("Can't open datatype\n"); - goto error; - } - if(H5Tget_fields(tid2, &spos, &epos, &esize, &mpos, &msize)<0) { + if((tid2 = H5Topen2(file, "new float type 2", H5P_DEFAULT)) < 0) + FAIL_PUTS_ERROR("Can't open datatype") + if(H5Tget_fields(tid2, &spos, &epos, &esize, &mpos, &msize) < 0) { H5_FAILED(); printf("Can't get fields\n"); goto error; } - if(spos!=23 || epos!=16 || esize!=7 || mpos!=0 || msize!=16) { + if(spos != 23 || epos != 16 || esize != 7 || mpos != 0 || msize != 16) { H5_FAILED(); printf("Wrong field values\n"); goto error; } - if(H5Tget_precision(tid2)!=24) { + if(H5Tget_precision(tid2) != 24) { H5_FAILED(); printf("Can't get precision or wrong precision\n"); goto error; @@ -1427,23 +1421,19 @@ test_derived_integer(void) goto error; } - if((tid1 = H5Topen(file, "new integer type 1")) < 0) { - H5_FAILED(); - printf("Can't open datatype\n"); - goto error; - } - - if(H5Tget_precision(tid1)!=24) { + if((tid1 = H5Topen2(file, "new integer type 1", H5P_DEFAULT)) < 0) + FAIL_PUTS_ERROR("Can't open datatype") + if(H5Tget_precision(tid1) != 24) { H5_FAILED(); printf("Can't get precision or wrong precision\n"); goto error; } - if(H5Tget_offset(tid1)!=0) { + if(H5Tget_offset(tid1) != 0) { H5_FAILED(); printf("Can't get offset or wrong offset\n"); goto error; } - if(H5Tget_size(tid1)!=3) { + if(H5Tget_size(tid1) != 3) { H5_FAILED(); printf("Can't get size or wrong size\n"); goto error; @@ -1492,23 +1482,19 @@ test_derived_integer(void) goto error; } - if((tid2 = H5Topen(file, "new integer type 2")) < 0) { - H5_FAILED(); - printf("Can't open datatype\n"); - goto error; - } - - if(H5Tget_precision(tid2)!=48) { + if((tid2 = H5Topen2(file, "new integer type 2", H5P_DEFAULT)) < 0) + FAIL_PUTS_ERROR("Can't open datatype") + if(H5Tget_precision(tid2) != 48) { H5_FAILED(); printf("Can't get precision or wrong precision\n"); goto error; } - if(H5Tget_offset(tid2)!=10) { + if(H5Tget_offset(tid2) != 10) { H5_FAILED(); printf("Can't get offset or wrong offset\n"); goto error; } - if(H5Tget_size(tid2)!=8) { + if(H5Tget_size(tid2) != 8) { H5_FAILED(); printf("Can't get size or wrong size\n"); goto error; diff --git a/test/dtypes.c b/test/dtypes.c index d0e4d83..2f8f030 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -1584,20 +1584,17 @@ test_compound_9(void) goto error; } /* end if */ - if((cmpd_tid = H5Topen(file, "compound")) < 0) { - H5_FAILED(); AT(); - printf("Can't open datatype\n"); - goto error; - } /* end if */ + if((cmpd_tid = H5Topen2(file, "compound", H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR - if((dup_tid = H5Tcopy(cmpd_tid))<0) { + if((dup_tid = H5Tcopy(cmpd_tid)) < 0) { H5_FAILED(); AT(); printf("Can't copy datatype\n"); goto error; } /* end if */ dim1[0] = 1; - if((space_id=H5Screate_simple(1,dim1,NULL))<0) { + if((space_id = H5Screate_simple(1, dim1, NULL)) < 0) { H5_FAILED(); AT(); printf("Can't create space\n"); goto error; @@ -2337,16 +2334,10 @@ test_query(void) } /* end if */ /* Open the dataytpe for query */ - if((tid1 = H5Topen(file, compnd_type)) < 0) { - H5_FAILED(); - printf("Can't open datatype\n"); - goto error; - } /* end if */ - if((tid2 = H5Topen(file, enum_type)) < 0) { - H5_FAILED(); - printf("Can't open datatype\n"); - goto error; - } /* end if */ + if((tid1 = H5Topen2(file, compnd_type, H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + if((tid2 = H5Topen2(file, enum_type, H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR /* Query member number and member index by name, for compound type */ if(H5Tget_nmembers(tid1) != 4) { @@ -2668,7 +2659,8 @@ test_named (hid_t fapl) * Close the committed type and reopen it. It should return a named type. */ if(H5Tclose(type) < 0) goto error; - if((type = H5Topen(file, "native-int")) < 0) goto error; + if((type = H5Topen2(file, "native-int", H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR if((status = H5Tcommitted(type)) < 0) goto error; if(!status) { H5_FAILED(); @@ -4186,16 +4178,10 @@ test_encode(void) enum_buf_size = 0; /* Open the dataytpe for query */ - if((tid1=H5Topen(file, compnd_type))<0) { - H5_FAILED(); - printf("Can't open datatype\n"); - goto error; - } /* end if */ - if((tid2=H5Topen(file, enum_type))<0) { - H5_FAILED(); - printf("Can't open datatype\n"); - goto error; - } /* end if */ + if((tid1 = H5Topen2(file, compnd_type, H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR + if((tid2 = H5Topen2(file, enum_type, H5P_DEFAULT)) < 0) + FAIL_STACK_ERROR /* Encode compound type in a buffer */ @@ -4411,7 +4397,7 @@ test_latest(void) FAIL_STACK_ERROR /* Open the dataytpe for query */ - if((tid2 = H5Topen(file, compnd_type)) < 0) + if((tid2 = H5Topen2(file, compnd_type, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify that the datatype was encoded/decoded correctly */ @@ -4476,7 +4462,7 @@ test_latest(void) FAIL_STACK_ERROR /* Open the dataytpe for query */ - if((tid2 = H5Topen(file, compnd_type)) < 0) + if((tid2 = H5Topen2(file, compnd_type, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify that the datatype was encoded/decoded correctly */ @@ -4755,7 +4741,7 @@ test_compat(hid_t fapl) * Close the committed type and reopen it. It should return a named type. */ if(H5Tclose(type) < 0) FAIL_STACK_ERROR - if((type = H5Topen(file, "native-int")) < 0) FAIL_STACK_ERROR + if((type = H5Topen1(file, "native-int")) < 0) FAIL_STACK_ERROR if((status = H5Tcommitted(type)) < 0) FAIL_STACK_ERROR if(!status) FAIL_PUTS_ERROR(" Opened named types should be named types!") diff --git a/test/getname.c b/test/getname.c index b6d13d3..2f3a020 100644 --- a/test/getname.c +++ b/test/getname.c @@ -251,10 +251,10 @@ test_main(hid_t file_id, hid_t fapl) -/*------------------------------------------------------------------------- - * Test H5Iget_name with a long path - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * Test H5Iget_name with a long path + *------------------------------------------------------------------------- + */ TESTING("H5Iget_name with a long path"); @@ -312,21 +312,21 @@ test_main(hid_t file_id, hid_t fapl) PASSED(); -/*------------------------------------------------------------------------- - * Test H5Iget_name with H5Topen - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * Test H5Iget_name with H5Topen2 + *------------------------------------------------------------------------- + */ - TESTING("H5Iget_name with H5Topen"); + TESTING("H5Iget_name with H5Topen2"); /* Open the named datatype */ - if((type_id=H5Topen(file_id, "t1")) < 0) TEST_ERROR + if((type_id = H5Topen2(file_id, "t1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify */ if(check_name(type_id, "/t1", "/t1") < 0) TEST_ERROR /* Close datatype */ - H5Tclose(type_id); + if(H5Tclose(type_id) < 0) FAIL_STACK_ERROR PASSED(); @@ -379,14 +379,14 @@ test_main(hid_t file_id, hid_t fapl) /*------------------------------------------------------------------------- - * Test H5Iget_name with H5Lmove and H5Topen + * Test H5Iget_name with H5Lmove and H5Topen2 *------------------------------------------------------------------------- */ - TESTING("H5Iget_name with H5Lmove and H5Topen"); + TESTING("H5Iget_name with H5Lmove and H5Topen2"); /* Open the named datatype */ - if((type_id = H5Topen(file_id, "/t1")) < 0) FAIL_STACK_ERROR + if((type_id = H5Topen2(file_id, "/t1", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Rename datatype */ if(H5Lmove(file_id, "/t1", H5L_SAME_LOC, "/t1a", H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR @@ -965,61 +965,60 @@ test_main(hid_t file_id, hid_t fapl) PASSED(); -/*------------------------------------------------------------------------- - * Test H5Iget_name with a defined type dataset - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * Test H5Iget_name with a defined type dataset + *------------------------------------------------------------------------- + */ TESTING("H5Iget_name with a defined type dataset"); /* Create a datatype */ - if((type_id = H5Tcreate(H5T_COMPOUND, sizeof(s1_t))) < 0) TEST_ERROR + if((type_id = H5Tcreate(H5T_COMPOUND, sizeof(s1_t))) < 0) FAIL_STACK_ERROR /* Insert fields */ - if(H5Tinsert(type_id, "a", HOFFSET(s1_t, a), H5T_NATIVE_INT) < 0) TEST_ERROR - if(H5Tinsert(type_id, "b", HOFFSET(s1_t, b), H5T_NATIVE_INT) < 0) TEST_ERROR - if(H5Tinsert(type_id, "c", HOFFSET(s1_t, c), H5T_NATIVE_FLOAT) < 0) TEST_ERROR + if(H5Tinsert(type_id, "a", HOFFSET(s1_t, a), H5T_NATIVE_INT) < 0) FAIL_STACK_ERROR + if(H5Tinsert(type_id, "b", HOFFSET(s1_t, b), H5T_NATIVE_INT) < 0) FAIL_STACK_ERROR + if(H5Tinsert(type_id, "c", HOFFSET(s1_t, c), H5T_NATIVE_FLOAT) < 0) FAIL_STACK_ERROR /* Create group "g17" */ if((group_id = H5Gcreate2(file_id, "g17", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Save datatype for later */ - if(H5Tcommit2(group_id, "t", type_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Tcommit2(group_id, "t", type_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Create a dataspace */ - if((space_id = H5Screate_simple(1, dims, NULL)) < 0) TEST_ERROR + if((space_id = H5Screate_simple(1, dims, NULL)) < 0) FAIL_STACK_ERROR /* Create a new dataset */ - if((dataset_id = H5Dcreate(group_id , "d", type_id, space_id, - H5P_DEFAULT)) < 0) TEST_ERROR + if((dataset_id = H5Dcreate(group_id , "d", type_id, space_id, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Close */ - H5Dclose(dataset_id); - H5Tclose(type_id); - H5Sclose(space_id); - H5Gclose(group_id); + if(H5Dclose(dataset_id) < 0) FAIL_STACK_ERROR + if(H5Tclose(type_id) < 0) FAIL_STACK_ERROR + if(H5Sclose(space_id) < 0) FAIL_STACK_ERROR + if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR /* Open the named datatype */ - if((type_id=H5Topen(file_id, "/g17/t")) < 0) TEST_ERROR + if((type_id = H5Topen2(file_id, "/g17/t", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify */ if(check_name(type_id, "/g17/t", "/g17/t") < 0) TEST_ERROR /* Close datatype */ - H5Tclose(type_id); + if(H5Tclose(type_id) < 0) FAIL_STACK_ERROR /* Reopen the dataset */ - if((dataset_id = H5Dopen(file_id, "/g17/d")) < 0) TEST_ERROR + if((dataset_id = H5Dopen(file_id, "/g17/d")) < 0) FAIL_STACK_ERROR /* Get datatype*/ - if((type_id=H5Dget_type(dataset_id)) < 0) TEST_ERROR + if((type_id = H5Dget_type(dataset_id)) < 0) FAIL_STACK_ERROR /* Verify */ if(check_name(type_id, "/g17/t", "/g17/t") < 0) TEST_ERROR /* Close */ - H5Dclose(dataset_id); - H5Tclose(type_id); + if(H5Dclose(dataset_id) < 0) FAIL_STACK_ERROR + if(H5Tclose(type_id) < 0) FAIL_STACK_ERROR PASSED(); @@ -1243,10 +1242,10 @@ test_main(hid_t file_id, hid_t fapl) PASSED(); -/*------------------------------------------------------------------------- - * Test H5Iget_name with added names with mounting - *------------------------------------------------------------------------- - */ + /*------------------------------------------------------------------------- + * Test H5Iget_name with added names with mounting + *------------------------------------------------------------------------- + */ TESTING("H5Iget_name with added names with mounting"); @@ -1255,14 +1254,14 @@ test_main(hid_t file_id, hid_t fapl) if((group2_id = H5Gcreate2(file_id, "/g18/g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Also create a dataset and a datatype */ - if((space_id = H5Screate_simple(1, dims, NULL)) < 0) TEST_ERROR - if((type_id = H5Tcopy(H5T_NATIVE_INT)) < 0) TEST_ERROR - if((dataset_id = H5Dcreate(file_id, "g18/d2", type_id, space_id, H5P_DEFAULT)) < 0) TEST_ERROR + if((space_id = H5Screate_simple(1, dims, NULL)) < 0) FAIL_STACK_ERROR + if((type_id = H5Tcopy(H5T_NATIVE_INT)) < 0) FAIL_STACK_ERROR + if((dataset_id = H5Dcreate(file_id, "g18/d2", type_id, space_id, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR - if(H5Tcommit2(file_id, "g18/t2", type_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR + if(H5Tcommit2(file_id, "g18/t2", type_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT) < 0) FAIL_STACK_ERROR /* Create second file and group "/g3/g4/g5" in it */ - file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); + if((file1_id = H5Fcreate(filename1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) FAIL_STACK_ERROR if((group3_id = H5Gcreate2(file1_id, "/g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if((group4_id = H5Gcreate2(file1_id, "/g3/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if((group5_id = H5Gcreate2(file1_id, "/g3/g4/g5", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR @@ -1282,7 +1281,7 @@ test_main(hid_t file_id, hid_t fapl) /* Open the mounted group, dataset, and datatype through their new names */ if((group6_id = H5Gopen2(file1_id, "/g3/g4/g18/g2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if((dataset2_id = H5Dopen(file1_id, "/g3/g4/g18/d2")) < 0) FAIL_STACK_ERROR - if((type2_id = H5Topen(file1_id, "/g3/g4/g18/t2")) < 0) FAIL_STACK_ERROR + if((type2_id = H5Topen2(file1_id, "/g3/g4/g18/t2", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Verify names */ if(check_name(group6_id, "/g3/g4/g18/g2", "/g3/g4/g18/g2") < 0) TEST_ERROR @@ -1295,7 +1294,7 @@ test_main(hid_t file_id, hid_t fapl) if(check_name(type_id, "/g18/t2", "/g18/t2") < 0) TEST_ERROR /* Unmount */ - if(H5Funmount(file1_id, "/g3/g4") < 0) TEST_ERROR + if(H5Funmount(file1_id, "/g3/g4") < 0) FAIL_STACK_ERROR /* Get name for the IDs of the first file, should be unchanged */ if(check_name(group2_id, "/g18/g2", "/g18/g2") < 0) TEST_ERROR @@ -1307,17 +1306,17 @@ test_main(hid_t file_id, hid_t fapl) if(check_name(dataset2_id, "/g18/d2", "") < 0) TEST_ERROR if(check_name(type2_id, "/g18/t2", "") < 0) TEST_ERROR - H5Tclose(type_id); - H5Tclose(type2_id); - H5Dclose(dataset_id); - H5Dclose(dataset2_id); - H5Gclose(group_id); - H5Gclose(group2_id); - H5Gclose(group3_id); - H5Gclose(group4_id); - H5Gclose(group5_id); - H5Gclose(group6_id); - H5Fclose(file1_id); + if(H5Tclose(type_id) < 0) FAIL_STACK_ERROR + if(H5Tclose(type2_id) < 0) FAIL_STACK_ERROR + if(H5Dclose(dataset_id) < 0) FAIL_STACK_ERROR + if(H5Dclose(dataset2_id) < 0) FAIL_STACK_ERROR + if(H5Gclose(group_id) < 0) FAIL_STACK_ERROR + if(H5Gclose(group2_id) < 0) FAIL_STACK_ERROR + if(H5Gclose(group3_id) < 0) FAIL_STACK_ERROR + if(H5Gclose(group4_id) < 0) FAIL_STACK_ERROR + if(H5Gclose(group5_id) < 0) FAIL_STACK_ERROR + if(H5Gclose(group6_id) < 0) FAIL_STACK_ERROR + if(H5Fclose(file1_id) < 0) FAIL_STACK_ERROR PASSED(); diff --git a/test/links.c b/test/links.c index 30509b4..8aa5f4a 100644 --- a/test/links.c +++ b/test/links.c @@ -778,7 +778,7 @@ test_h5l_create(hid_t fapl, hbool_t new_format) if(H5Tclose(type_id) < 0) TEST_ERROR /* Re-open datatype using new link */ - if((type_id = H5Topen(group_id, "datatype")) < 0) TEST_ERROR + if((type_id = H5Topen2(group_id, "datatype", H5P_DEFAULT)) < 0) TEST_ERROR /* Link nameless group to root group and close the group ID*/ if(H5Llink(file_id, "/group", group_id, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR @@ -3450,7 +3450,7 @@ external_link_closing(hid_t fapl, hbool_t new_format) /* Test H5*open */ if((gid = H5Gopen2(fid1, "elink/elink/elink/group1_moved", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR - if((tid = H5Topen(fid1, "elink/elink/elink/type1_moved")) < 0) FAIL_STACK_ERROR + if((tid = H5Topen2(fid1, "elink/elink/elink/type1_moved", H5P_DEFAULT)) < 0) FAIL_STACK_ERROR if((did = H5Dopen(fid1, "elink/elink/elink/dataset1_moved")) < 0) FAIL_STACK_ERROR /* Close objects */ if(H5Gclose(gid) < 0) FAIL_STACK_ERROR @@ -5095,21 +5095,12 @@ lapl_nlinks(hid_t fapl, hbool_t new_format) /* Try to open the objects using too many symlinks with default *APLs */ H5E_BEGIN_TRY { - if((gid = H5Gopen2(fid, "soft17", H5P_DEFAULT)) >=0) { - H5_FAILED(); - puts(" Should have failed for too many nested links."); - TEST_ERROR - } - if((tid = H5Topen2(fid, "soft17/datatype", H5P_DEFAULT)) >=0) { - H5_FAILED(); - puts(" Should have failed for too many nested links."); - TEST_ERROR - } - if((did = H5Dopen2(fid, "soft17/dataset", H5P_DEFAULT)) >=0) { - H5_FAILED(); - puts(" Should have failed for too many nested links."); - TEST_ERROR - } + if((gid = H5Gopen2(fid, "soft17", H5P_DEFAULT)) >= 0) + FAIL_PUTS_ERROR(" Should have failed for too many nested links.") + if((tid = H5Topen2(fid, "soft17/datatype", H5P_DEFAULT)) >= 0) + FAIL_PUTS_ERROR(" Should have failed for too many nested links.") + if((did = H5Dopen2(fid, "soft17/dataset", H5P_DEFAULT)) >= 0) + FAIL_PUTS_ERROR(" Should have failed for too many nested links.") } H5E_END_TRY /* Create property lists with nlinks set */ diff --git a/test/objcopy.c b/test/objcopy.c index ef35c54..f6d32d1 100755 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -1434,10 +1434,10 @@ test_copy_named_datatype(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if(H5Ocopy(fid_src, NAME_DATATYPE_SIMPLE, fid_dst, NAME_DATATYPE_SIMPLE, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* open the datatype for copy */ - if((tid = H5Topen(fid_src, NAME_DATATYPE_SIMPLE)) < 0) TEST_ERROR + if((tid = H5Topen2(fid_src, NAME_DATATYPE_SIMPLE, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* open the copied datatype */ - if((tid2 = H5Topen(fid_dst, NAME_DATATYPE_SIMPLE)) < 0) TEST_ERROR + if((tid2 = H5Topen2(fid_dst, NAME_DATATYPE_SIMPLE, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Compare the datatypes */ if(H5Tequal(tid, tid2) != TRUE) TEST_ERROR @@ -1527,10 +1527,10 @@ test_copy_named_datatype_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if(H5Ocopy(fid_src, NAME_DATATYPE_VL, fid_dst, NAME_DATATYPE_VL, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* open the datatype for copy */ - if((tid = H5Topen(fid_src, NAME_DATATYPE_VL)) < 0) TEST_ERROR + if((tid = H5Topen2(fid_src, NAME_DATATYPE_VL, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* open the copied datatype */ - if((tid2 = H5Topen(fid_dst, NAME_DATATYPE_VL)) < 0) TEST_ERROR + if((tid2 = H5Topen2(fid_dst, NAME_DATATYPE_VL, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Compare the datatypes */ if(H5Tequal(tid, tid2) != TRUE) TEST_ERROR @@ -1626,10 +1626,10 @@ test_copy_named_datatype_vl_vl(hid_t fcpl_src, hid_t fcpl_dst, hid_t fapl) if(H5Ocopy(fid_src, NAME_DATATYPE_VL_VL, fid_dst, NAME_DATATYPE_VL_VL, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* open the datatype for copy */ - if((tid = H5Topen(fid_src, NAME_DATATYPE_VL_VL)) < 0) TEST_ERROR + if((tid = H5Topen2(fid_src, NAME_DATATYPE_VL_VL, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* open the copied datatype */ - if((tid2 = H5Topen(fid_dst, NAME_DATATYPE_VL_VL)) < 0) TEST_ERROR + if((tid2 = H5Topen2(fid_dst, NAME_DATATYPE_VL_VL, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Compare the datatypes */ if(H5Tequal(tid, tid2) != TRUE) TEST_ERROR @@ -5556,7 +5556,7 @@ test_copy_same_file_named_datatype(hid_t fcpl_src, hid_t fapl) if(H5Ocopy(fid, NAME_DATATYPE_SIMPLE, fid, NAME_DATATYPE_SIMPLE2, H5P_DEFAULT, H5P_DEFAULT) < 0) TEST_ERROR /* open the copied datatype */ - if((tid2 = H5Topen(fid, NAME_DATATYPE_SIMPLE2)) < 0) TEST_ERROR + if((tid2 = H5Topen2(fid, NAME_DATATYPE_SIMPLE2, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Compare the datatypes */ if(H5Tequal(tid, tid2) != TRUE) TEST_ERROR diff --git a/test/tfile.c b/test/tfile.c index 26a92fa..e37a060 100644 --- a/test/tfile.c +++ b/test/tfile.c @@ -1420,15 +1420,15 @@ test_file_open_dot(void) /* Open a named datatype with no name using the file ID */ H5E_BEGIN_TRY { - tid2 = H5Topen(fid, "."); + tid2 = H5Topen2(fid, ".", H5P_DEFAULT); } H5E_END_TRY; - VERIFY(tid2, FAIL, "H5Topen"); + VERIFY(tid2, FAIL, "H5Topen2"); /* Open a named datatype with no name using the group ID */ H5E_BEGIN_TRY { - tid2 = H5Topen(gid, "."); + tid2 = H5Topen2(gid, ".", H5P_DEFAULT); } H5E_END_TRY; - VERIFY(tid2, FAIL, "H5Topen"); + VERIFY(tid2, FAIL, "H5Topen2"); /* Create a group with no name using the file ID */ H5E_BEGIN_TRY { @@ -1822,8 +1822,8 @@ test_file_double_datatype_open(void) CHECK(type1_id, FAIL, "H5Tcopy"); ret = H5Tcommit2(file1_id, TYPE_NAME, type1_id, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); CHECK(ret, FAIL, "H5Tcommit2"); - type2_id = H5Topen(file2_id, TYPE_NAME); - CHECK(type2_id, FAIL, "H5Topen"); + type2_id = H5Topen2(file2_id, TYPE_NAME, H5P_DEFAULT); + CHECK(type2_id, FAIL, "H5Topen2"); /* Note "assymetric" close order */ ret = H5Tclose(type1_id); diff --git a/test/th5o.c b/test/th5o.c index 49f982a..a1843ea 100644 --- a/test/th5o.c +++ b/test/th5o.c @@ -215,8 +215,8 @@ test_h5o_close(void) /* Make sure H5Oclose can close objects opened with H5*open */ grp = H5Gopen2(fid, "group", H5P_DEFAULT); CHECK(grp, FAIL, "H5Gopen2"); - dtype = H5Topen(fid, "group/datatype"); - CHECK(dtype, FAIL, "H5Topen"); + dtype = H5Topen2(fid, "group/datatype", H5P_DEFAULT); + CHECK(dtype, FAIL, "H5Topen2"); dset = H5Dopen(fid, "dataset"); CHECK(dset, FAIL, "H5Dopen"); @@ -480,8 +480,8 @@ test_h5o_refcount(void) grp = H5Gopen2(fid, "group", H5P_DEFAULT); CHECK(grp, FAIL, "H5Gopen2"); - dtype = H5Topen(fid, "datatype"); - CHECK(dtype, FAIL, "H5Topen"); + dtype = H5Topen2(fid, "datatype", H5P_DEFAULT); + CHECK(dtype, FAIL, "H5Topen2"); dset = H5Dopen(fid, "dataset"); CHECK(dset, FAIL, "H5Dopen"); @@ -518,8 +518,8 @@ test_h5o_refcount(void) grp = H5Gopen2(fid, "group", H5P_DEFAULT); CHECK(grp, FAIL, "H5Gopen2"); - dtype = H5Topen(fid, "datatype"); - CHECK(dtype, FAIL, "H5Topen"); + dtype = H5Topen2(fid, "datatype", H5P_DEFAULT); + CHECK(dtype, FAIL, "H5Topen2"); dset = H5Dopen(fid, "dataset"); CHECK(dset, FAIL, "H5Dopen"); @@ -708,8 +708,8 @@ test_h5o_plist(void) /* Re-open objects */ grp = H5Gopen2(fid, "group", H5P_DEFAULT); CHECK(grp, FAIL, "H5Gopen2"); - dtype = H5Topen(fid, "datatype"); - CHECK(dtype, FAIL, "H5Topen"); + dtype = H5Topen2(fid, "datatype", H5P_DEFAULT); + CHECK(dtype, FAIL, "H5Topen2"); dset = H5Dopen(fid, "dataset"); CHECK(dset, FAIL, "H5Dopen"); diff --git a/test/tmisc.c b/test/tmisc.c index 7882120..4656afa 100644 --- a/test/tmisc.c +++ b/test/tmisc.c @@ -2314,8 +2314,8 @@ verify_file(const char *name, hsize_t blk_size, unsigned check_new_data) verify_dataset(fid,MISC13_DSET3_NAME); /* Open the named datatype in the root group */ - tid = H5Topen(fid, MISC13_DTYPE_NAME); - CHECK(tid, FAIL, "H5Topen"); + tid = H5Topen2(fid, MISC13_DTYPE_NAME, H5P_DEFAULT); + CHECK(tid, FAIL, "H5Topen2"); /* Verify the type is correct */ VERIFY(H5Tequal(tid,H5T_NATIVE_INT), TRUE, "H5Tequal"); @@ -2335,8 +2335,8 @@ verify_file(const char *name, hsize_t blk_size, unsigned check_new_data) verify_dataset(gid,MISC13_DSET2_NAME); /* Open the named datatype in the first group */ - tid = H5Topen(gid,MISC13_DTYPE_NAME); - CHECK(tid, FAIL, "H5Topen"); + tid = H5Topen2(gid,MISC13_DTYPE_NAME, H5P_DEFAULT); + CHECK(tid, FAIL, "H5Topen2"); /* Verify the type is correct */ VERIFY(H5Tequal(tid,H5T_NATIVE_INT), TRUE, "H5Tequal"); @@ -3717,7 +3717,7 @@ test_misc22(void) CHECK(ret, FAIL, "H5Pclose"); dsid = H5Dopen(fid, MISC22_DSET_NAME); - CHECK(dsid, FAIL, "H5Topen"); + CHECK(dsid, FAIL, "H5Dopen"); dcpl2 = H5Dget_create_plist(dsid); CHECK(dcpl2, FAIL, "H5Dget_create_plist"); @@ -4089,14 +4089,14 @@ test_misc24(void) VERIFY(tmp_id, FAIL, "H5Dopen"); H5E_BEGIN_TRY { - tmp_id = H5Topen(file_id, MISC24_GROUP_NAME); + tmp_id = H5Topen2(file_id, MISC24_GROUP_NAME, H5P_DEFAULT); } H5E_END_TRY; - VERIFY(tmp_id, FAIL, "H5Topen"); + VERIFY(tmp_id, FAIL, "H5Topen2"); H5E_BEGIN_TRY { - tmp_id = H5Topen(file_id, MISC24_GROUP_LINK); + tmp_id = H5Topen2(file_id, MISC24_GROUP_LINK, H5P_DEFAULT); } H5E_END_TRY; - VERIFY(tmp_id, FAIL, "H5Topen"); + VERIFY(tmp_id, FAIL, "H5Topen2"); H5E_BEGIN_TRY { tmp_id = H5Gopen2(file_id, MISC24_DATASET_NAME, H5P_DEFAULT); @@ -4109,14 +4109,14 @@ test_misc24(void) VERIFY(tmp_id, FAIL, "H5Gopen2"); H5E_BEGIN_TRY { - tmp_id = H5Topen(file_id, MISC24_DATASET_NAME); + tmp_id = H5Topen2(file_id, MISC24_DATASET_NAME, H5P_DEFAULT); } H5E_END_TRY; - VERIFY(tmp_id, FAIL, "H5Topen"); + VERIFY(tmp_id, FAIL, "H5Topen2"); H5E_BEGIN_TRY { - tmp_id = H5Topen(file_id, MISC24_DATASET_LINK); + tmp_id = H5Topen2(file_id, MISC24_DATASET_LINK, H5P_DEFAULT); } H5E_END_TRY; - VERIFY(tmp_id, FAIL, "H5Topen"); + VERIFY(tmp_id, FAIL, "H5Topen2"); H5E_BEGIN_TRY { tmp_id = H5Gopen2(file_id, MISC24_DATATYPE_NAME, H5P_DEFAULT); @@ -4154,14 +4154,14 @@ test_misc24(void) VERIFY(tmp_id, FAIL, "H5Dopen"); H5E_BEGIN_TRY { - tmp_id = H5Topen(file_id, MISC24_GROUP_NAME); + tmp_id = H5Topen2(file_id, MISC24_GROUP_NAME, H5P_DEFAULT); } H5E_END_TRY; - VERIFY(tmp_id, FAIL, "H5Topen"); + VERIFY(tmp_id, FAIL, "H5Topen2"); H5E_BEGIN_TRY { - tmp_id = H5Topen(file_id, MISC24_GROUP_LINK); + tmp_id = H5Topen2(file_id, MISC24_GROUP_LINK, H5P_DEFAULT); } H5E_END_TRY; - VERIFY(tmp_id, FAIL, "H5Topen"); + VERIFY(tmp_id, FAIL, "H5Topen2"); ret = H5Gclose(group_id); CHECK(ret, FAIL, "H5Gclose"); @@ -4181,21 +4181,21 @@ test_misc24(void) VERIFY(tmp_id, FAIL, "H5Gopen2"); H5E_BEGIN_TRY { - tmp_id = H5Topen(file_id, MISC24_DATASET_NAME); + tmp_id = H5Topen2(file_id, MISC24_DATASET_NAME, H5P_DEFAULT); } H5E_END_TRY; - VERIFY(tmp_id, FAIL, "H5Topen"); + VERIFY(tmp_id, FAIL, "H5Topen2"); H5E_BEGIN_TRY { - tmp_id = H5Topen(file_id, MISC24_DATASET_LINK); + tmp_id = H5Topen2(file_id, MISC24_DATASET_LINK, H5P_DEFAULT); } H5E_END_TRY; - VERIFY(tmp_id, FAIL, "H5Topen"); + VERIFY(tmp_id, FAIL, "H5Topen2"); ret = H5Dclose(dset_id); CHECK(ret, FAIL, "H5Dclose"); /* Open named datatype */ - type_id = H5Topen(file_id, MISC24_DATATYPE_NAME); - CHECK(ret, FAIL, "H5Topen"); + type_id = H5Topen2(file_id, MISC24_DATATYPE_NAME, H5P_DEFAULT); + CHECK(ret, FAIL, "H5Topen2"); H5E_BEGIN_TRY { tmp_id = H5Gopen2(file_id, MISC24_DATATYPE_NAME, H5P_DEFAULT); diff --git a/test/ttime.c b/test/ttime.c index 927d68a..37e0b5e 100644 --- a/test/ttime.c +++ b/test/ttime.c @@ -81,8 +81,8 @@ test_time_commit(void) file_id = H5Fopen(DATAFILE, H5F_ACC_RDWR, H5P_DEFAULT); CHECK(file_id, FAIL, "H5Fopen"); - tid = H5Topen(file_id, "Committed D32LE type"); - CHECK(tid, FAIL, "H5Topen"); + tid = H5Topen2(file_id, "Committed D32LE type", H5P_DEFAULT); + CHECK(tid, FAIL, "H5Topen2"); if(!H5Tequal(tid, H5T_UNIX_D32LE)) TestErrPrintf("H5T_UNIX_D32LE datatype not found\n"); @@ -90,8 +90,8 @@ test_time_commit(void) status = H5Tclose (tid); CHECK(status, FAIL, "H5Tclose"); - tid = H5Topen(file_id, "Committed D32BE type"); - CHECK(tid, FAIL, "H5Topen"); + tid = H5Topen2(file_id, "Committed D32BE type", H5P_DEFAULT); + CHECK(tid, FAIL, "H5Topen2"); if(!H5Tequal(tid, H5T_UNIX_D32BE)) TestErrPrintf("H5T_UNIX_D32BE datatype not found\n"); @@ -99,8 +99,8 @@ test_time_commit(void) status = H5Tclose (tid); CHECK(status, FAIL, "H5Tclose"); - tid = H5Topen(file_id, "Committed D64LE type"); - CHECK(tid, FAIL, "H5Topen"); + tid = H5Topen2(file_id, "Committed D64LE type", H5P_DEFAULT); + CHECK(tid, FAIL, "H5Topen2"); if(!H5Tequal(tid, H5T_UNIX_D64LE)) TestErrPrintf("H5T_UNIX_D64LE datatype not found"); @@ -108,8 +108,8 @@ test_time_commit(void) status = H5Tclose (tid); CHECK(status, FAIL, "H5Tclose"); - tid = H5Topen(file_id, "Committed D64BE type"); - CHECK(tid, FAIL, "H5Topen"); + tid = H5Topen2(file_id, "Committed D64BE type", H5P_DEFAULT); + CHECK(tid, FAIL, "H5Topen2"); if(!H5Tequal(tid, H5T_UNIX_D64BE)) TestErrPrintf("H5T_UNIX_D64BE datatype not found"); diff --git a/test/tunicode.c b/test/tunicode.c index de22dfc..20ca9bc 100644 --- a/test/tunicode.c +++ b/test/tunicode.c @@ -440,8 +440,8 @@ void test_objnames(hid_t fid, const char* string) ret = H5Tclose(type_id); CHECK(type_id, FAIL, "H5Tclose"); - type_id = H5Topen(grp2_id, string); - CHECK(type_id, FAIL, "H5Topen"); + type_id = H5Topen2(grp2_id, string, H5P_DEFAULT); + CHECK(type_id, FAIL, "H5Topen2"); ret = H5Tclose(type_id); CHECK(type_id, FAIL, "H5Tclose"); @@ -495,8 +495,8 @@ void test_objnames(hid_t fid, const char* string) CHECK(ret, FAIL, "H5Lcreate_hard"); /* Open named datatype using soft link */ - type_id = H5Topen(grp3_id, string); - CHECK(type_id, FAIL, "H5Topen"); + type_id = H5Topen2(grp3_id, string, H5P_DEFAULT); + CHECK(type_id, FAIL, "H5Topen2"); ret = H5Tclose(type_id); CHECK(type_id, FAIL, "H5Tclose"); diff --git a/test/tvlstr.c b/test/tvlstr.c index 8d8c4a4..a0eedc6 100644 --- a/test/tvlstr.c +++ b/test/tvlstr.c @@ -442,8 +442,8 @@ static void test_vlstring_type(void) ret = H5Tclose(tid_vlstr); CHECK(ret, FAIL, "H5Tclose"); - tid_vlstr = H5Topen(fid, VLSTR_TYPE); - CHECK(tid_vlstr, FAIL, "H5Topen"); + tid_vlstr = H5Topen2(fid, VLSTR_TYPE, H5P_DEFAULT); + CHECK(tid_vlstr, FAIL, "H5Topen2"); ret = H5Tclose(tid_vlstr); CHECK(ret, FAIL, "H5Tclose"); @@ -456,8 +456,8 @@ static void test_vlstring_type(void) CHECK(fid, FAIL, "H5Fopen"); /* Open the variable-length string datatype just created */ - tid_vlstr = H5Topen(fid, VLSTR_TYPE); - CHECK(tid_vlstr, FAIL, "H5Topen"); + tid_vlstr = H5Topen2(fid, VLSTR_TYPE, H5P_DEFAULT); + CHECK(tid_vlstr, FAIL, "H5Topen2"); /* Verify character set and padding */ cset = H5Tget_cset(tid_vlstr); diff --git a/test/unlink.c b/test/unlink.c index f99a1cc..1d89c29 100644 --- a/test/unlink.c +++ b/test/unlink.c @@ -1943,7 +1943,7 @@ test_resurrect_datatype(hid_t fapl) if((file = H5Fopen(filename, H5F_ACC_RDONLY, fapl)) < 0) FAIL_STACK_ERROR /* Attempt to open the datatype under the new name */ - if((type = H5Topen(file,TYPE2NAME)) < 0) FAIL_STACK_ERROR + if((type = H5Topen2(file,TYPE2NAME, H5P_DEFAULT)) < 0) FAIL_STACK_ERROR /* Close things */ if(H5Tclose(type) < 0) FAIL_STACK_ERROR |