Skip to content

Commit

Permalink
Test opening dataset with fill value in DCPL
Browse files Browse the repository at this point in the history
  • Loading branch information
mattjala committed Oct 9, 2023
1 parent 996dd87 commit 4e73ada
Showing 1 changed file with 45 additions and 6 deletions.
51 changes: 45 additions & 6 deletions vol_dataset_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -1262,10 +1262,10 @@ test_create_dataset_predefined_types(void)
hid_t fspace_id = H5I_INVALID_HID;
hid_t dset_id = H5I_INVALID_HID;
hid_t predefined_type_test_table[] = {H5T_STD_U8LE, H5T_STD_U8BE, H5T_STD_I8LE, H5T_STD_I8BE,
H5T_STD_U16LE, H5T_STD_U16BE, H5T_STD_I16LE, H5T_STD_I16BE,
H5T_STD_U32LE, H5T_STD_U32BE, H5T_STD_I32LE, H5T_STD_I32BE,
H5T_STD_U64LE, H5T_STD_U64BE, H5T_STD_I64LE, H5T_STD_I64BE,
H5T_IEEE_F32LE, H5T_IEEE_F32BE, H5T_IEEE_F64LE, H5T_IEEE_F64BE};
H5T_STD_U16LE, H5T_STD_U16BE, H5T_STD_I16LE, H5T_STD_I16BE,
H5T_STD_U32LE, H5T_STD_U32BE, H5T_STD_I32LE, H5T_STD_I32BE,
H5T_STD_U64LE, H5T_STD_U64BE, H5T_STD_I64LE, H5T_STD_I64BE,
H5T_IEEE_F32LE, H5T_IEEE_F32BE, H5T_IEEE_F64LE, H5T_IEEE_F64BE};

TESTING("dataset creation with predefined datatypes");

Expand Down Expand Up @@ -2472,6 +2472,19 @@ test_create_dataset_creation_properties(void)
PART_ERROR(DCPL_fill_value_test);
}

/* Re-open integer dataset */
if ((dset_id = H5Dopen2(group_id, DATASET_FILL_VALUE_TEST_DSET_NAME1, H5P_DEFAULT)) < 0) {
H5_FAILED();
HDprintf(" couldn't open integer fill value dataset");
PART_ERROR(DCPL_fill_value_test);
}

if (H5Dclose(dset_id) < 0) {
H5_FAILED();
HDprintf(" couldn't close opened integer fill value dataset");
PART_ERROR(DCPL_fill_value_test);
}

HDfree(read_buf);
read_buf = NULL;

Expand Down Expand Up @@ -2533,6 +2546,19 @@ test_create_dataset_creation_properties(void)
PART_ERROR(DCPL_fill_value_test);
}

/* Re-open double dataset */
if ((dset_id = H5Dopen2(group_id, DATASET_FILL_VALUE_TEST_DSET_NAME2, H5P_DEFAULT)) < 0) {
H5_FAILED();
HDprintf(" couldn't open double fill value dataset");
PART_ERROR(DCPL_fill_value_test);
}

if (H5Dclose(dset_id) < 0) {
H5_FAILED();
HDprintf(" couldn't close opened double fill value dataset");
PART_ERROR(DCPL_fill_value_test);
}

HDfree(read_buf);
read_buf = NULL;

Expand Down Expand Up @@ -2590,14 +2616,14 @@ test_create_dataset_creation_properties(void)

if (strcmp(val_str, DATASET_FILL_VALUE_TEST_STRING_FILL_VALUE)) {
H5_FAILED();
HDprintf(" incorrect value read fromstring dataset");
HDprintf(" incorrect value read from string dataset");
PART_ERROR(DCPL_fill_value_test);
}
}

if (H5Dclose(dset_id) < 0) {
H5_FAILED();
HDprintf(" couldn't close double fill value dataset");
HDprintf(" couldn't close string fill value dataset");
PART_ERROR(DCPL_fill_value_test);
}

Expand All @@ -2616,6 +2642,19 @@ test_create_dataset_creation_properties(void)
HDfree(read_buf);
read_buf = NULL;

/* Re-open string dataset */
if ((dset_id = H5Dopen2(group_id, DATASET_FILL_VALUE_TEST_DSET_NAME3, H5P_DEFAULT)) < 0) {
H5_FAILED();
HDprintf(" couldn't open string fill value dataset");
PART_ERROR(DCPL_fill_value_test);
}

if (H5Dclose(dset_id) < 0) {
H5_FAILED();
HDprintf(" couldn't close opened string fill value dataset");
PART_ERROR(DCPL_fill_value_test);
}

PASSED();
}
PART_END(DCPL_fill_value_test);
Expand Down

0 comments on commit 4e73ada

Please sign in to comment.