summaryrefslogtreecommitdiffstats
path: root/test/cache.c
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2016-06-01 17:02:30 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2016-06-01 17:02:30 (GMT)
commitfcaf9c483ac83f9cc6765b032022d56081942d37 (patch)
tree6a7bd1614e391c348a3def3db79149aa50ba696c /test/cache.c
parent3384f4c0b9e4dffe183f5a6ee5ca29e40f29a7f8 (diff)
downloadhdf5-fcaf9c483ac83f9cc6765b032022d56081942d37.zip
hdf5-fcaf9c483ac83f9cc6765b032022d56081942d37.tar.gz
hdf5-fcaf9c483ac83f9cc6765b032022d56081942d37.tar.bz2
[svn-r30002] Fixed some minor warnings in H5AC.c and H5C.c, cleaned up warnings
in the cache tests, and made some huge static arrays dynamic in the cache tests. Tested on: 64-bit Ubuntu Linux w/ gcc 5.3.1 Autotools serial
Diffstat (limited to 'test/cache.c')
-rw-r--r--test/cache.c67
1 files changed, 40 insertions, 27 deletions
diff --git a/test/cache.c b/test/cache.c
index 88077e4..a5c8f93 100644
--- a/test/cache.c
+++ b/test/cache.c
@@ -9146,23 +9146,29 @@ check_flush_cache__flush_op_test(H5F_t * file_ptr,
( check[i].entry_type >= NUMBER_OF_ENTRY_TYPES ) ||
( check[i].entry_index < 0 ) ||
( check[i].entry_index > max_indices[check[i].entry_type] ) ||
- ( check[i].expected_size <= (size_t)0 ) ||
- ( ( check[i].in_cache != TRUE ) &&
- ( check[i].in_cache != FALSE ) ) ||
- ( ( check[i].at_main_addr != TRUE ) &&
- ( check[i].at_main_addr != FALSE ) ) ||
- ( ( check[i].is_dirty != TRUE ) &&
- ( check[i].is_dirty != FALSE ) ) ||
- ( ( check[i].is_protected != TRUE ) &&
- ( check[i].is_protected != FALSE ) ) ||
- ( ( check[i].is_pinned != TRUE ) &&
- ( check[i].is_pinned != FALSE ) ) ||
- ( ( check[i].expected_deserialized != TRUE ) &&
- ( check[i].expected_deserialized != FALSE ) ) ||
- ( ( check[i].expected_serialized != TRUE ) &&
- ( check[i].expected_serialized != FALSE ) ) ||
- ( ( check[i].expected_destroyed != TRUE ) &&
- ( check[i].expected_destroyed != FALSE ) ) ) {
+#ifndef H5_HAVE_STDBOOL_H
+ /* Check for nonsense values if hbool_t is an integral
+ * type instead of a real Boolean.
+ */
+ ( ( check[i].in_cache != TRUE ) &&
+ ( check[i].in_cache != FALSE ) ) ||
+ ( ( check[i].at_main_addr != TRUE ) &&
+ ( check[i].at_main_addr != FALSE ) ) ||
+ ( ( check[i].is_dirty != TRUE ) &&
+ ( check[i].is_dirty != FALSE ) ) ||
+ ( ( check[i].is_protected != TRUE ) &&
+ ( check[i].is_protected != FALSE ) ) ||
+ ( ( check[i].is_pinned != TRUE ) &&
+ ( check[i].is_pinned != FALSE ) ) ||
+ ( ( check[i].expected_deserialized != TRUE ) &&
+ ( check[i].expected_deserialized != FALSE ) ) ||
+ ( ( check[i].expected_serialized != TRUE ) &&
+ ( check[i].expected_serialized != FALSE ) ) ||
+ ( ( check[i].expected_destroyed != TRUE ) &&
+ ( check[i].expected_destroyed != FALSE ) ) ||
+#endif /* H5_HAVE_STDBOOL_H */
+ ( check[i].expected_size <= (size_t)0 )
+ ) {
pass = FALSE;
HDsnprintf(msg, (size_t)128,
@@ -35044,19 +35050,13 @@ check_stats__smoke_check_1(H5F_t * file_ptr)
/*-------------------------------------------------------------------------
- * Function: main
- *
- * Purpose: Run tests on the cache code contained in H5C.c
- *
- * Return: Success:
+ * Function: main
*
- * Failure:
+ * Return: EXIT_SUCCESS/EXIT_FAILURE
*
- * Programmer: John Mainzer
+ * Programmer: John Mainzer
* 6/24/04
*
- * Modifications:
- *
*-------------------------------------------------------------------------
*/
@@ -35075,6 +35075,12 @@ main(void)
printf(" express_test = %d\n", express_test);
printf("=========================================\n");
+ if ( create_entry_arrays() < 0 ) {
+
+ printf("ERROR: Unable to create entries arrays. Aborting.\n");
+ return EXIT_FAILURE;
+ } /* end if */
+
nerrs += smoke_check_1(express_test);
nerrs += smoke_check_2(express_test);
nerrs += smoke_check_3(express_test);
@@ -35127,6 +35133,13 @@ main(void)
nerrs += check_entry_deletions_during_scans();
nerrs += check_stats();
- return(nerrs > 0);
+ /* can't fail, returns void */
+ free_entry_arrays();
+
+ if ( nerrs > 0 )
+ return EXIT_FAILURE;
+ else
+ return EXIT_SUCCESS;
+
} /* main() */