diff --git a/test/API/H5_api_dataset_test.c b/test/API/H5_api_dataset_test.c index 0f78dff3c9a..1fd144ad1bb 100644 --- a/test/API/H5_api_dataset_test.c +++ b/test/API/H5_api_dataset_test.c @@ -9861,7 +9861,8 @@ test_dataset_vlen_io(void) /* Make sure the connector supports the API functions being tested */ if (!(vol_cap_flags_g & H5VL_CAP_FLAG_FILE_BASIC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_GROUP_BASIC) || - !(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_BASIC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_MORE)) { + !(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_BASIC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_MORE) || + !(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_MORE)) { SKIPPED(); printf(" API functions for basic file, group, or dataset aren't supported with this " "connector\n"); @@ -9955,9 +9956,6 @@ test_dataset_vlen_io(void) dset_string = H5I_INVALID_HID; - memset(wbuf, 0, sizeof(hvl_t) * DATASET_VLEN_IO_DSET_DIMS); - memset(rbuf, 0, sizeof(hvl_t) * DATASET_VLEN_IO_DSET_DIMS); - PASSED(); BEGIN_MULTIPART @@ -9985,6 +9983,9 @@ test_dataset_vlen_io(void) if ((H5Dwrite(dset_int, vlen_int, space_id, H5S_ALL, H5P_DEFAULT, (const void *)wbuf)) < 0) PART_TEST_ERROR(rw_all_int); + if (H5Dflush(dset_int) < 0) + PART_TEST_ERROR(rw_hyperslab_selection); + /* Close and reopen file objects to flush cache */ if (H5Dclose(dset_int) < 0) PART_TEST_ERROR(rw_all_int); @@ -10014,6 +10015,11 @@ test_dataset_vlen_io(void) if ((H5Dread(dset_int, vlen_int, space_id, H5S_ALL, H5P_DEFAULT, (void *)rbuf)) < 0) PART_TEST_ERROR(rw_all_int); + /* Close to finalize read */ + if (H5Dclose(dset_int) < 0) + PART_TEST_ERROR(rw_all_int); + dset_int = H5I_INVALID_HID; + /* Verify data */ for (size_t i = 0; i < DATASET_VLEN_IO_DSET_DIMS; i++) { if (!rbuf[i].p) @@ -10027,12 +10033,6 @@ test_dataset_vlen_io(void) PART_TEST_ERROR(rw_all_int); } - /* Close before use in selection tests */ - if (H5Dclose(dset_int) < 0) - PART_TEST_ERROR(rw_all_int); - - dset_int = H5I_INVALID_HID; - /* Reset buffers */ if (H5Treclaim(vlen_int, space_id, H5P_DEFAULT, rbuf) < 0) PART_TEST_ERROR(rw_all_int); @@ -10069,6 +10069,9 @@ test_dataset_vlen_io(void) if ((H5Dwrite(dset_float, vlen_float, space_id, H5S_ALL, H5P_DEFAULT, (const void *)wbuf)) < 0) PART_TEST_ERROR(rw_all_float); + if (H5Dflush(dset_float) < 0) + PART_TEST_ERROR(rw_hyperslab_selection); + /* Close and reopen file objects to flush cache */ if (H5Dclose(dset_float) < 0) PART_TEST_ERROR(rw_all_float); @@ -10098,6 +10101,11 @@ test_dataset_vlen_io(void) if ((H5Dread(dset_float, vlen_float, space_id, H5S_ALL, H5P_DEFAULT, (void *)rbuf)) < 0) PART_TEST_ERROR(rw_all_float); + /* Close to finalize read */ + if (H5Dclose(dset_float) < 0) + PART_TEST_ERROR(rw_all_float); + dset_float = H5I_INVALID_HID; + /* Verify data */ for (size_t i = 0; i < DATASET_VLEN_IO_DSET_DIMS; i++) { if (!rbuf[i].p) @@ -10116,7 +10124,6 @@ test_dataset_vlen_io(void) } /* Reset buffers */ - if (H5Treclaim(vlen_float, space_id, H5P_DEFAULT, rbuf) < 0) PART_TEST_ERROR(rw_all_float); @@ -10155,6 +10162,9 @@ test_dataset_vlen_io(void) if ((H5Dwrite(dset_string, vlen_string, space_id, H5S_ALL, H5P_DEFAULT, (const void *)wbuf)) < 0) PART_TEST_ERROR(rw_all_string); + if (H5Dflush(dset_string) < 0) + PART_TEST_ERROR(rw_hyperslab_selection); + /* Close and reopen file objects to flush cache */ if (H5Dclose(dset_string) < 0) PART_TEST_ERROR(rw_all_string); @@ -10185,6 +10195,11 @@ test_dataset_vlen_io(void) if ((H5Dread(dset_string, vlen_string, space_id, H5S_ALL, H5P_DEFAULT, (void *)rbuf)) < 0) PART_TEST_ERROR(rw_all_string); + /* Close to finalize read */ + if (H5Dclose(dset_string) < 0) + PART_TEST_ERROR(rw_all_string); + dset_string = H5I_INVALID_HID; + /* Verify data */ for (size_t i = 0; i < DATASET_VLEN_IO_DSET_DIMS; i++) { if (!rbuf[i].p) @@ -10205,7 +10220,6 @@ test_dataset_vlen_io(void) } /* Reset buffers */ - if (H5Treclaim(vlen_string, space_id, H5P_DEFAULT, rbuf) < 0) PART_TEST_ERROR(rw_all_string); @@ -10251,6 +10265,9 @@ test_dataset_vlen_io(void) if ((H5Dwrite(dset_int, vlen_int, space_id, space_id, H5P_DEFAULT, (const void *)wbuf)) < 0) PART_TEST_ERROR(rw_point_selection); + if (H5Dflush(dset_int) < 0) + PART_TEST_ERROR(rw_hyperslab_selection); + /* Close and reopen file objects to flush cache */ if (H5Dclose(dset_int) < 0) PART_TEST_ERROR(rw_point_selection); @@ -10277,6 +10294,11 @@ test_dataset_vlen_io(void) if ((H5Dread(dset_int, vlen_int, space_id, space_id, H5P_DEFAULT, (void *)rbuf)) < 0) PART_TEST_ERROR(rw_point_selection); + /* Close to finalize read */ + if (H5Dclose(dset_int) < 0) + PART_TEST_ERROR(rw_point_selection); + dset_int = H5I_INVALID_HID; + /* Verify data */ for (size_t i = 0; i < DATASET_VLEN_IO_DSET_DIMS; i++) { if (i % 2 == 0) { @@ -10299,10 +10321,6 @@ test_dataset_vlen_io(void) } } - if (H5Dclose(dset_int) < 0) - PART_TEST_ERROR(rw_point_selection); - dset_int = H5I_INVALID_HID; - /* Reset buffers */ if (H5Treclaim(vlen_int, space_id, H5P_DEFAULT, rbuf) < 0) PART_TEST_ERROR(rw_point_selection); @@ -10349,6 +10367,9 @@ test_dataset_vlen_io(void) if ((H5Dwrite(dset_int, vlen_int, space_id, space_id, H5P_DEFAULT, (const void *)wbuf)) < 0) PART_TEST_ERROR(rw_hyperslab_selection); + if (H5Dflush(dset_int) < 0) + PART_TEST_ERROR(rw_hyperslab_selection); + /* Close and reopen file objects to flush cache */ if (H5Dclose(dset_int) < 0) PART_TEST_ERROR(rw_hyperslab_selection); @@ -10375,6 +10396,11 @@ test_dataset_vlen_io(void) if ((H5Dread(dset_int, vlen_int, space_id, space_id, H5P_DEFAULT, (void *)rbuf)) < 0) PART_TEST_ERROR(rw_hyperslab_selection); + /* Close to finalize read */ + if (H5Dclose(dset_int) < 0) + PART_TEST_ERROR(rw_hyperslab_selection); + dset_int = H5I_INVALID_HID; + /* Verify data */ for (size_t i = 0; i < DATASET_VLEN_IO_DSET_DIMS; i++) { if (i % stride[0] == 0) { @@ -10415,16 +10441,6 @@ test_dataset_vlen_io(void) TESTING_2("test cleanup"); - if (H5Fclose(file_id) < 0) - TEST_ERROR; - if (H5Gclose(container_group) < 0) - TEST_ERROR; - if (H5Dclose(dset_int) < 0) - TEST_ERROR; - if (H5Dclose(dset_float) < 0) - TEST_ERROR; - if (H5Dclose(dset_string) < 0) - TEST_ERROR; if (H5Sclose(space_id) < 0) TEST_ERROR; @@ -10450,15 +10466,16 @@ test_dataset_vlen_io(void) TEST_ERROR; if (H5Tclose(vlen_string) < 0) TEST_ERROR; - + if (H5Gclose(container_group) < 0) + TEST_ERROR; + if (H5Fclose(file_id) < 0) + TEST_ERROR; PASSED(); return 0; error: H5E_BEGIN_TRY { - H5Fclose(file_id); - H5Gclose(container_group); if (dset_int != H5I_INVALID_HID) H5Dclose(dset_int); if (dset_float != H5I_INVALID_HID) @@ -10482,6 +10499,8 @@ test_dataset_vlen_io(void) H5Tclose(vlen_int); H5Tclose(vlen_float); H5Tclose(vlen_string); + H5Gclose(container_group); + H5Fclose(file_id); } H5E_END_TRY @@ -10513,7 +10532,8 @@ test_dataset_set_extent_chunked_unlimited(void) /* Make sure the connector supports the API functions being tested */ if (!(vol_cap_flags_g & H5VL_CAP_FLAG_FILE_BASIC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_GROUP_BASIC) || - !(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_BASIC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_MORE)) { + !(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_BASIC) || !(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_MORE) || + !(vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_MORE)) { SKIPPED(); printf(" API functions for basic file, group, basic or more dataset aren't supported with this " "connector\n");