mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-02-11 16:01:00 +08:00
Test fixes for log-based vol (#4618)
* fixes to address failures in the log-based VOL * moved file cleanup to tests proper * skipped index API test if not supported
This commit is contained in:
parent
341ca55502
commit
d6541ba8e3
@ -8814,15 +8814,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)
|
||||
@ -8837,6 +8833,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)
|
||||
@ -8848,7 +8846,6 @@ test_attribute_string_encodings(void)
|
||||
error:
|
||||
H5E_BEGIN_TRY
|
||||
{
|
||||
H5Fclose(file_id);
|
||||
H5Gclose(container_group);
|
||||
H5Dclose(dset_id1);
|
||||
H5Dclose(dset_id2);
|
||||
@ -8856,6 +8853,7 @@ error:
|
||||
H5Tclose(type_id2);
|
||||
H5Aclose(attr_id1);
|
||||
H5Aclose(attr_id2);
|
||||
H5Fclose(file_id);
|
||||
if (write_buf)
|
||||
free(write_buf);
|
||||
if (read_buf)
|
||||
|
@ -1473,15 +1473,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 */
|
||||
@ -1526,15 +1528,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 */
|
||||
|
@ -3920,6 +3920,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");
|
||||
@ -4153,6 +4159,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");
|
||||
@ -4386,6 +4398,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();
|
||||
@ -4613,6 +4631,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();
|
||||
@ -4840,6 +4864,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");
|
||||
@ -5076,6 +5106,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");
|
||||
@ -5312,6 +5348,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();
|
||||
@ -5542,6 +5584,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();
|
||||
@ -5772,6 +5820,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");
|
||||
@ -6054,6 +6108,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");
|
||||
@ -6336,6 +6396,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);
|
||||
}
|
||||
|
||||
/* Create file for external link to reference */
|
||||
snprintf(ext_link_filename, H5_API_TEST_FILENAME_MAX_LENGTH, "%s%s", test_path_prefix,
|
||||
EXTERNAL_LINK_TEST_FILE_NAME);
|
||||
@ -6612,6 +6678,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);
|
||||
}
|
||||
|
||||
/* Create file for external link to reference */
|
||||
snprintf(ext_link_filename, H5_API_TEST_FILENAME_MAX_LENGTH, "%s%s", test_path_prefix,
|
||||
EXTERNAL_LINK_TEST_FILE_NAME);
|
||||
|
@ -4196,6 +4196,7 @@ test_object_copy_between_files(void)
|
||||
hid_t attr_space_id = H5I_INVALID_HID;
|
||||
hid_t space_id = H5I_INVALID_HID;
|
||||
hid_t ocpypl_id = H5I_INVALID_HID;
|
||||
char filename[H5_API_TEST_FILENAME_MAX_LENGTH];
|
||||
|
||||
TESTING_MULTIPART("object copying between files");
|
||||
|
||||
@ -4749,6 +4750,10 @@ test_object_copy_between_files(void)
|
||||
TEST_ERROR;
|
||||
if (H5Fclose(file_id) < 0)
|
||||
TEST_ERROR;
|
||||
snprintf(filename, H5_API_TEST_FILENAME_MAX_LENGTH, "%s%s", test_path_prefix,
|
||||
OBJECT_COPY_BETWEEN_FILES_TEST_FILE_NAME);
|
||||
if (H5Fdelete(filename, H5P_DEFAULT) < 0)
|
||||
TEST_ERROR;
|
||||
|
||||
PASSED();
|
||||
|
||||
@ -5067,6 +5072,7 @@ test_object_visit(void)
|
||||
hssize_t num_elems = 0;
|
||||
size_t elem_size = 0;
|
||||
char visit_filename[H5_API_TEST_FILENAME_MAX_LENGTH];
|
||||
char filename[H5_API_TEST_FILENAME_MAX_LENGTH];
|
||||
|
||||
TESTING_MULTIPART("object visiting");
|
||||
|
||||
@ -5708,6 +5714,12 @@ test_object_visit(void)
|
||||
TEST_ERROR;
|
||||
if (H5Fclose(file_id2) < 0)
|
||||
TEST_ERROR;
|
||||
snprintf(filename, H5_API_TEST_FILENAME_MAX_LENGTH, "%s%s", test_path_prefix,
|
||||
OBJECT_VISIT_TEST_FILE_NAME);
|
||||
if (H5Fdelete(filename, H5P_DEFAULT) < 0)
|
||||
TEST_ERROR;
|
||||
if (H5Fdelete(visit_filename, H5P_DEFAULT) < 0)
|
||||
TEST_ERROR;
|
||||
|
||||
PASSED();
|
||||
|
||||
@ -7363,23 +7375,6 @@ object_visit_noop_callback(hid_t o_id, const char *name, const H5O_info2_t *obje
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Cleanup temporary test files
|
||||
*/
|
||||
static void
|
||||
cleanup_files(void)
|
||||
{
|
||||
char filename[H5_API_TEST_FILENAME_MAX_LENGTH];
|
||||
|
||||
snprintf(filename, H5_API_TEST_FILENAME_MAX_LENGTH, "%s%s", test_path_prefix,
|
||||
OBJECT_COPY_BETWEEN_FILES_TEST_FILE_NAME);
|
||||
H5Fdelete(filename, H5P_DEFAULT);
|
||||
|
||||
snprintf(filename, H5_API_TEST_FILENAME_MAX_LENGTH, "%s%s", test_path_prefix,
|
||||
OBJECT_VISIT_TEST_FILE_NAME);
|
||||
H5Fdelete(filename, H5P_DEFAULT);
|
||||
}
|
||||
|
||||
int
|
||||
H5_api_object_test(void)
|
||||
{
|
||||
@ -7398,8 +7393,5 @@ H5_api_object_test(void)
|
||||
|
||||
printf("\n");
|
||||
|
||||
printf("Cleaning up testing files\n");
|
||||
cleanup_files();
|
||||
|
||||
return nerrors;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user