diff options
Diffstat (limited to 'test/swmr.c')
-rw-r--r-- | test/swmr.c | 185 |
1 files changed, 92 insertions, 93 deletions
diff --git a/test/swmr.c b/test/swmr.c index 0b352e2..bab91bd 100644 --- a/test/swmr.c +++ b/test/swmr.c @@ -26,6 +26,7 @@ #include "h5test.h" #include "H5Iprivate.h" +#include "H5VLprivate.h" /* Virtual Object Layer */ /* * This file needs to access private information from the H5F package. @@ -1168,7 +1169,7 @@ test_metadata_read_retry_info(hid_t in_fapl) TEST_ERROR /* Get a pointer to the internal file object */ - if((f = (H5F_t *)H5I_object(fid)) == NULL) + if((f = (H5F_t *)H5VL_object(fid)) == NULL) FAIL_STACK_ERROR /* @@ -1326,7 +1327,7 @@ test_metadata_read_retry_info(hid_t in_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if((f = (H5F_t *)H5I_object(fid)) == NULL) + if((f = (H5F_t *)H5VL_object(fid)) == NULL) FAIL_STACK_ERROR /* File's superblock: log retry 1 for 1 time */ @@ -1430,7 +1431,7 @@ test_metadata_read_retry_info(hid_t in_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object for fid */ - if((f = (H5F_t *)H5I_object(fid)) == NULL) + if((f = (H5F_t *)H5VL_object(fid)) == NULL) FAIL_STACK_ERROR /* Re-open fid */ @@ -1438,7 +1439,7 @@ test_metadata_read_retry_info(hid_t in_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object for fid1 */ - if((f1 = (H5F_t *)H5I_object(fid1)) == NULL) + if((f1 = (H5F_t *)H5VL_object(fid1)) == NULL) FAIL_STACK_ERROR /* For fid: fixed array data block page--log retry 9 for 500 times */ @@ -3015,7 +3016,7 @@ test_start_swmr_write_stress_ohdr(hid_t in_fapl) /* Retrieve the chunk # for the dataspace message */ chunk_num = UINT_MAX; - if(H5O_msg_get_chunkno_test(did, H5O_SDSPACE_ID, &chunk_num) < 0) + if(H5O__msg_get_chunkno_test(did, H5O_SDSPACE_ID, &chunk_num) < 0) FAIL_STACK_ERROR; /* Should be in chunk #0 for now */ if(0 != chunk_num) @@ -3072,7 +3073,7 @@ test_start_swmr_write_stress_ohdr(hid_t in_fapl) /* Retrieve the chunk # for the dataspace message */ chunk_num = UINT_MAX; - if(H5O_msg_get_chunkno_test(did, H5O_SDSPACE_ID, &chunk_num) < 0) + if(H5O__msg_get_chunkno_test(did, H5O_SDSPACE_ID, &chunk_num) < 0) FAIL_STACK_ERROR; /* Should be in chunk #0 for now */ if(1 != chunk_num) @@ -6288,7 +6289,7 @@ test_bug_refresh(hid_t in_fapl) FAIL_STACK_ERROR /* Get a pointer to the internal file object */ - if(NULL == (f = (H5F_t *)H5I_object(fid))) + if(NULL == (f = (H5F_t *)H5VL_object(fid))) FAIL_STACK_ERROR /* Create groups: compact to dense storage */ @@ -6484,106 +6485,104 @@ test_refresh_concur(hid_t in_fapl, hbool_t new_format) if(childpid == 0) { /* Child process */ hid_t child_fid1 = -1; /* File ID */ hid_t child_fid2 = -1; /* File ID */ - hid_t child_did1 = -1, child_did2 = -1; - hid_t child_sid = -1; - hsize_t tdims[1]; - int rbuf[2] = {0, 0}; - int child_notify = 0; + hid_t child_did1 = -1, child_did2 = -1; + hid_t child_sid = -1; + hsize_t tdims[1]; + int rbuf[2] = {0, 0}; + int child_notify = 0; - /* Close unused write end for out_pdf */ - if(HDclose(out_pdf[1]) < 0) - HDexit(EXIT_FAILURE); + /* Close unused write end for out_pdf */ + if(HDclose(out_pdf[1]) < 0) + HDexit(EXIT_FAILURE); - /* close unused read end for in_pdf */ - if(HDclose(in_pdf[0]) < 0) - HDexit(EXIT_FAILURE); + /* close unused read end for in_pdf */ + if(HDclose(in_pdf[0]) < 0) + HDexit(EXIT_FAILURE); - /* Wait for notification from parent process */ - while(child_notify != 1) { - if(HDread(out_pdf[0], &child_notify, sizeof(int)) < 0) - HDexit(EXIT_FAILURE); - } + /* Wait for notification from parent process */ + while(child_notify != 1) + if(HDread(out_pdf[0], &child_notify, sizeof(int)) < 0) + HDexit(EXIT_FAILURE); - /* Open the file 2 times */ - if((child_fid1 = H5Fopen(filename, H5F_ACC_RDONLY|H5F_ACC_SWMR_READ, fapl)) < 0) - HDexit(EXIT_FAILURE); + /* Open the file 2 times */ + if((child_fid1 = H5Fopen(filename, H5F_ACC_RDONLY|H5F_ACC_SWMR_READ, fapl)) < 0) + HDexit(EXIT_FAILURE); - if((child_fid2 = H5Fopen(filename, H5F_ACC_RDONLY|H5F_ACC_SWMR_READ, fapl)) < 0) - HDexit(EXIT_FAILURE); + if((child_fid2 = H5Fopen(filename, H5F_ACC_RDONLY|H5F_ACC_SWMR_READ, fapl)) < 0) + HDexit(EXIT_FAILURE); - /* Open the dataset 2 times */ - if((child_did1 = H5Dopen2(child_fid1, "dataset", H5P_DEFAULT)) < 0) - HDexit(EXIT_FAILURE); - if((child_did2 = H5Dopen2(child_fid2, "dataset", H5P_DEFAULT)) < 0) - HDexit(EXIT_FAILURE); + /* Open the dataset 2 times */ + if((child_did1 = H5Dopen2(child_fid1, "dataset", H5P_DEFAULT)) < 0) + HDexit(EXIT_FAILURE); + if((child_did2 = H5Dopen2(child_fid2, "dataset", H5P_DEFAULT)) < 0) + HDexit(EXIT_FAILURE); - /* Get the dataset's dataspace via did1 */ - if((child_sid = H5Dget_space(child_did1)) < 0) - HDexit(EXIT_FAILURE); - if(H5Sget_simple_extent_dims(child_sid, tdims, NULL) < 0) - HDexit(EXIT_FAILURE); - if(tdims[0] != 1) - HDexit(EXIT_FAILURE); + /* Get the dataset's dataspace via did1 */ + if((child_sid = H5Dget_space(child_did1)) < 0) + HDexit(EXIT_FAILURE); + if(H5Sget_simple_extent_dims(child_sid, tdims, NULL) < 0) + HDexit(EXIT_FAILURE); + if(tdims[0] != 1) + HDexit(EXIT_FAILURE); - /* Read from the dataset via did2 */ - if(H5Dread(child_did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0) - HDexit(EXIT_FAILURE); + /* Read from the dataset via did2 */ + if(H5Dread(child_did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0) + HDexit(EXIT_FAILURE); - /* Verify the data is correct */ - if(rbuf[0] != 99) - HDexit(EXIT_FAILURE); + /* Verify the data is correct */ + if(rbuf[0] != 99) + HDexit(EXIT_FAILURE); - /* Notify parent process */ - child_notify = 2; - if(HDwrite(in_pdf[1], &child_notify, sizeof(int)) < 0) - HDexit(EXIT_FAILURE); + /* Notify parent process */ + child_notify = 2; + if(HDwrite(in_pdf[1], &child_notify, sizeof(int)) < 0) + HDexit(EXIT_FAILURE); - /* Wait for notification from parent process */ - while(child_notify != 3) { - if(HDread(out_pdf[0], &child_notify, sizeof(int)) < 0) - HDexit(EXIT_FAILURE); - } + /* Wait for notification from parent process */ + while(child_notify != 3) + if(HDread(out_pdf[0], &child_notify, sizeof(int)) < 0) + HDexit(EXIT_FAILURE); - /* Refresh dataset via did1 */ - if(H5Drefresh(child_did1) < 0) - HDexit(EXIT_FAILURE); + /* Refresh dataset via did1 */ + if(H5Drefresh(child_did1) < 0) + HDexit(EXIT_FAILURE); - /* Get the dataset's dataspace and verify */ - if((child_sid = H5Dget_space(child_did1)) < 0) - HDexit(EXIT_FAILURE); - if(H5Sget_simple_extent_dims(child_sid, tdims, NULL) < 0) - HDexit(EXIT_FAILURE); + /* Get the dataset's dataspace and verify */ + if((child_sid = H5Dget_space(child_did1)) < 0) + HDexit(EXIT_FAILURE); + if(H5Sget_simple_extent_dims(child_sid, tdims, NULL) < 0) + HDexit(EXIT_FAILURE); - if(tdims[0] != 2) - HDexit(EXIT_FAILURE); + if(tdims[0] != 2) + HDexit(EXIT_FAILURE); - /* Read from the dataset */ - if(H5Dread(child_did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0) - HDexit(EXIT_FAILURE); + /* Read from the dataset */ + if(H5Dread(child_did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, rbuf) < 0) + HDexit(EXIT_FAILURE); - /* Verify the data is correct */ - if(rbuf[0] != 100 || rbuf[1] != 100) - HDexit(EXIT_FAILURE); + /* Verify the data is correct */ + if(rbuf[0] != 100 || rbuf[1] != 100) + HDexit(EXIT_FAILURE); - /* Close the 2 datasets */ - if(H5Dclose(child_did1) < 0) - HDexit(EXIT_FAILURE); - if(H5Dclose(child_did2) < 0) - HDexit(EXIT_FAILURE); + /* Close the 2 datasets */ + if(H5Dclose(child_did1) < 0) + HDexit(EXIT_FAILURE); + if(H5Dclose(child_did2) < 0) + HDexit(EXIT_FAILURE); - /* Close the 2 files */ - if(H5Fclose(child_fid1) < 0) - HDexit(EXIT_FAILURE); - if(H5Fclose(child_fid2) < 0) - HDexit(EXIT_FAILURE); + /* Close the 2 files */ + if(H5Fclose(child_fid1) < 0) + HDexit(EXIT_FAILURE); + if(H5Fclose(child_fid2) < 0) + HDexit(EXIT_FAILURE); - /* Close the pipes */ - if(HDclose(out_pdf[0]) < 0) - HDexit(EXIT_FAILURE); - if(HDclose(in_pdf[1]) < 0) - HDexit(EXIT_FAILURE); + /* Close the pipes */ + if(HDclose(out_pdf[0]) < 0) + HDexit(EXIT_FAILURE); + if(HDclose(in_pdf[1]) < 0) + HDexit(EXIT_FAILURE); - HDexit(EXIT_SUCCESS); + HDexit(EXIT_SUCCESS); } /* Close unused read end for out_pdf */ @@ -6618,8 +6617,8 @@ test_refresh_concur(hid_t in_fapl, hbool_t new_format) /* Wait for notification from child process */ while(notify != 2) { - if(HDread(in_pdf[0], ¬ify, sizeof(int)) < 0) - FAIL_STACK_ERROR; + if(HDread(in_pdf[0], ¬ify, sizeof(int)) < 0) + FAIL_STACK_ERROR; } /* Cork the metadata cache, to prevent the object header from being @@ -7042,8 +7041,8 @@ main(void) * by the environment variable. */ driver = HDgetenv("HDF5_DRIVER"); - if(!H5FD_supports_swmr_test(driver)) { - printf("This VFD does not support SWMR I/O\n"); + if(!H5FD__supports_swmr_test(driver)) { + HDprintf("This VFD does not support SWMR I/O\n"); return EXIT_SUCCESS; } /* end if */ @@ -7133,7 +7132,7 @@ main(void) if(nerrors) goto error; - printf("All tests passed.\n"); + HDprintf("All tests passed.\n"); h5_cleanup(FILENAME, fapl); @@ -7141,7 +7140,7 @@ main(void) error: nerrors = MAX(1, nerrors); - printf("***** %d SWMR TEST%s FAILED! *****\n", + HDprintf("***** %d SWMR TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S"); return EXIT_FAILURE; |