diff options
author | Rikard Falkeborn <rikard.falkeborn@gmail.com> | 2019-05-16 21:43:46 +0200 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2019-05-19 18:48:01 +0000 |
commit | 594676c8b8f9138c013871a5da01fca67e1aa282 (patch) | |
tree | addb0d19990213247503793b1dbeab57680d3f32 /source3/torture | |
parent | 730037504d2c29e43a075d22b17f761f1d2e837a (diff) | |
download | samba-594676c8b8f9138c013871a5da01fca67e1aa282.tar.gz |
s3: torture: Fix return values
Torture tests should return true on success and false on failure.
Returning -1 is the same as returning true and returning 0 is the same
as returning false. Change the return values to true and false to fix
the return values.
Detected by the help of cppcheck.
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Reviewed-by: Ralph Böhme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sun May 19 18:48:01 UTC 2019 on sn-devel-184
Diffstat (limited to 'source3/torture')
-rw-r--r-- | source3/torture/test_addrchange.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source3/torture/test_addrchange.c b/source3/torture/test_addrchange.c index daf0488aa18..9ccca1c6c51 100644 --- a/source3/torture/test_addrchange.c +++ b/source3/torture/test_addrchange.c @@ -34,7 +34,7 @@ bool run_addrchange(int dummy) ev = samba_tevent_context_init(talloc_tos()); if (ev == NULL) { d_fprintf(stderr, "tevent_context_init failed\n"); - return -1; + return false; } status = addrchange_context_create(talloc_tos(), &ctx); @@ -54,14 +54,14 @@ bool run_addrchange(int dummy) req = addrchange_send(talloc_tos(), ev, ctx); if (req == NULL) { d_fprintf(stderr, "addrchange_send failed\n"); - return -1; + return false; } if (!tevent_req_poll_ntstatus(req, ev, &status)) { d_fprintf(stderr, "tevent_req_poll_ntstatus failed: " "%s\n", nt_errstr(status)); TALLOC_FREE(req); - return -1; + return false; } status = addrchange_recv(req, &type, &addr); @@ -69,7 +69,7 @@ bool run_addrchange(int dummy) if (!NT_STATUS_IS_OK(status)) { d_fprintf(stderr, "addrchange_recv failed: %s\n", nt_errstr(status)); - return -1; + return false; } switch(type) { @@ -90,5 +90,5 @@ bool run_addrchange(int dummy) } TALLOC_FREE(ctx); TALLOC_FREE(ev); - return 0; + return true; } |