Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable API tests by default and fix some issues #5223

Merged
merged 3 commits into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeTests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
option (HDF5_DISABLE_TESTS_REGEX "Regex pattern to set execution of specific tests to DISABLED" "")
mark_as_advanced (HDF5_DISABLE_TESTS_REGEX)

option (HDF5_TEST_API "Execute HDF5 API tests" OFF)
option (HDF5_TEST_API "Execute HDF5 API tests" ON)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this change is worth a release note or not

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it's changing a default, a simple one line should be enough. Definitely not newsletter worthy.

mark_as_advanced (HDF5_TEST_API)
if (HDF5_TEST_API)
option (HDF5_TEST_API_INSTALL "Install HDF5 API tests" OFF)
Expand Down
16 changes: 8 additions & 8 deletions test/API/H5_api_attribute_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -8641,15 +8641,15 @@ test_attribute_string_encodings(void H5_ATTR_UNUSED *params)
goto error;
}

if ((dset_id1 = H5Dcreate(container_group, ATTRIBUTE_STRING_ENCODINGS_DSET_NAME1, type_id1, space_id,
H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
if ((dset_id1 = H5Dcreate2(container_group, ATTRIBUTE_STRING_ENCODINGS_DSET_NAME1, type_id1, space_id,
H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
H5_FAILED();
printf(" couldn't create dataset with ascii string\n");
goto error;
}

if ((attr_id1 = H5Acreate(dset_id1, ATTRIBUTE_STRING_ENCODINGS_ATTR_NAME1, type_id1, space_id,
H5P_DEFAULT, H5P_DEFAULT)) < 0) {
if ((attr_id1 = H5Acreate2(dset_id1, ATTRIBUTE_STRING_ENCODINGS_ATTR_NAME1, type_id1, space_id,
H5P_DEFAULT, H5P_DEFAULT)) < 0) {
H5_FAILED();
printf(" couldn't create attribute with ascii string\n");
goto error;
Expand All @@ -8673,15 +8673,15 @@ test_attribute_string_encodings(void H5_ATTR_UNUSED *params)
goto error;
}

if ((dset_id2 = H5Dcreate(container_group, ATTRIBUTE_STRING_ENCODINGS_DSET_NAME2, type_id2, space_id,
H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
if ((dset_id2 = H5Dcreate2(container_group, ATTRIBUTE_STRING_ENCODINGS_DSET_NAME2, type_id2, space_id,
H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
H5_FAILED();
printf(" couldn't create dataset with UTF-8 string\n");
goto error;
}

if ((attr_id2 = H5Acreate(dset_id2, ATTRIBUTE_STRING_ENCODINGS_ATTR_NAME2, type_id2, space_id,
H5P_DEFAULT, H5P_DEFAULT)) < 0) {
if ((attr_id2 = H5Acreate2(dset_id2, ATTRIBUTE_STRING_ENCODINGS_ATTR_NAME2, type_id2, space_id,
H5P_DEFAULT, H5P_DEFAULT)) < 0) {
H5_FAILED();
printf(" couldn't create attribute with ascii string\n");
goto error;
Expand Down
14 changes: 7 additions & 7 deletions test/API/H5_api_dataset_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -2385,9 +2385,9 @@ test_create_dataset_creation_properties(void H5_ATTR_UNUSED *params)
PART_ERROR(DCPL_fill_value_test);
}

if ((dset_id =
H5Dcreate(group_id, DATASET_FILL_VALUE_TEST_DSET_NAME1, DATASET_FILL_VALUE_TEST_INT_TYPE,
fspace_id, H5P_DEFAULT, dcpl_id, H5P_DEFAULT)) < 0) {
if ((dset_id = H5Dcreate2(group_id, DATASET_FILL_VALUE_TEST_DSET_NAME1,
DATASET_FILL_VALUE_TEST_INT_TYPE, fspace_id, H5P_DEFAULT, dcpl_id,
H5P_DEFAULT)) < 0) {
H5_FAILED();
printf(" couldn't create dataset with integer fill value");
PART_ERROR(DCPL_fill_value_test);
Expand Down Expand Up @@ -8218,8 +8218,8 @@ test_dataset_string_encodings(void H5_ATTR_UNUSED *params)
goto error;
}

if ((dset_id1 = H5Dcreate(container_group, DATASET_STRING_ENCODINGS_DSET_NAME1, type_id1, space_id,
H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
if ((dset_id1 = H5Dcreate2(container_group, DATASET_STRING_ENCODINGS_DSET_NAME1, type_id1, space_id,
H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
H5_FAILED();
printf(" couldn't create dataset with ascii string\n");
goto error;
Expand All @@ -8243,8 +8243,8 @@ test_dataset_string_encodings(void H5_ATTR_UNUSED *params)
goto error;
}

if ((dset_id2 = H5Dcreate(container_group, DATASET_STRING_ENCODINGS_DSET_NAME2, type_id2, space_id,
H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
if ((dset_id2 = H5Dcreate2(container_group, DATASET_STRING_ENCODINGS_DSET_NAME2, type_id2, space_id,
H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) {
H5_FAILED();
printf(" couldn't create dataset with UTF-8 string\n");
goto error;
Expand Down
8 changes: 6 additions & 2 deletions test/API/H5_api_link_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,12 @@ test_create_hard_link_invalid_params(void H5_ATTR_UNUSED *params)
PART_ERROR(H5Lcreate_hard_across_files);
}

if (H5Fclose(ext_file_id) < 0) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file handle needed to be closed before attempting to remove the file on Windows

H5_FAILED();
printf(" couldn't close external file '%s'\n", ext_link_filename);
PART_ERROR(H5Lcreate_hard_across_files);
}

if (remove_test_file(NULL, ext_link_filename) < 0) {
H5_FAILED();
printf(" failed to delete external file '%s'\n", ext_link_filename);
Expand Down Expand Up @@ -934,8 +940,6 @@ test_create_hard_link_invalid_params(void H5_ATTR_UNUSED *params)

TESTING_2("test cleanup");

if (H5Fclose(ext_file_id) < 0)
TEST_ERROR;
if (H5Gclose(group_id) < 0)
TEST_ERROR;
if (H5Gclose(container_group) < 0)
Expand Down
4 changes: 2 additions & 2 deletions test/API/H5_api_object_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -5638,8 +5638,8 @@ test_object_visit(void H5_ATTR_UNUSED *params)

i = 0;

if (H5Ovisit_by_name(attr_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, object_visit_simple_callback,
&i, H5O_INFO_ALL, H5P_DEFAULT) < 0) {
if (H5Ovisit_by_name3(attr_id, ".", H5_INDEX_CRT_ORDER, H5_ITER_INC, object_visit_simple_callback,
&i, H5O_INFO_ALL, H5P_DEFAULT) < 0) {
H5_FAILED();
printf(" H5Ovisit_by_name on an attribute failed!\n");
PART_ERROR(H5Ovisit_by_name_attr);
Expand Down
Loading