diff options
author | Andrew Bartlett <abartlet@samba.org> | 2012-05-18 15:43:31 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2012-05-18 09:35:13 +0200 |
commit | 45082a88c7aaaa928ca36003ade071aafe4de54d (patch) | |
tree | 2800e5aaff2da77f5156e12a8bba5e765e794e35 /source4/torture/raw/context.c | |
parent | 8c52d1b8ac7d56eb728e4cc4ed2a560365d374b5 (diff) | |
download | samba-45082a88c7aaaa928ca36003ade071aafe4de54d.tar.gz samba-45082a88c7aaaa928ca36003ade071aafe4de54d.tar.bz2 samba-45082a88c7aaaa928ca36003ade071aafe4de54d.zip |
s4-torture: Improve torture test boilerplate, use torture_assert()
This ensures that if this fails, it is reported as a subunit error correctly.
Andrew Bartlett
Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Fri May 18 09:35:13 CEST 2012 on sn-devel-104
Diffstat (limited to 'source4/torture/raw/context.c')
-rw-r--r-- | source4/torture/raw/context.c | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/source4/torture/raw/context.c b/source4/torture/raw/context.c index 386ba34ae5..d9d7820e5f 100644 --- a/source4/torture/raw/context.c +++ b/source4/torture/raw/context.c @@ -73,9 +73,7 @@ static bool test_session(struct torture_context *tctx, torture_comment(tctx, "TESTING SESSION HANDLING\n"); - if (!torture_setup_dir(cli, BASEDIR)) { - return false; - } + torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR); torture_comment(tctx, "create a second security context on the same transport\n"); @@ -285,9 +283,7 @@ static bool test_tree(struct torture_context *tctx, struct smbcli_state *cli) torture_comment(tctx, "TESTING TREE HANDLING\n"); - if (!torture_setup_dir(cli, BASEDIR)) { - return false; - } + torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR); share = torture_setting_string(tctx, "share", NULL); host = torture_setting_string(tctx, "host", NULL); @@ -394,9 +390,7 @@ static bool test_tree_ulogoff(struct torture_context *tctx, struct smbcli_state torture_comment(tctx, "TESTING TREE with ulogoff\n"); - if (!torture_setup_dir(cli, BASEDIR)) { - return false; - } + torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR); share = torture_setting_string(tctx, "share", NULL); host = torture_setting_string(tctx, "host", NULL); @@ -545,9 +539,7 @@ static bool test_pid_exit_only_sees_open(struct torture_context *tctx, torture_comment(tctx, "TESTING PID HANDLING exit() only cares about open() PID\n"); - if (!torture_setup_dir(cli, BASEDIR)) { - return false; - } + torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR); pid1 = cli->session->pid; pid2 = pid1 + 1; @@ -657,9 +649,7 @@ static bool test_pid_2sess(struct torture_context *tctx, torture_comment(tctx, "TESTING PID HANDLING WITH 2 SESSIONS\n"); - if (!torture_setup_dir(cli, BASEDIR)) { - return false; - } + torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR); lpcfg_smbcli_session_options(tctx->lp_ctx, &options); @@ -766,9 +756,7 @@ static bool test_pid_2tcon(struct torture_context *tctx, torture_comment(tctx, "TESTING PID HANDLING WITH 2 TCONS\n"); - if (!torture_setup_dir(cli, BASEDIR)) { - return false; - } + torture_assert(tctx, torture_setup_dir(cli, BASEDIR), "Failed to setup up test directory: " BASEDIR); share = torture_setting_string(tctx, "share", NULL); host = torture_setting_string(tctx, "host", NULL); |