Skip to content

Commit

Permalink
Test fixes for log-based vol (HDFGroup#4618)
Browse files Browse the repository at this point in the history
* fixes to address failures in the log-based VOL

* moved file cleanup to tests proper

* skipped index API test if not supported
  • Loading branch information
brtnfld authored and jhendersonHDF committed Dec 10, 2024
1 parent dadf97b commit edd27af
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 24 deletions.
8 changes: 3 additions & 5 deletions test/API/H5_api_attribute_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -8781,15 +8781,11 @@ test_attribute_string_encodings(void)
PASSED();
}
PART_END(UTF8_cset);

PASSED();
}
END_MULTIPART;

TESTING_2("test cleanup");

if (H5Fclose(file_id) < 0)
TEST_ERROR;
if (H5Gclose(container_group) < 0)
TEST_ERROR;
if (H5Dclose(dset_id1) < 0)
Expand All @@ -8804,6 +8800,8 @@ test_attribute_string_encodings(void)
TEST_ERROR;
if (H5Aclose(attr_id2) < 0)
TEST_ERROR;
if (H5Fclose(file_id) < 0)
TEST_ERROR;
if (write_buf)
free(write_buf);
if (read_buf)
Expand All @@ -8816,14 +8814,14 @@ test_attribute_string_encodings(void)
error:
H5E_BEGIN_TRY
{
H5Fclose(file_id);
H5Gclose(container_group);
H5Dclose(dset_id1);
H5Dclose(dset_id2);
H5Tclose(type_id1);
H5Tclose(type_id2);
H5Aclose(attr_id1);
H5Aclose(attr_id2);
H5Fclose(file_id);
if (write_buf)
free(write_buf);
if (read_buf)
Expand Down
40 changes: 22 additions & 18 deletions test/API/H5_api_group_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -1462,15 +1462,17 @@ test_get_group_info(void)
PART_ERROR(H5Gget_info);
}

/*
* For the purpose of this test, the max creation order should match
* the number of links in the group.
*/
if (group_info.max_corder != GROUP_GET_INFO_TEST_GROUP_NUMB) {
H5_FAILED();
printf(" group's max creation order '%lld' doesn't match expected value '%lld'\n",
(long long)group_info.max_corder, (long long)GROUP_GET_INFO_TEST_GROUP_NUMB);
PART_ERROR(H5Gget_info);
if (vol_cap_flags_g & H5VL_CAP_FLAG_CREATION_ORDER) {
/*
* For the purpose of this test, the max creation order should match
* the number of links in the group.
*/
if (group_info.max_corder != GROUP_GET_INFO_TEST_GROUP_NUMB) {
H5_FAILED();
printf(" group's max creation order '%lld' doesn't match expected value '%lld'\n",
(long long)group_info.max_corder, (long long)GROUP_GET_INFO_TEST_GROUP_NUMB);
PART_ERROR(H5Gget_info);
}
}

/* Ensure that the storage_type field is at least set to a meaningful value */
Expand Down Expand Up @@ -1515,15 +1517,17 @@ test_get_group_info(void)
PART_ERROR(H5Gget_info_by_name);
}

/*
* For the purpose of this test, the max creation order should match
* the number of links in the group.
*/
if (group_info.max_corder != GROUP_GET_INFO_TEST_GROUP_NUMB) {
H5_FAILED();
printf(" group's max creation order '%lld' doesn't match expected value '%lld'\n",
(long long)group_info.max_corder, (long long)GROUP_GET_INFO_TEST_GROUP_NUMB);
PART_ERROR(H5Gget_info_by_name);
if (vol_cap_flags_g & H5VL_CAP_FLAG_CREATION_ORDER) {
/*
* For the purpose of this test, the max creation order should match
* the number of links in the group.
*/
if (group_info.max_corder != GROUP_GET_INFO_TEST_GROUP_NUMB) {
H5_FAILED();
printf(" group's max creation order '%lld' doesn't match expected value '%lld'\n",
(long long)group_info.max_corder, (long long)GROUP_GET_INFO_TEST_GROUP_NUMB);
PART_ERROR(H5Gget_info_by_name);
}
}

/* Ensure that the storage_type field is at least set to a meaningful value */
Expand Down
72 changes: 72 additions & 0 deletions test/API/H5_api_link_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -3935,6 +3935,12 @@ test_delete_link(void)
{
TESTING_2("H5Ldelete_by_idx on hard link by creation order in increasing order");

if (!(vol_cap_flags_g & H5VL_CAP_FLAG_BY_IDX)) {
SKIPPED();
printf(" by index isn't supported with this VOL connector\n");
PART_EMPTY(H5Ldelete_by_idx_hard_crt_order_increasing);
}

if (!(vol_cap_flags_g & H5VL_CAP_FLAG_CREATION_ORDER)) {
SKIPPED();
printf(" creation order tracking isn't supported with this VOL connector\n");
Expand Down Expand Up @@ -4168,6 +4174,12 @@ test_delete_link(void)
{
TESTING_2("H5Ldelete_by_idx on hard link by creation order in decreasing order");

if (!(vol_cap_flags_g & H5VL_CAP_FLAG_BY_IDX)) {
SKIPPED();
printf(" by index isn't supported with this VOL connector\n");
PART_EMPTY(H5Ldelete_by_idx_hard_crt_order_decreasing);
}

if (!(vol_cap_flags_g & H5VL_CAP_FLAG_CREATION_ORDER)) {
SKIPPED();
printf(" creation order tracking isn't supported with this VOL connector\n");
Expand Down Expand Up @@ -4401,6 +4413,12 @@ test_delete_link(void)
{
TESTING_2("H5Ldelete_by_idx on hard link by alphabetical order in increasing order");

if (!(vol_cap_flags_g & H5VL_CAP_FLAG_BY_IDX)) {
SKIPPED();
printf(" by index isn't supported with this VOL connector\n");
PART_EMPTY(H5Ldelete_by_idx_hard_name_order_increasing);
}

if ((subgroup_id = H5Gcreate2(group_id, LINK_DELETE_TEST_SUBGROUP7_NAME, H5P_DEFAULT, gcpl_id,
H5P_DEFAULT)) < 0) {
H5_FAILED();
Expand Down Expand Up @@ -4628,6 +4646,12 @@ test_delete_link(void)
{
TESTING_2("H5Ldelete_by_idx on hard link by alphabetical order in decreasing order");

if (!(vol_cap_flags_g & H5VL_CAP_FLAG_BY_IDX)) {
SKIPPED();
printf(" by index isn't supported with this VOL connector\n");
PART_EMPTY(H5Ldelete_by_idx_hard_name_order_decreasing);
}

if ((subgroup_id = H5Gcreate2(group_id, LINK_DELETE_TEST_SUBGROUP8_NAME, H5P_DEFAULT, gcpl_id,
H5P_DEFAULT)) < 0) {
H5_FAILED();
Expand Down Expand Up @@ -4855,6 +4879,12 @@ test_delete_link(void)
{
TESTING_2("H5Ldelete_by_idx on soft link by creation order in increasing order");

if (!(vol_cap_flags_g & H5VL_CAP_FLAG_BY_IDX)) {
SKIPPED();
printf(" by index isn't supported with this VOL connector\n");
PART_EMPTY(H5Ldelete_by_idx_soft_crt_order_increasing);
}

if (!(vol_cap_flags_g & H5VL_CAP_FLAG_CREATION_ORDER)) {
SKIPPED();
printf(" creation order tracking isn't supported with this VOL connector\n");
Expand Down Expand Up @@ -5091,6 +5121,12 @@ test_delete_link(void)
{
TESTING_2("H5Ldelete_by_idx on soft link by creation order in decreasing order");

if (!(vol_cap_flags_g & H5VL_CAP_FLAG_BY_IDX)) {
SKIPPED();
printf(" by index isn't supported with this VOL connector\n");
PART_EMPTY(H5Ldelete_by_idx_soft_crt_order_decreasing);
}

if (!(vol_cap_flags_g & H5VL_CAP_FLAG_CREATION_ORDER)) {
SKIPPED();
printf(" creation order tracking isn't supported with this VOL connector\n");
Expand Down Expand Up @@ -5327,6 +5363,12 @@ test_delete_link(void)
{
TESTING_2("H5Ldelete_by_idx on soft link by alphabetical order in increasing order");

if (!(vol_cap_flags_g & H5VL_CAP_FLAG_BY_IDX)) {
SKIPPED();
printf(" by index isn't supported with this VOL connector\n");
PART_EMPTY(H5Ldelete_by_idx_soft_name_order_increasing);
}

if ((subgroup_id = H5Gcreate2(group_id, LINK_DELETE_TEST_SUBGROUP11_NAME, H5P_DEFAULT, gcpl_id,
H5P_DEFAULT)) < 0) {
H5_FAILED();
Expand Down Expand Up @@ -5557,6 +5599,12 @@ test_delete_link(void)
{
TESTING_2("H5Ldelete_by_idx on soft link by alphabetical order in decreasing order");

if (!(vol_cap_flags_g & H5VL_CAP_FLAG_BY_IDX)) {
SKIPPED();
printf(" by index isn't supported with this VOL connector\n");
PART_EMPTY(H5Ldelete_by_idx_soft_name_order_decreasing);
}

if ((subgroup_id = H5Gcreate2(group_id, LINK_DELETE_TEST_SUBGROUP12_NAME, H5P_DEFAULT, gcpl_id,
H5P_DEFAULT)) < 0) {
H5_FAILED();
Expand Down Expand Up @@ -5787,6 +5835,12 @@ test_delete_link(void)
{
TESTING_2("H5Ldelete_by_idx on external link by creation order in increasing order");

if (!(vol_cap_flags_g & H5VL_CAP_FLAG_BY_IDX)) {
SKIPPED();
printf(" by index isn't supported with this VOL connector\n");
PART_EMPTY(H5Ldelete_by_idx_external_crt_order_increasing);
}

if (!(vol_cap_flags_g & H5VL_CAP_FLAG_CREATION_ORDER)) {
SKIPPED();
printf(" creation order tracking isn't supported with this VOL connector\n");
Expand Down Expand Up @@ -6051,6 +6105,12 @@ test_delete_link(void)
{
TESTING_2("H5Ldelete_by_idx on external link by creation order in decreasing order");

if (!(vol_cap_flags_g & H5VL_CAP_FLAG_BY_IDX)) {
SKIPPED();
printf(" by index isn't supported with this VOL connector\n");
PART_EMPTY(H5Ldelete_by_idx_external_crt_order_decreasing);
}

if (!(vol_cap_flags_g & H5VL_CAP_FLAG_CREATION_ORDER)) {
SKIPPED();
printf(" creation order tracking isn't supported with this VOL connector\n");
Expand Down Expand Up @@ -6315,6 +6375,12 @@ test_delete_link(void)
{
TESTING_2("H5Ldelete_by_idx on external link by alphabetical order in increasing order");

if (!(vol_cap_flags_g & H5VL_CAP_FLAG_BY_IDX)) {
SKIPPED();
printf(" by index isn't supported with this VOL connector\n");
PART_EMPTY(H5Ldelete_by_idx_external_name_order_increasing);
}

if ((subgroup_id = H5Gcreate2(group_id, LINK_DELETE_TEST_SUBGROUP15_NAME, H5P_DEFAULT, gcpl_id,
H5P_DEFAULT)) < 0) {
H5_FAILED();
Expand Down Expand Up @@ -6573,6 +6639,12 @@ test_delete_link(void)
{
TESTING_2("H5Ldelete_by_idx on external link by alphabetical order in decreasing order");

if (!(vol_cap_flags_g & H5VL_CAP_FLAG_BY_IDX)) {
SKIPPED();
printf(" by index isn't supported with this VOL connector\n");
PART_EMPTY(H5Ldelete_by_idx_external_name_order_decreasing);
}

if ((subgroup_id = H5Gcreate2(group_id, LINK_DELETE_TEST_SUBGROUP16_NAME, H5P_DEFAULT, gcpl_id,
H5P_DEFAULT)) < 0) {
H5_FAILED();
Expand Down
1 change: 0 additions & 1 deletion test/API/H5_api_object_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -4728,7 +4728,6 @@ test_object_copy_between_files(void)
TEST_ERROR;
if (H5Fclose(file_id) < 0)
TEST_ERROR;

if (remove_test_file(NULL, obj_copy_filename) < 0)
TEST_ERROR;
free(obj_copy_filename);
Expand Down

0 comments on commit edd27af

Please sign in to comment.