summaryrefslogtreecommitdiffstats
path: root/test/cache_api.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/cache_api.c')
-rw-r--r--test/cache_api.c58
1 files changed, 37 insertions, 21 deletions
diff --git a/test/cache_api.c b/test/cache_api.c
index 8f556be..51dda99 100644
--- a/test/cache_api.c
+++ b/test/cache_api.c
@@ -32,15 +32,15 @@
/* private function declarations: */
-static void check_fapl_mdc_api_calls(void);
+static unsigned check_fapl_mdc_api_calls(void);
-static void check_file_mdc_api_calls(void);
+static unsigned check_file_mdc_api_calls(void);
-static void mdc_api_call_smoke_check(int express_test);
+static unsigned mdc_api_call_smoke_check(int express_test);
-static void check_fapl_mdc_api_errs(void);
+static unsigned check_fapl_mdc_api_errs(void);
-static void check_file_mdc_api_errs(void);
+static unsigned check_file_mdc_api_errs(void);
/**************************************************************************/
@@ -67,7 +67,7 @@ static void check_file_mdc_api_errs(void);
*
*-------------------------------------------------------------------------
*/
-static void
+static unsigned
check_fapl_mdc_api_calls(void)
{
const char * fcn_name = "check_fapl_mdc_api_calls()";
@@ -489,6 +489,8 @@ check_fapl_mdc_api_calls(void)
HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n",
fcn_name, failure_mssg);
+ return !pass;
+
} /* check_fapl_mdc_api_calls() */
@@ -516,7 +518,7 @@ check_fapl_mdc_api_calls(void)
*-------------------------------------------------------------------------
*/
-static void
+static unsigned
check_file_mdc_api_calls(void)
{
const char * fcn_name = "check_file_mdc_api_calls()";
@@ -839,6 +841,8 @@ check_file_mdc_api_calls(void)
HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n",
fcn_name, failure_mssg);
+ return !pass;
+
} /* check_file_mdc_api_calls() */
@@ -865,7 +869,7 @@ check_file_mdc_api_calls(void)
#define NUM_DSETS 6
#define NUM_RANDOM_ACCESSES 200000
-static void
+static unsigned
mdc_api_call_smoke_check(int express_test)
{
const char * fcn_name = "mdc_api_call_smoke_check()";
@@ -1004,7 +1008,7 @@ mdc_api_call_smoke_check(int express_test)
HDfprintf(stdout, " Long tests disabled.\n");
- return;
+ return 0;
}
pass = TRUE;
@@ -1105,7 +1109,7 @@ mdc_api_call_smoke_check(int express_test)
sprintf(dset_name, "/dset%03d", i);
dataset_ids[i] = H5Dcreate2(file_id, dset_name, H5T_STD_I32BE,
- dataspace_id, H5P_DEFAULT, properties, H5P_DEFAULT);
+ dataspace_id, H5P_DEFAULT, properties, H5P_DEFAULT);
if ( dataset_ids[i] < 0 ) {
@@ -1329,9 +1333,9 @@ mdc_api_call_smoke_check(int express_test)
}
n++;
-
}
+
/* close the file spaces we are done with */
i = 1;
while ( ( pass ) && ( i < NUM_DSETS ) )
@@ -1450,7 +1454,6 @@ mdc_api_call_smoke_check(int express_test)
}
n++;
-
}
/* close file space 0 */
@@ -1515,6 +1518,8 @@ mdc_api_call_smoke_check(int express_test)
HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n",
fcn_name, failure_mssg);
+ return !pass;
+
} /* mdc_api_call_smoke_check() */
@@ -3015,7 +3020,7 @@ H5AC_cache_config_t invalid_configs[NUM_INVALID_CONFIGS] =
*-------------------------------------------------------------------------
*/
-static void
+static unsigned
check_fapl_mdc_api_errs(void)
{
const char * fcn_name = "check_fapl_mdc_api_errs()";
@@ -3065,7 +3070,7 @@ check_fapl_mdc_api_errs(void)
scratch.version = H5C__CURR_AUTO_SIZE_CTL_VER;
if ( ( pass ) &&
- ( ( H5Pget_mdc_config(fapl_id, &scratch) < 0 ) ||
+ ( ( H5Pget_mdc_config(fapl_id, &scratch) < 0) ||
( !CACHE_CONFIGS_EQUAL(default_config, scratch, TRUE, TRUE) ) ) ) {
pass = FALSE;
@@ -3167,6 +3172,8 @@ check_fapl_mdc_api_errs(void)
HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n",
fcn_name, failure_mssg);
+ return !pass;
+
} /* check_fapl_mdc_api_errs() */
@@ -3186,7 +3193,7 @@ check_fapl_mdc_api_errs(void)
*-------------------------------------------------------------------------
*/
-static void
+static unsigned
check_file_mdc_api_errs(void)
{
const char * fcn_name = "check_file_mdc_api_errs()";
@@ -3504,6 +3511,8 @@ check_file_mdc_api_errs(void)
HDfprintf(stdout, "%s: failure_mssg = \"%s\".\n",
fcn_name, failure_mssg);
+ return !pass;
+
} /* check_file_mdc_api_errs() */
@@ -3527,28 +3536,35 @@ check_file_mdc_api_errs(void)
int
main(void)
{
+ unsigned nerrs = 0;
int express_test;
H5open();
express_test = GetTestExpress();
+ printf("===================================\n");
+ printf("Cache API tests\n");
+ printf(" express_test = %d\n", express_test);
+ printf("===================================\n");
+
+
#if 1
- check_fapl_mdc_api_calls();
+ nerrs += check_fapl_mdc_api_calls();
#endif
#if 1
- check_file_mdc_api_calls();
+ nerrs += check_file_mdc_api_calls();
#endif
#if 1
- mdc_api_call_smoke_check(express_test);
+ nerrs += mdc_api_call_smoke_check(express_test);
#endif
#if 1
- check_fapl_mdc_api_errs();
+ nerrs += check_fapl_mdc_api_errs();
#endif
#if 1
- check_file_mdc_api_errs();
+ nerrs += check_file_mdc_api_errs();
#endif
- return(0);
+ return( nerrs > 0 );
} /* main() */