diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2008-10-07 13:32:32 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2008-10-07 13:32:32 (GMT) |
commit | bdbdbb9f89db8d3a76fc71705cdbbd89124f4687 (patch) | |
tree | 53d16d2097c591d2c7094da6b8e2b23ef5663a0f /test/btree2.c | |
parent | b256db872d5ce4f81c6486b60c4e29e8122b67c2 (diff) | |
download | hdf5-bdbdbb9f89db8d3a76fc71705cdbbd89124f4687.zip hdf5-bdbdbb9f89db8d3a76fc71705cdbbd89124f4687.tar.gz hdf5-bdbdbb9f89db8d3a76fc71705cdbbd89124f4687.tar.bz2 |
[svn-r15801] Description:
Bring r15800 back from trunk:
- File free space branch changes through r15794
Tested on:
Mac OS X/32 10.5.5 (amazon) in debug mode
Mac OS X/32 10.5.5 (amazon) w/C++ & FORTRAN, w/threadsafe,
in production mode
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
Diffstat (limited to 'test/btree2.c')
-rw-r--r-- | test/btree2.c | 82 |
1 files changed, 30 insertions, 52 deletions
diff --git a/test/btree2.c b/test/btree2.c index d4347d4..a25a373 100644 --- a/test/btree2.c +++ b/test/btree2.c @@ -76,9 +76,9 @@ iter_cb(const void *_record, void *_op_data) * * Purpose: v2 B-tree find callback * - * Return: Success: 0 + * Return: Success: TRUE/FALSE * - * Failure: 1 + * Failure: FAIL * * Programmer: Quincey Koziol * Thursday, February 24, 2005 @@ -92,9 +92,9 @@ find_cb(const void *_record, void *_op_data) hsize_t *search = (hsize_t *)_op_data; if(*record != *search) - return(-1); + return(FALSE); - return(0); + return(TRUE); } /* end find_cb() */ @@ -261,11 +261,7 @@ test_insert_basic(hid_t fapl) /* Attempt to find record in B-tree with no records */ idx = 0; - H5E_BEGIN_TRY { - ret = H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &idx, find_cb, NULL); - } H5E_END_TRY; - /* Should fail */ - if(ret != FAIL) + if(H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &idx, find_cb, NULL) != FALSE) TEST_ERROR /* Attempt to index record in B-tree with no records */ @@ -286,29 +282,23 @@ test_insert_basic(hid_t fapl) FAIL_STACK_ERROR /* Attempt to find non-existant record in B-tree with 1 record */ + /* (Should not be found, but not fail) */ idx = 41; - H5E_BEGIN_TRY { - ret = H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &idx, find_cb, &idx); - } H5E_END_TRY; - /* Should fail */ - if(ret != FAIL) + if(H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &idx, find_cb, &idx) != FALSE) TEST_ERROR /* Try again with NULL 'op' */ - H5E_BEGIN_TRY { - ret = H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &idx, NULL, NULL); - } H5E_END_TRY; - /* Should fail */ - if(ret != FAIL) + /* (Should not be found, but not fail) */ + if(H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &idx, NULL, NULL) != FALSE) TEST_ERROR /* Attempt to find existant record in B-tree with 1 record */ idx = 42; - if(H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &idx, find_cb, &idx)<0) + if(H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &idx, find_cb, &idx) != TRUE) TEST_ERROR /* Try again with NULL 'op' */ - if(H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &idx, NULL, NULL)<0) + if(H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &idx, NULL, NULL) != TRUE) TEST_ERROR /* Attempt to index non-existant record in B-tree with 1 record */ @@ -347,17 +337,14 @@ test_insert_basic(hid_t fapl) FAIL_STACK_ERROR /* Attempt to find non-existant record in level-0 B-tree with several records */ + /* (Should not be found, but not fail) */ idx = 41; - H5E_BEGIN_TRY { - ret = H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &idx, find_cb, &idx); - } H5E_END_TRY; - /* Should fail */ - if(ret != FAIL) + if(H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &idx, find_cb, &idx) != FALSE) TEST_ERROR /* Attempt to find existant record in level-0 B-tree with several record */ idx = 56; - if(H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &idx, find_cb, &idx)<0) + if(H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &idx, find_cb, &idx) != TRUE) TEST_ERROR /* Attempt to index non-existant record in B-tree with several records */ @@ -521,22 +508,19 @@ test_insert_split_root(hid_t fapl) TEST_ERROR /* Attempt to find non-existant record in level-1 B-tree */ + /* (Should not be found, but not fail) */ idx = INSERT_SPLIT_ROOT_NREC + 10; - H5E_BEGIN_TRY { - ret = H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &idx, find_cb, &idx); - } H5E_END_TRY; - /* Should fail */ - if(ret != FAIL) + if(H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &idx, find_cb, &idx) != FALSE) TEST_ERROR /* Attempt to find existant record in root of level-1 B-tree */ idx = 33; - if(H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &idx, find_cb, &idx) < 0) + if(H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &idx, find_cb, &idx) != TRUE) FAIL_STACK_ERROR /* Attempt to find existant record in leaf of level-1 B-tree */ idx = 56; - if(H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &idx, find_cb, &idx) < 0) + if(H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &idx, find_cb, &idx) != TRUE) FAIL_STACK_ERROR /* Attempt to index non-existant record in level-1 B-tree */ @@ -1286,17 +1270,14 @@ test_insert_make_level2(hid_t fapl) TEST_ERROR /* Attempt to find non-existant record in level-2 B-tree */ + /* (Should not be found, but not fail) */ idx = INSERT_SPLIT_ROOT_NREC * 30; - H5E_BEGIN_TRY { - ret = H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &idx, find_cb, &idx); - } H5E_END_TRY; - /* Should fail */ - if(ret != FAIL) + if(H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &idx, find_cb, &idx) != FALSE) TEST_ERROR /* Attempt to find existant record in root of level-2 B-tree */ idx = 948; - if(H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &idx, find_cb, &idx) < 0) + if(H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &idx, find_cb, &idx) != TRUE) FAIL_STACK_ERROR /* Check with B-tree */ @@ -1308,7 +1289,7 @@ test_insert_make_level2(hid_t fapl) /* Attempt to find existant record in internal node of level-2 B-tree */ idx = 505; - if(H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &idx, find_cb, &idx) < 0) + if(H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &idx, find_cb, &idx) != TRUE) FAIL_STACK_ERROR /* Check with B-tree */ @@ -1320,7 +1301,7 @@ test_insert_make_level2(hid_t fapl) /* Attempt to find existant record in leaf of level-2 B-tree */ idx = 555; - if(H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &idx, find_cb, &idx) < 0) + if(H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &idx, find_cb, &idx) != TRUE) FAIL_STACK_ERROR /* Check with B-tree */ @@ -2838,12 +2819,9 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); TEST_ERROR /* Attempt to find non-existant record in level-4 B-tree */ - idx = INSERT_MANY*2; - H5E_BEGIN_TRY { - ret = H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &idx, find_cb, &idx); - } H5E_END_TRY; - /* Should fail */ - if(ret != FAIL) + /* (Should not be found, but not fail) */ + idx = INSERT_MANY * 2; + if(H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &idx, find_cb, &idx) != FALSE) TEST_ERROR /* Find random records */ @@ -2852,7 +2830,7 @@ HDfprintf(stderr,"curr_time=%lu\n",(unsigned long)curr_time); idx = (hsize_t)(HDrandom()%INSERT_MANY); /* Attempt to find existant record in root of level-4 B-tree */ - if(H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &idx, find_cb, &idx) < 0) + if(H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &idx, find_cb, &idx) != TRUE) FAIL_STACK_ERROR } /* end for */ @@ -7310,7 +7288,7 @@ test_modify(hid_t fapl) /* Attempt to find modified record */ record = 4331; found = 4331; - if(H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &record, find_cb, &found) < 0) + if(H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &record, find_cb, &found) != TRUE) FAIL_STACK_ERROR if(found != 4331) TEST_ERROR @@ -7354,7 +7332,7 @@ test_modify(hid_t fapl) /* Attempt to find modified record */ record = 5352; found = 5352; - if(H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &record, find_cb, &found) < 0) + if(H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &record, find_cb, &found) != TRUE) STACK_ERROR if(found != 5352) TEST_ERROR @@ -7398,7 +7376,7 @@ test_modify(hid_t fapl) /* Attempt to find modified record */ record = 9448; found = 9448; - if(H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &record, find_cb, &found) < 0) + if(H5B2_find(f, H5P_DATASET_XFER_DEFAULT, H5B2_TEST, bt2_addr, &record, find_cb, &found) != TRUE) STACK_ERROR if(found != 9448) TEST_ERROR |