summaryrefslogtreecommitdiff
path: root/test/format/ops.c
diff options
context:
space:
mode:
authorKeith Bostic <keith@wiredtiger.com>2016-02-19 11:17:43 -0500
committerKeith Bostic <keith@wiredtiger.com>2016-02-19 11:17:43 -0500
commit1935326625f661571f322191f83c70d422486c6d (patch)
tree104f34227628bac32f5d3733b2d596b8c03efe09 /test/format/ops.c
parentc492688d9f67e6ae91b6f6ec3064bc7120ae84d0 (diff)
downloadmongo-1935326625f661571f322191f83c70d422486c6d.tar.gz
WT-2405: test utility error handling.
Add testutil_checkfmt, a macro that supports additional error output.
Diffstat (limited to 'test/format/ops.c')
-rw-r--r--test/format/ops.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/test/format/ops.c b/test/format/ops.c
index d248736bb57..5d66f4d5391 100644
--- a/test/format/ops.c
+++ b/test/format/ops.c
@@ -229,7 +229,7 @@ ops(void *arg)
uint32_t op;
uint8_t *keybuf, *valbuf;
u_int np;
- int ckpt_available, dir, insert, intxn, notfound, readonly, ret;
+ int ckpt_available, dir, insert, intxn, notfound, readonly;
char *ckpt_config, ckpt_name[64];
tinfo = arg;
@@ -352,11 +352,9 @@ ops(void *arg)
testutil_check(
pthread_rwlock_wrlock(&g.backup_lock));
- if ((ret =
- session->checkpoint(session, ckpt_config)) != 0)
- testutil_die(ret, "session.checkpoint%s%s",
- ckpt_config == NULL ? "" : ": ",
- ckpt_config == NULL ? "" : ckpt_config);
+ testutil_checkfmt(
+ session->checkpoint(session, ckpt_config),
+ "%s", ckpt_config == NULL ? "" : ckpt_config);
if (ckpt_config != NULL)
testutil_check(
@@ -554,7 +552,6 @@ wts_read_scan(void)
WT_SESSION *session;
uint64_t cnt, last_cnt;
uint8_t *keybuf;
- int ret;
conn = g.wts_conn;
@@ -578,8 +575,8 @@ wts_read_scan(void)
}
key.data = keybuf;
- if ((ret = read_row(cursor, &key, cnt, 0)) != 0)
- testutil_die(ret, "read_scan");
+ testutil_checkfmt(
+ read_row(cursor, &key, cnt, 0), "%s", "read_scan");
}
testutil_check(session->close(session, NULL));
@@ -1074,8 +1071,7 @@ col_insert(TINFO *tinfo,
return (WT_ROLLBACK);
testutil_die(ret, "cursor.insert");
}
- if ((ret = cursor->get_key(cursor, &keyno)) != 0)
- testutil_die(ret, "cursor.get_key");
+ testutil_check(cursor->get_key(cursor, &keyno));
*keynop = (uint32_t)keyno;
table_append(keyno); /* Extend the object. */