diff options
author | Keith Bostic <keith.bostic@mongodb.com> | 2016-09-05 21:59:46 -0400 |
---|---|---|
committer | Alex Gorrod <alexander.gorrod@mongodb.com> | 2016-09-06 11:59:46 +1000 |
commit | 3aab0803b5401c8aed08813cb58d3a6f341fbb00 (patch) | |
tree | 76f8d9e9c655b5d66517bf0d08c775edf237e293 /test | |
parent | 375066e5cf6c16cb338452fa3a7dd032cd5aad8d (diff) | |
download | mongo-3aab0803b5401c8aed08813cb58d3a6f341fbb00.tar.gz |
WT-2888 Switch functions to return void where possible (#3019)
Some functions return an error code even though they don't need to. That adds complexity to our code. Switch to returning a void.
Diffstat (limited to 'test')
-rw-r--r-- | test/bloom/test_bloom.c | 3 | ||||
-rw-r--r-- | test/checkpoint/test_checkpoint.c | 9 | ||||
-rw-r--r-- | test/csuite/wt2853_perf/main.c | 6 | ||||
-rw-r--r-- | test/manydbs/manydbs.c | 5 |
4 files changed, 11 insertions, 12 deletions
diff --git a/test/bloom/test_bloom.c b/test/bloom/test_bloom.c index 9a7584f951f..7a298f000aa 100644 --- a/test/bloom/test_bloom.c +++ b/test/bloom/test_bloom.c @@ -160,8 +160,7 @@ run(void) item.size = g.c_key_max; for (i = 0; i < g.c_ops; i++) { item.data = g.entries[i]; - if ((ret = __wt_bloom_insert(bloomp, &item)) != 0) - testutil_die(ret, "__wt_bloom_insert: %" PRIu32, i); + __wt_bloom_insert(bloomp, &item); } testutil_check(__wt_bloom_finalize(bloomp)); diff --git a/test/checkpoint/test_checkpoint.c b/test/checkpoint/test_checkpoint.c index 6293d36f916..6b2f0d4466c 100644 --- a/test/checkpoint/test_checkpoint.c +++ b/test/checkpoint/test_checkpoint.c @@ -34,7 +34,7 @@ static int handle_error(WT_EVENT_HANDLER *, WT_SESSION *, int, const char *); static int handle_message(WT_EVENT_HANDLER *, WT_SESSION *, const char *); static void onint(int) WT_GCC_FUNC_DECL_ATTRIBUTE((noreturn)); -static int cleanup(void); +static void cleanup(void); static int usage(void); static int wt_connect(const char *); static int wt_shutdown(void); @@ -139,7 +139,7 @@ main(int argc, char *argv[]) printf(" %d: %d workers, %d tables\n", cnt, g.nworkers, g.ntables); - (void)cleanup(); /* Clean up previous runs */ + cleanup(); /* Clean up previous runs */ /* Setup a fresh set of cookies in the global array. */ if ((g.cookies = calloc( @@ -240,14 +240,13 @@ wt_shutdown(void) * cleanup -- * Clean up from previous runs. */ -static int +static void cleanup(void) { g.running = 0; g.ntables_created = 0; testutil_clean_work_dir(g.home); - return (0); } static int @@ -283,7 +282,7 @@ onint(int signo) { WT_UNUSED(signo); - (void)cleanup(); + cleanup(); fprintf(stderr, "\n"); exit(EXIT_FAILURE); diff --git a/test/csuite/wt2853_perf/main.c b/test/csuite/wt2853_perf/main.c index 016b7500145..67ba4a20ada 100644 --- a/test/csuite/wt2853_perf/main.c +++ b/test/csuite/wt2853_perf/main.c @@ -186,7 +186,8 @@ main(int argc, char *argv[]) return (0); } -static void *thread_insert(void *arg) +static void * +thread_insert(void *arg) { TEST_OPTS *opts; THREAD_ARGS *threadargs; @@ -252,7 +253,8 @@ static void *thread_insert(void *arg) return (NULL); } -static void *thread_get(void *arg) +static void * +thread_get(void *arg) { SHARED_OPTS *sharedopts; TEST_OPTS *opts; diff --git a/test/manydbs/manydbs.c b/test/manydbs/manydbs.c index e485e73067f..c5c9a9a7ccd 100644 --- a/test/manydbs/manydbs.c +++ b/test/manydbs/manydbs.c @@ -93,7 +93,7 @@ get_stat(WT_SESSION *stat_session, int stat_field, uint64_t *valuep) return (ret); } -static int +static void run_ops(int dbs) { WT_ITEM data; @@ -119,7 +119,6 @@ run_ops(int dbs) testutil_check(cursors[db]->insert(cursors[db])); } } - return (0); } int @@ -211,7 +210,7 @@ main(int argc, char *argv[]) WT_STAT_CONN_COND_AUTO_WAIT_RESET, &cond_reset_orig[i])); for (i = 0; i < MAX_IDLE_TIME; i += IDLE_INCR) { if (!idle) - testutil_check(run_ops(dbs)); + run_ops(dbs); printf("Sleep %d (%d of %d)\n", IDLE_INCR, i, MAX_IDLE_TIME); sleep(IDLE_INCR); } |