Skip to content

Commit

Permalink
Fix test failures, fix function description
Browse files Browse the repository at this point in the history
  • Loading branch information
fortnern committed Oct 12, 2023
1 parent 1e7588f commit 09aa92d
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 26 deletions.
3 changes: 1 addition & 2 deletions src/H5CX.c
Original file line number Diff line number Diff line change
Expand Up @@ -2524,8 +2524,7 @@ H5CX_get_no_selection_io_cause(uint32_t *no_selection_io_cause)
/*-------------------------------------------------------------------------
* Function: H5CX_get_actual_selection_io_mode
*
* Purpose: Retrieves the cause for not performing selection I/O
* for the current API call context.
* Purpose: Retrieves the actual I/O mode (scalar, vector, and/or selection) for the current API call context.
*
* Return: Non-negative on success / Negative on failure
*
Expand Down
48 changes: 24 additions & 24 deletions test/select_io_dset.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ check_actual_selection_io_mode(hid_t dxpl, uint32_t sel_io_mode_expected)
* --write/read dataset with H5T_NATIVE_INT
*/
static herr_t
test_no_type_conv(hid_t fid, unsigned chunked, unsigned dtrans, unsigned mwbuf)
test_no_type_conv(hid_t fid, unsigned set_cache, unsigned chunked, unsigned dtrans, unsigned mwbuf)
{
int i;
hid_t did = H5I_INVALID_HID;
Expand Down Expand Up @@ -198,7 +198,7 @@ test_no_type_conv(hid_t fid, unsigned chunked, unsigned dtrans, unsigned mwbuf)
TEST_ERROR;

/* Verify selection I/O mode */
if (check_actual_selection_io_mode(dxpl, chunked ? 0 : H5D_SCALAR_IO) < 0)
if (check_actual_selection_io_mode(dxpl, chunked && !set_cache ? 0 : H5D_SCALAR_IO) < 0)
TEST_ERROR;

/* Restore wbuf from backup if the library modified it */
Expand All @@ -210,7 +210,7 @@ test_no_type_conv(hid_t fid, unsigned chunked, unsigned dtrans, unsigned mwbuf)
TEST_ERROR;

/* Verify selection I/O mode */
if (check_actual_selection_io_mode(dxpl, chunked ? 0 : H5D_SCALAR_IO) < 0)
if (check_actual_selection_io_mode(dxpl, chunked && !set_cache ? 0 : H5D_SCALAR_IO) < 0)
TEST_ERROR;

/* Verify data or transformed data read */
Expand Down Expand Up @@ -275,7 +275,7 @@ test_no_type_conv(hid_t fid, unsigned chunked, unsigned dtrans, unsigned mwbuf)
* --read again with H5T_STD_I32BE
*/
static herr_t
test_no_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf)
test_no_size_change_no_bkg(hid_t fid, unsigned set_cache, unsigned chunked, unsigned mwbuf)
{
int i;
hid_t did = H5I_INVALID_HID;
Expand Down Expand Up @@ -351,7 +351,7 @@ test_no_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf)
TEST_ERROR;

/* Verify selection I/O mode */
if (check_actual_selection_io_mode(dxpl, chunked ? 0 : H5D_SCALAR_IO) < 0)
if (check_actual_selection_io_mode(dxpl, chunked && !set_cache ? 0 : H5D_SCALAR_IO) < 0)
TEST_ERROR;

/* Restore wbuf from backup if the library modified it */
Expand All @@ -363,7 +363,7 @@ test_no_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf)
TEST_ERROR;

/* Verify selection I/O mode */
if (check_actual_selection_io_mode(dxpl, chunked ? 0 : H5D_SCALAR_IO) < 0)
if (check_actual_selection_io_mode(dxpl, chunked && !set_cache ? 0 : H5D_SCALAR_IO) < 0)
TEST_ERROR;

/* Verify data read little endian */
Expand Down Expand Up @@ -436,7 +436,7 @@ test_no_size_change_no_bkg(hid_t fid, unsigned chunked, unsigned mwbuf)
*
*/
static herr_t
test_larger_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsigned mwbuf)
test_larger_mem_type_no_bkg(hid_t fid, unsigned set_cache, unsigned chunked, unsigned dtrans, unsigned mwbuf)
{
int i;
hid_t did = H5I_INVALID_HID;
Expand Down Expand Up @@ -509,7 +509,7 @@ test_larger_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsign
TEST_ERROR;

/* Verify selection I/O mode */
if (check_actual_selection_io_mode(dxpl, chunked ? 0 : H5D_SCALAR_IO) < 0)
if (check_actual_selection_io_mode(dxpl, chunked && !set_cache ? 0 : H5D_SCALAR_IO) < 0)
TEST_ERROR;

/* Restore wbuf from backup if the library modified it */
Expand All @@ -521,7 +521,7 @@ test_larger_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsign
TEST_ERROR;

/* Verify selection I/O mode */
if (check_actual_selection_io_mode(dxpl, chunked ? 0 : H5D_SCALAR_IO) < 0)
if (check_actual_selection_io_mode(dxpl, chunked && !set_cache ? 0 : H5D_SCALAR_IO) < 0)
TEST_ERROR;

/* Verify data or transformed data read */
Expand Down Expand Up @@ -586,7 +586,7 @@ test_larger_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsign
* --read dataset with H5T_NATIVE_SHORT
*/
static herr_t
test_smaller_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsigned mwbuf)
test_smaller_mem_type_no_bkg(hid_t fid, unsigned set_cache, unsigned chunked, unsigned dtrans, unsigned mwbuf)
{
int i;
hid_t did = H5I_INVALID_HID;
Expand Down Expand Up @@ -660,7 +660,7 @@ test_smaller_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsig
TEST_ERROR;

/* Verify selection I/O mode */
if (check_actual_selection_io_mode(dxpl, chunked ? 0 : H5D_SCALAR_IO) < 0)
if (check_actual_selection_io_mode(dxpl, chunked && !set_cache ? 0 : H5D_SCALAR_IO) < 0)
TEST_ERROR;

/* Restore wbuf from backup if the library modified it */
Expand All @@ -672,7 +672,7 @@ test_smaller_mem_type_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsig
TEST_ERROR;

/* Verify selection I/O mode */
if (check_actual_selection_io_mode(dxpl, chunked ? 0 : H5D_SCALAR_IO) < 0)
if (check_actual_selection_io_mode(dxpl, chunked && !set_cache ? 0 : H5D_SCALAR_IO) < 0)
TEST_ERROR;

/* Verify data or transformed data read */
Expand Down Expand Up @@ -820,7 +820,7 @@ test_cmpd_with_bkg(hid_t fid, unsigned chunked, unsigned mwbuf)
TEST_ERROR;

if (H5Pset_fill_value(dcpl, s1_tid, &fillvalue) < 0)
FAIL_STACK_ERROR;
TEST_ERROR;

if (chunked) {
cdims[0] = DSET_SELECT_CHUNK_DIM;
Expand Down Expand Up @@ -1077,7 +1077,7 @@ test_cmpd_with_bkg(hid_t fid, unsigned chunked, unsigned mwbuf)
* Datatype for all datasets: H5T_NATIVE_LONG
*/
static herr_t
test_multi_dsets_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsigned mwbuf)
test_multi_dsets_no_bkg(hid_t fid, unsigned set_cache, unsigned chunked, unsigned dtrans, unsigned mwbuf)
{
size_t ndsets;
int i, j;
Expand Down Expand Up @@ -1223,7 +1223,7 @@ test_multi_dsets_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsigned m
TEST_ERROR;

/* Verify selection I/O mode */
if (check_actual_selection_io_mode(dxpl, chunked ? 0 : H5D_SCALAR_IO) < 0)
if (check_actual_selection_io_mode(dxpl, chunked && !set_cache ? 0 : H5D_SCALAR_IO) < 0)
TEST_ERROR;

/* Restore wbuf from backup if the library modified it */
Expand All @@ -1235,7 +1235,7 @@ test_multi_dsets_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsigned m
TEST_ERROR;

/* Verify selection I/O mode */
if (check_actual_selection_io_mode(dxpl, chunked ? 0 : H5D_SCALAR_IO) < 0)
if (check_actual_selection_io_mode(dxpl, chunked && !set_cache ? 0 : H5D_SCALAR_IO) < 0)
TEST_ERROR;

/* Verify */
Expand All @@ -1255,7 +1255,7 @@ test_multi_dsets_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsigned m
TEST_ERROR;

/* Verify selection I/O mode */
if (check_actual_selection_io_mode(dxpl, chunked ? 0 : H5D_SCALAR_IO) < 0)
if (check_actual_selection_io_mode(dxpl, chunked && !set_cache ? 0 : H5D_SCALAR_IO) < 0)
TEST_ERROR;

/* Verify */
Expand Down Expand Up @@ -1374,7 +1374,7 @@ test_multi_dsets_no_bkg(hid_t fid, unsigned chunked, unsigned dtrans, unsigned m
if (total_lrbuf)
free(total_lrbuf);
if (total_trans_lwbuf)
free(total_lrbuf);
free(total_trans_lwbuf);

return FAIL;

Expand Down Expand Up @@ -2815,7 +2815,7 @@ test_set_get_select_io_mode(const char *filename, hid_t fapl)
TESTING("H5Pget/set_selection_io_mode()");

if ((fid = H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0)
FAIL_STACK_ERROR;
TEST_ERROR;

if ((dxpl = H5Pcreate(H5P_DATASET_XFER)) < 0)
TEST_ERROR;
Expand Down Expand Up @@ -3264,7 +3264,7 @@ main(void)
case TEST_NO_TYPE_CONV: /* case 1 */
TESTING_2("No type conversion (null case)");

nerrors += (test_no_type_conv(fid, chunked, dtrans, mwbuf) < 0 ? 1 : 0);
nerrors += (test_no_type_conv(fid, set_cache, chunked, dtrans, mwbuf) < 0 ? 1 : 0);

break;

Expand All @@ -3275,23 +3275,23 @@ main(void)
if (dtrans)
SKIPPED();
else
nerrors += (test_no_size_change_no_bkg(fid, chunked, mwbuf) < 0 ? 1 : 0);
nerrors += (test_no_size_change_no_bkg(fid, set_cache, chunked, mwbuf) < 0 ? 1 : 0);

break;

case TEST_LARGER_MEM_NO_BKG: /* case 3 */
TESTING_2("Larger memory type, no background buffer");

nerrors +=
(test_larger_mem_type_no_bkg(fid, chunked, dtrans, mwbuf) < 0 ? 1 : 0);
(test_larger_mem_type_no_bkg(fid, set_cache, chunked, dtrans, mwbuf) < 0 ? 1 : 0);

break;

case TEST_SMALLER_MEM_NO_BKG: /* case 4 */
TESTING_2("Smaller memory type, no background buffer");

nerrors +=
(test_smaller_mem_type_no_bkg(fid, chunked, dtrans, mwbuf) < 0 ? 1 : 0);
(test_smaller_mem_type_no_bkg(fid, set_cache, chunked, dtrans, mwbuf) < 0 ? 1 : 0);

break;

Expand All @@ -3309,7 +3309,7 @@ main(void)
case TEST_MULTI_CONV_NO_BKG: /* case 6 */
TESTING_2("multi-datasets: type conv + no bkg buffer");

nerrors += test_multi_dsets_no_bkg(fid, chunked, dtrans, mwbuf);
nerrors += test_multi_dsets_no_bkg(fid, set_cache, chunked, dtrans, mwbuf);

break;

Expand Down

0 comments on commit 09aa92d

Please sign in to comment.