Skip to content

Commit

Permalink
Use local variable in btree2 and print value (#4679)
Browse files Browse the repository at this point in the history
* Correct logic

* Technically, level 1 Express could skip tests
  • Loading branch information
byrnHDF authored Aug 9, 2024
1 parent 46a3a20 commit 695c0f2
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 18 deletions.
18 changes: 10 additions & 8 deletions test/btree2.c
Original file line number Diff line number Diff line change
Expand Up @@ -9917,19 +9917,21 @@ main(void)
unsigned reopen; /* Whether to reopen B-tree during tests */
const char *driver_name;
bool api_ctx_pushed = false; /* Whether API context pushed */
int localTestExpress; /* localized TestExpress */

driver_name = h5_get_test_driver_name();

/* Reset library */
h5_test_init();
fapl = h5_fileaccess();
fapl = h5_fileaccess();
localTestExpress = TestExpress;

/* For the Direct I/O driver, skip intensive tests due to poor performance */
if (!strcmp(driver_name, "direct"))
SetTestExpress(2);
if (localTestExpress < 2 && !strcmp(driver_name, "direct"))
localTestExpress = 2;

if (TestExpress > 1)
printf("***Express test mode on. Some tests may be skipped\n");
if (localTestExpress > 0)
printf("***Express test mode %d. Some tests may be skipped\n", localTestExpress);

/* Initialize v2 B-tree creation parameters */
init_cparam(&cparam, &cparam2);
Expand Down Expand Up @@ -9965,7 +9967,7 @@ main(void)
nerrors += test_insert_level2_2internal_split(fapl, &cparam, &tparam);
nerrors += test_insert_level2_3internal_redistrib(fapl, &cparam, &tparam);
nerrors += test_insert_level2_3internal_split(fapl, &cparam, &tparam);
if (TestExpress > 1)
if (localTestExpress > 1)
printf("***Express test mode on. test_insert_lots skipped\n");
else
nerrors += test_insert_lots(fapl, &cparam, &tparam);
Expand All @@ -9979,7 +9981,7 @@ main(void)
nerrors += test_update_level1_3leaf_redistrib(fapl, &cparam2, &tparam);
nerrors += test_update_level1_middle_split(fapl, &cparam2, &tparam);
nerrors += test_update_make_level2(fapl, &cparam2, &tparam);
if (TestExpress > 1)
if (localTestExpress > 1)
printf("***Express test mode on. test_update_lots skipped\n");
else
nerrors += test_update_lots(fapl, &cparam2, &tparam);
Expand All @@ -10006,7 +10008,7 @@ main(void)
nerrors += test_remove_level2_2internal_merge_right(fapl, &cparam, &tparam);
nerrors += test_remove_level2_3internal_merge(fapl, &cparam, &tparam);
nerrors += test_remove_level2_collapse_right(fapl, &cparam, &tparam);
if (TestExpress > 1)
if (localTestExpress > 1)
printf("***Express test mode on. test_remove_lots skipped\n");
else
nerrors += test_remove_lots(driver_name, fapl, &cparam);
Expand Down
4 changes: 2 additions & 2 deletions test/earray.c
Original file line number Diff line number Diff line change
Expand Up @@ -2302,8 +2302,8 @@ main(void)
/* Reset library */
h5_test_init();
fapl = h5_fileaccess();
if (TestExpress > 1)
printf("***Express test mode on. Some tests may be skipped\n");
if (TestExpress > 0)
printf("***Express test mode %d. Some tests may be skipped\n", TestExpress);

/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename_g, sizeof(filename_g));
Expand Down
4 changes: 2 additions & 2 deletions test/farray.c
Original file line number Diff line number Diff line change
Expand Up @@ -1633,8 +1633,8 @@ main(void)
/* Reset library */
h5_test_init();
fapl = h5_fileaccess();
if (TestExpress > 1)
printf("***Express test mode on. Some tests may be skipped\n");
if (TestExpress > 0)
printf("***Express test mode %d. Some tests may be skipped\n", TestExpress);

/* Set the filename to use for this test (dependent on fapl) */
h5_fixname(FILENAME[0], fapl, filename_g, sizeof(filename_g));
Expand Down
4 changes: 2 additions & 2 deletions test/fheap.c
Original file line number Diff line number Diff line change
Expand Up @@ -15982,8 +15982,8 @@ main(void)
* Activate full testing when this feature is re-enabled
* in the future for parallel build.
*/
if (TestExpress > 1)
printf("***Express test mode on. Some tests may be skipped\n");
if (TestExpress > 0)
printf("***Express test mode %d. Some tests may be skipped\n", TestExpress);
else if (TestExpress == 0) {
#ifdef H5_HAVE_PARALLEL
num_pb_fs = NUM_PB_FS - 2;
Expand Down
4 changes: 2 additions & 2 deletions test/objcopy.c
Original file line number Diff line number Diff line change
Expand Up @@ -17136,8 +17136,8 @@ main(void)
if (h5_driver_is_default_vfd_compatible(fapl, &driver_is_default_compatible) < 0)
TEST_ERROR;

if (TestExpress > 1)
printf("***Express test mode on. Some tests may be skipped\n");
if (TestExpress > 0)
printf("***Express test mode %d. Some tests may be skipped\n", TestExpress);

/* Copy the file access property list */
if ((fapl2 = H5Pcopy(fapl)) < 0)
Expand Down
4 changes: 2 additions & 2 deletions test/objcopy_ref.c
Original file line number Diff line number Diff line change
Expand Up @@ -1823,8 +1823,8 @@ main(void)
h5_test_init();
fapl = h5_fileaccess();

if (TestExpress > 1)
printf("***Express test mode on. Some tests may be skipped\n");
if (TestExpress > 0)
printf("***Express test mode %d. Some tests may be skipped\n", TestExpress);

/* Copy the file access property list */
if ((fapl2 = H5Pcopy(fapl)) < 0)
Expand Down

0 comments on commit 695c0f2

Please sign in to comment.