summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2017-02-28 05:23:44 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2017-02-28 05:23:44 (GMT)
commite5fb4191de1129f58cc7b9b8ee67f4cec1488f39 (patch)
treec6151b0582ef769f95549bc1c231fb3609408733 /test
parentfd268dca96ea76ef0ec4425434502343ee2055d7 (diff)
downloadhdf5-e5fb4191de1129f58cc7b9b8ee67f4cec1488f39.zip
hdf5-e5fb4191de1129f58cc7b9b8ee67f4cec1488f39.tar.gz
hdf5-e5fb4191de1129f58cc7b9b8ee67f4cec1488f39.tar.bz2
Revert "Fix some more signed -> unsigned value issues with cache data structures, also"
This reverts commit 4b5e05c084f93c35dae946c2c9e814d565a613b0.
Diffstat (limited to 'test')
-rw-r--r--test/cache.c47
-rw-r--r--test/cache_api.c13
-rw-r--r--test/cache_common.c2
-rw-r--r--test/links.c12
4 files changed, 48 insertions, 26 deletions
diff --git a/test/cache.c b/test/cache.c
index 1cfc0b1..d09a122 100644
--- a/test/cache.c
+++ b/test/cache.c
@@ -13697,7 +13697,7 @@ check_move_entry(void)
{
unsigned u;
H5F_t * file_ptr = NULL;
- struct move_entry_test_spec test_specs[4] =
+ struct move_entry_test_spec test_specs[8] =
{
{
/* int entry_type = */ PICO_ENTRY_TYPE,
@@ -16779,6 +16779,7 @@ check_expunge_entry_errs(void)
*
*-------------------------------------------------------------------------
*/
+
static unsigned
check_move_entry_errs(void)
{
@@ -16800,6 +16801,7 @@ check_move_entry_errs(void)
*/
if(pass) {
+
reset_entries();
file_ptr = setup_cache((size_t)(2 * 1024), (size_t)(1 * 1024));
@@ -16812,29 +16814,36 @@ check_move_entry_errs(void)
entry_0_0_ptr = &((entries[0])[0]);
entry_0_1_ptr = &((entries[0])[1]);
entry_1_0_ptr = &((entries[1])[0]);
- } /* end if */
+ }
if(pass) {
- result = H5C_move_entry(cache_ptr, types[0], entry_0_0_ptr->addr, entry_0_1_ptr->addr);
+
+ result = H5C_move_entry(cache_ptr, types[0],
+ entry_0_0_ptr->addr, entry_0_1_ptr->addr);
if(result >= 0) {
+
pass = FALSE;
failure_mssg = "move to addr of same type succeeded.\n";
- } /* end if */
- } /* end if */
+ }
+ }
if(pass) {
- result = H5C_move_entry(cache_ptr, types[0], entry_0_0_ptr->addr, entry_1_0_ptr->addr);
+
+ result = H5C_move_entry(cache_ptr, types[0],
+ entry_0_0_ptr->addr, entry_1_0_ptr->addr);
if(result >= 0) {
+
pass = FALSE;
failure_mssg = "move to addr of different type succeeded.\n";
- } /* end if */
- } /* end if */
+ }
+ }
if(pass)
takedown_cache(file_ptr, FALSE, FALSE);
+
/* Allocate a cache, protect an entry R/O, and then call
* H5C_move_entry() to move it -- this should fail.
*
@@ -16843,6 +16852,7 @@ check_move_entry_errs(void)
*/
if(pass) {
+
reset_entries();
file_ptr = setup_cache((size_t)(2 * 1024), (size_t)(1 * 1024));
@@ -16850,21 +16860,29 @@ check_move_entry_errs(void)
cache_ptr = file_ptr->shared->cache;
insert_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET);
+
protect_entry_ro(file_ptr, 0, 0);
entry_ptr = &((entries[0])[0]);
- } /* end if */
+
+ }
if(pass) {
+
result = H5C_move_entry(cache_ptr, types[0], entry_ptr->header.addr, entry_ptr->header.addr + 10);
if(result >= 0) {
+
pass = FALSE;
- failure_mssg = "Call to H5C_move_entry on a R/O protected entry succeeded.\n";
- } /* end if */
- else
+ failure_mssg =
+ "Call to H5C_move_entry on a R/O protected entry succeeded.\n";
+
+ } else {
+
unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET);
- } /* end if */
+
+ }
+ }
if(pass)
takedown_cache(file_ptr, FALSE, FALSE);
@@ -16874,7 +16892,8 @@ check_move_entry_errs(void)
else {
H5_FAILED()
- HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n", FUNC, failure_mssg);
+ HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n",
+ FUNC, failure_mssg);
} /* end else */
return (unsigned)!pass;
diff --git a/test/cache_api.c b/test/cache_api.c
index 6c43796..a0d6e83 100644
--- a/test/cache_api.c
+++ b/test/cache_api.c
@@ -2314,12 +2314,19 @@ main(void)
nerrs += 1;
}
- if(invalid_configs )
+ if ( invalid_configs ) {
+
HDfree(invalid_configs);
+ }
+
+ if ( nerrs > 0 ) {
- if(nerrs > 0)
return EXIT_FAILURE;
- else
+
+ } else {
+
return EXIT_SUCCESS;
+ }
+
} /* main() */
diff --git a/test/cache_common.c b/test/cache_common.c
index 81e62ae..bb526c1 100644
--- a/test/cache_common.c
+++ b/test/cache_common.c
@@ -6438,7 +6438,7 @@ dump_LRU(H5F_t * file_ptr)
entry_ptr = cache_ptr->LRU_head_ptr;
HDfprintf(stdout,
- "\n\nIndex len/size/clean size/dirty size = %u/%lld/%lld/%lld\n",
+ "\n\nIndex len/size/clean size/dirty size = %d/%lld/%lld/%lld\n",
cache_ptr->index_len, (long long)(cache_ptr->index_size),
(long long)(cache_ptr->clean_index_size),
(long long)(cache_ptr->dirty_index_size));
diff --git a/test/links.c b/test/links.c
index 3364c7e..d5a3b83 100644
--- a/test/links.c
+++ b/test/links.c
@@ -21,22 +21,18 @@
*/
/*
- * This file needs to access private information from the H5FD package.
- * This file also needs to access the file driver testing code.
- */
-#define H5FD_FRIEND /*suppress error about including H5FDpkg */
-#define H5FD_TESTING
-
-/*
* This file needs to access private information from the H5G package.
* This file also needs to access the group testing code.
*/
#define H5G_FRIEND /*suppress error about including H5Gpkg */
#define H5G_TESTING
+#define H5FD_FRIEND /*suppress error about including H5FDpkg */
+#define H5FD_TESTING
+
#include "h5test.h"
#include "H5srcdir.h"
-#include "H5FDpkg.h" /* File drivers */
+#include "H5FDpkg.h" /* File drivers */
#include "H5Gpkg.h" /* Groups */
#include "H5Iprivate.h" /* IDs */
#include "H5Lprivate.h" /* Links */