s4:torture:raw:notify: use torture_assert instead of printf in test_notify_tree
authorMichael Adam <obnox@samba.org>
Fri, 27 Mar 2015 09:25:17 +0000 (10:25 +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 07813b48b29763c66763b0adc9d060d433cf4b01..02956ce4be25fb8a971784a1fbb228e913e2d4bb 100644 (file)
@@ -1487,11 +1487,11 @@ static bool test_notify_tree(struct torture_context *mem_ctx,
        printf("took %.4f seconds to propogate all events\n", timeval_elapsed(&tv));
 
        for (i=0;i<ARRAY_SIZE(dirs);i++) {
        printf("took %.4f seconds to propogate all events\n", timeval_elapsed(&tv));
 
        for (i=0;i<ARRAY_SIZE(dirs);i++) {
-               if (dirs[i].counted != dirs[i].expected) {
-                       printf("ERROR: i=%d expected %d got %d for '%s'\n",
-                              i, dirs[i].expected, dirs[i].counted, dirs[i].path);
-                       ret = false;
-               }
+               torture_assert_int_equal_goto(mem_ctx,
+                       dirs[i].counted, dirs[i].expected, ret, done,
+                       talloc_asprintf(mem_ctx,
+                                       "unexpected number of events for '%s'",
+                                       dirs[i].path));
        }
 
        /*
        }
 
        /*