s4:torture:raw:notify: use torture_assert instead of printf in failure case
authorMichael Adam <obnox@samba.org>
Thu, 26 Mar 2015 18:41:06 +0000 (19:41 +0100)
committerGünther Deschner <gd@samba.org>
Mon, 30 Mar 2015 11:41:26 +0000 (13:41 +0200)
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
source4/torture/raw/notify.c

index 023ce5c8e1b94988bb16eab87d50a8d3e30f9d18..d060538402872e3d91b0d49333ad7a22f256acb2 100644 (file)
@@ -177,12 +177,9 @@ static bool test_notify_dir(struct torture_context *mem_ctx,
        for (i=0;i<count;i++) {
                char *fname = talloc_asprintf(cli, BASEDIR "\\test%d.txt", i);
                int fnum3 = smbcli_open(cli->tree, fname, O_CREAT|O_RDWR, DENY_NONE);
-               if (fnum3 == -1) {
-                       printf("Failed to create %s - %s\n", 
-                              fname, smbcli_errstr(cli->tree));
-                       ret = false;
-                       goto done;
-               }
+               torture_assert_int_not_equal_goto(mem_ctx, fnum3, -1, ret, done,
+                       talloc_asprintf(mem_ctx, "Failed to create %s - %s",
+                                       fname, smbcli_errstr(cli->tree)));
                talloc_free(fname);
                smbcli_close(cli->tree, fnum3);
        }
@@ -1571,12 +1568,9 @@ static bool test_notify_overflow(struct torture_context *mem_ctx,
                char *fname = talloc_asprintf(cli, BASEDIR "\\test%d.txt", i);
                int fnum2 = smbcli_open(cli->tree, fname, O_CREAT|O_RDWR,
                                        DENY_NONE);
-               if (fnum2 == -1) {
-                       printf("Failed to create %s - %s\n",
-                              fname, smbcli_errstr(cli->tree));
-                       ret = false;
-                       goto done;
-               }
+               torture_assert_int_not_equal_goto(mem_ctx, fnum2, -1, ret, done,
+                       talloc_asprintf(mem_ctx, "Failed to create %s - %s",
+                                       fname, smbcli_errstr(cli->tree)));
                talloc_free(fname);
                smbcli_close(cli->tree, fnum2);
        }