diff options
author | jhendersonHDF <jhenderson@hdfgroup.org> | 2023-05-26 20:29:02 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-26 20:29:02 (GMT) |
commit | 79bb60c3f6f67411e5d70b84743fc9f6b6143cbc (patch) | |
tree | dce0c97c567cb20eeb65de917e21347376979f18 /test/API/tvlstr.c | |
parent | 77e64e0df46bb7498be014b1005efd49c4ad7518 (diff) | |
download | hdf5-79bb60c3f6f67411e5d70b84743fc9f6b6143cbc.zip hdf5-79bb60c3f6f67411e5d70b84743fc9f6b6143cbc.tar.gz hdf5-79bb60c3f6f67411e5d70b84743fc9f6b6143cbc.tar.bz2 |
API test updates (#3018)
* Remove macros from api tests (#2929)
* Remove macros and undefined callbacks (#2959)
* Remove remaining macros from H5_api_tests_disabled.h (#2968)
* Put some vol capability checks in testpar tests and remove remaining warnings (#2995)
* API tests datatype generation cleanup
* Clean up API tests' random datatype generation and fix bug with enum
datatype generation
* Init parallel API tests with MPI_THREAD_MULTIPLE
* HDF5 API tests - Check VOL connector registration
* Determine whether a VOL connector failed to load before running API
tests
* Cleanup some usages of H5VL_CAP_FLAG_CREATION_ORDER in API tests
* Remove some now-unused macros from H5_api_tests_disabled.h
* Enable HDF5 API tests by default
* Implement CMake option to install HDF5 API tests
* Check for invalid AAPL from H5Acreate
* Enable building of VOL connectors alongside HDF5 in CMake
* Prepend CMake VOL URL option indices with 0s so they come in order
* Don't turn on API tests by default yet
* Document VOL connector FetchContent functionality
* Add release note for API test updates
* Only install testing library if API tests are installed
* Fix grammar
Diffstat (limited to 'test/API/tvlstr.c')
-rw-r--r-- | test/API/tvlstr.c | 113 |
1 files changed, 55 insertions, 58 deletions
diff --git a/test/API/tvlstr.c b/test/API/tvlstr.c index b05ff66..35d5358 100644 --- a/test/API/tvlstr.c +++ b/test/API/tvlstr.c @@ -871,7 +871,6 @@ test_vl_rewrite(void) static void test_write_same_element(void) { -#ifndef NO_WRITE_SAME_ELEMENT_TWICE hid_t file1, dataset1; hid_t mspace, fspace, dtype; hsize_t fdim[] = {SPACE1_DIM1}; @@ -880,86 +879,84 @@ test_write_same_element(void) hsize_t marray[] = {NUMP}; hsize_t coord[SPACE1_RANK][NUMP]; herr_t ret; -#endif - MESSAGE( - 5, - ("Testing writing to same element of VL string dataset twice - SKIPPED for now due to no support\n")); -#ifndef NO_WRITE_SAME_ELEMENT_TWICE - file1 = H5Fcreate(DATAFILE3, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - CHECK(file1, FAIL, "H5Fcreate"); + MESSAGE(5, ("Testing writing to same element of VL string dataset twice\n")); - dtype = H5Tcopy(H5T_C_S1); - CHECK(dtype, FAIL, "H5Tcopy"); + if ((vol_cap_flags_g & H5VL_CAP_FLAG_DATASET_BASIC) && (vol_cap_flags_g & H5VL_CAP_FLAG_FILE_BASIC)) { + file1 = H5Fcreate(DATAFILE3, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + CHECK(file1, FAIL, "H5Fcreate"); - ret = H5Tset_size(dtype, H5T_VARIABLE); - CHECK(ret, FAIL, "H5Tset_size"); + dtype = H5Tcopy(H5T_C_S1); + CHECK(dtype, FAIL, "H5Tcopy"); - fspace = H5Screate_simple(SPACE1_RANK, fdim, NULL); - CHECK(fspace, FAIL, "H5Screate_simple"); + ret = H5Tset_size(dtype, H5T_VARIABLE); + CHECK(ret, FAIL, "H5Tset_size"); - dataset1 = H5Dcreate2(file1, DATASET, dtype, fspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - CHECK(dataset1, FAIL, "H5Dcreate"); + fspace = H5Screate_simple(SPACE1_RANK, fdim, NULL); + CHECK(fspace, FAIL, "H5Screate_simple"); - ret = H5Dwrite(dataset1, dtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); - CHECK(ret, FAIL, "H5Dwrite"); + dataset1 = H5Dcreate2(file1, DATASET, dtype, fspace, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + CHECK(dataset1, FAIL, "H5Dcreate"); - ret = H5Dclose(dataset1); - CHECK(ret, FAIL, "H5Dclose"); + ret = H5Dwrite(dataset1, dtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, wdata); + CHECK(ret, FAIL, "H5Dwrite"); - ret = H5Tclose(dtype); - CHECK(ret, FAIL, "H5Tclose"); + ret = H5Dclose(dataset1); + CHECK(ret, FAIL, "H5Dclose"); - ret = H5Sclose(fspace); - CHECK(ret, FAIL, "H5Sclose"); + ret = H5Tclose(dtype); + CHECK(ret, FAIL, "H5Tclose"); - ret = H5Fclose(file1); - CHECK(ret, FAIL, "H5Fclose"); + ret = H5Sclose(fspace); + CHECK(ret, FAIL, "H5Sclose"); - /* - * Open the file. Select the same points, write values to those point locations. - */ - file1 = H5Fopen(DATAFILE3, H5F_ACC_RDWR, H5P_DEFAULT); - CHECK(file1, FAIL, "H5Fopen"); + ret = H5Fclose(file1); + CHECK(ret, FAIL, "H5Fclose"); - dataset1 = H5Dopen2(file1, DATASET, H5P_DEFAULT); - CHECK(dataset1, FAIL, "H5Dopen"); + /* + * Open the file. Select the same points, write values to those point locations. + */ + file1 = H5Fopen(DATAFILE3, H5F_ACC_RDWR, H5P_DEFAULT); + CHECK(file1, FAIL, "H5Fopen"); - fspace = H5Dget_space(dataset1); - CHECK(fspace, FAIL, "H5Dget_space"); + dataset1 = H5Dopen2(file1, DATASET, H5P_DEFAULT); + CHECK(dataset1, FAIL, "H5Dopen"); - dtype = H5Dget_type(dataset1); - CHECK(dtype, FAIL, "H5Dget_type"); + fspace = H5Dget_space(dataset1); + CHECK(fspace, FAIL, "H5Dget_space"); - mspace = H5Screate_simple(1, marray, NULL); - CHECK(mspace, FAIL, "H5Screate_simple"); + dtype = H5Dget_type(dataset1); + CHECK(dtype, FAIL, "H5Dget_type"); - coord[0][0] = 0; - coord[0][1] = 2; - coord[0][2] = 2; - coord[0][3] = 0; + mspace = H5Screate_simple(1, marray, NULL); + CHECK(mspace, FAIL, "H5Screate_simple"); - ret = H5Sselect_elements(fspace, H5S_SELECT_SET, NUMP, (const hsize_t *)&coord); - CHECK(ret, FAIL, "H5Sselect_elements"); + coord[0][0] = 0; + coord[0][1] = 2; + coord[0][2] = 2; + coord[0][3] = 0; - ret = H5Dwrite(dataset1, dtype, mspace, fspace, H5P_DEFAULT, val); - CHECK(ret, FAIL, "H5Dwrite"); + ret = H5Sselect_elements(fspace, H5S_SELECT_SET, NUMP, (const hsize_t *)&coord); + CHECK(ret, FAIL, "H5Sselect_elements"); - ret = H5Tclose(dtype); - CHECK(ret, FAIL, "H5Tclose"); + ret = H5Dwrite(dataset1, dtype, mspace, fspace, H5P_DEFAULT, val); + CHECK(ret, FAIL, "H5Dwrite"); - ret = H5Dclose(dataset1); - CHECK(ret, FAIL, "H5Dclose"); + ret = H5Tclose(dtype); + CHECK(ret, FAIL, "H5Tclose"); - ret = H5Sclose(fspace); - CHECK(ret, FAIL, "H5Dclose"); + ret = H5Dclose(dataset1); + CHECK(ret, FAIL, "H5Dclose"); - ret = H5Sclose(mspace); - CHECK(ret, FAIL, "H5Sclose"); + ret = H5Sclose(fspace); + CHECK(ret, FAIL, "H5Dclose"); - ret = H5Fclose(file1); - CHECK(ret, FAIL, "H5Fclose"); -#endif + ret = H5Sclose(mspace); + CHECK(ret, FAIL, "H5Sclose"); + + ret = H5Fclose(file1); + CHECK(ret, FAIL, "H5Fclose"); + } } /* test_write_same_element */ /**************************************************************** |