summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2017-02-23 07:21:41 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2017-02-23 07:21:41 (GMT)
commit4b5e05c084f93c35dae946c2c9e814d565a613b0 (patch)
tree634c5cb617eb9a63dc7f5cf8487f30fef81321f1 /test
parent2c2fb928daa8fa82930f78d00f9ee0dcad70d35a (diff)
downloadhdf5-4b5e05c084f93c35dae946c2c9e814d565a613b0.zip
hdf5-4b5e05c084f93c35dae946c2c9e814d565a613b0.tar.gz
hdf5-4b5e05c084f93c35dae946c2c9e814d565a613b0.tar.bz2
Fix some more signed -> unsigned value issues with cache data structures, also
misc. style cleanups. All to align w/incoming page_buffering changes.
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, 26 insertions, 48 deletions
diff --git a/test/cache.c b/test/cache.c
index d09a122..1cfc0b1 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[8] =
+ struct move_entry_test_spec test_specs[4] =
{
{
/* int entry_type = */ PICO_ENTRY_TYPE,
@@ -16779,7 +16779,6 @@ check_expunge_entry_errs(void)
*
*-------------------------------------------------------------------------
*/
-
static unsigned
check_move_entry_errs(void)
{
@@ -16801,7 +16800,6 @@ check_move_entry_errs(void)
*/
if(pass) {
-
reset_entries();
file_ptr = setup_cache((size_t)(2 * 1024), (size_t)(1 * 1024));
@@ -16814,36 +16812,29 @@ 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.
*
@@ -16852,7 +16843,6 @@ check_move_entry_errs(void)
*/
if(pass) {
-
reset_entries();
file_ptr = setup_cache((size_t)(2 * 1024), (size_t)(1 * 1024));
@@ -16860,29 +16850,21 @@ 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";
-
- } else {
-
+ failure_mssg = "Call to H5C_move_entry on a R/O protected entry succeeded.\n";
+ } /* end if */
+ else
unprotect_entry(file_ptr, 0, 0, H5C__NO_FLAGS_SET);
-
- }
- }
+ } /* end if */
if(pass)
takedown_cache(file_ptr, FALSE, FALSE);
@@ -16892,8 +16874,7 @@ 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 a0d6e83..6c43796 100644
--- a/test/cache_api.c
+++ b/test/cache_api.c
@@ -2314,19 +2314,12 @@ 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 bb526c1..81e62ae 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 = %d/%lld/%lld/%lld\n",
+ "\n\nIndex len/size/clean size/dirty size = %u/%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 d5a3b83..3364c7e 100644
--- a/test/links.c
+++ b/test/links.c
@@ -21,18 +21,22 @@
*/
/*
+ * 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 */