diff options
author | Andrew Bartlett <abartlet@samba.org> | 2012-05-18 14:22:27 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2012-05-18 15:44:43 +1000 |
commit | e919cadcca063a4cb1a76a3c30b15f056a51e16d (patch) | |
tree | b667eebbfa092289319c16656c2e1674bd73607a /source4 | |
parent | 8e5badc2564019bc2d8b923971bd37bd8e5bb039 (diff) | |
download | samba-e919cadcca063a4cb1a76a3c30b15f056a51e16d.tar.gz samba-e919cadcca063a4cb1a76a3c30b15f056a51e16d.tar.bz2 samba-e919cadcca063a4cb1a76a3c30b15f056a51e16d.zip |
s4-torture: provide correct torture failures for failure to connect
Diffstat (limited to 'source4')
-rw-r--r-- | source4/torture/util_smb.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/source4/torture/util_smb.c b/source4/torture/util_smb.c index 9efa33437c..93993fd80f 100644 --- a/source4/torture/util_smb.c +++ b/source4/torture/util_smb.c @@ -815,18 +815,17 @@ static bool wrap_simple_2smb_test(struct torture_context *torture_ctx, { bool (*fn) (struct torture_context *, struct smbcli_state *, struct smbcli_state *); - bool ret; + bool ret = true; - struct smbcli_state *cli1, *cli2; + struct smbcli_state *cli1 = NULL, *cli2 = NULL; - if (!torture_open_connection(&cli1, torture_ctx, 0) || - !torture_open_connection(&cli2, torture_ctx, 1)) - return false; + torture_assert_goto(torture_ctx, torture_open_connection(&cli1, torture_ctx, 0), ret, fail, "Failed to open connection"); + torture_assert_goto(torture_ctx, torture_open_connection(&cli2, torture_ctx, 1), ret, fail, "Failed to open connection"); fn = test->fn; ret = fn(torture_ctx, cli1, cli2); - +fail: talloc_free(cli1); talloc_free(cli2); @@ -866,17 +865,16 @@ static bool wrap_simple_1smb_test(struct torture_context *torture_ctx, struct torture_test *test) { bool (*fn) (struct torture_context *, struct smbcli_state *); - bool ret; + bool ret = true; - struct smbcli_state *cli1; + struct smbcli_state *cli1 = NULL; - if (!torture_open_connection(&cli1, torture_ctx, 0)) - return false; + torture_assert_goto(torture_ctx, torture_open_connection(&cli1, torture_ctx, 0), ret, fail, "Failed to open connection"); fn = test->fn; ret = fn(torture_ctx, cli1); - +fail: talloc_free(cli1); return ret; |