From 8e4d1463cbba45dcb103f1ed828562caae9a1858 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 27 Mar 2015 10:19:26 +0100 Subject: [PATCH] s4:torture:raw:notify: let NOTIFY_MASK_TEST use torture_assert macros Signed-off-by: Michael Adam Reviewed-by: Guenther Deschner --- source4/torture/raw/notify.c | 64 ++++++++++++++++++++++++-------------------- 1 file changed, 35 insertions(+), 29 deletions(-) diff --git a/source4/torture/raw/notify.c b/source4/torture/raw/notify.c index d745b936831..07813b48b29 100644 --- a/source4/torture/raw/notify.c +++ b/source4/torture/raw/notify.c @@ -756,39 +756,45 @@ static bool test_notify_mask(struct torture_context *tctx, ((expected) & FILE_NOTIFY_CHANGE_ATTRIBUTES) && \ Action == NOTIFY_ACTION_OLD_NAME) { \ printf("(rename file special handling OK)\n"); \ - } else if (nchanges != notify.nttrans.out.num_changes) { \ - printf("ERROR: nchanges=%d expected=%d action=%d filter=0x%08x\n", \ - notify.nttrans.out.num_changes, \ - nchanges, \ - notify.nttrans.out.changes[0].action, \ - notify.nttrans.in.completion_filter); \ - ret = false; \ - } else if (notify.nttrans.out.changes[0].action != Action) { \ - printf("ERROR: nchanges=%d action=%d expectedAction=%d filter=0x%08x\n", \ - notify.nttrans.out.num_changes, \ - notify.nttrans.out.changes[0].action, \ - Action, \ - notify.nttrans.in.completion_filter); \ - ret = false; \ - } else if (strcmp(notify.nttrans.out.changes[0].name.s, "tname1") != 0) { \ - printf("ERROR: nchanges=%d action=%d filter=0x%08x name=%s\n", \ - notify.nttrans.out.num_changes, \ - notify.nttrans.out.changes[0].action, \ - notify.nttrans.in.completion_filter, \ - notify.nttrans.out.changes[0].name.s); \ - ret = false; \ + } else { \ + torture_assert_int_equal_goto(tctx, \ + notify.nttrans.out.num_changes,\ + nchanges, ret, done, \ + talloc_asprintf(tctx, \ + "nchanges=%d expected=%d action=%d " \ + "filter=0x%08x\n", \ + notify.nttrans.out.num_changes, \ + nchanges, \ + notify.nttrans.out.changes[0].action, \ + notify.nttrans.in.completion_filter)); \ + torture_assert_int_equal_goto(tctx, \ + notify.nttrans.out.changes[0].action, \ + Action, ret, done, \ + talloc_asprintf(tctx, \ + "nchanges=%d action=%d " \ + "expectedAction=%d filter=0x%08x\n", \ + notify.nttrans.out.num_changes, \ + notify.nttrans.out.changes[0].action, \ + Action, \ + notify.nttrans.in.completion_filter)); \ + torture_assert_str_equal_goto(tctx, \ + notify.nttrans.out.changes[0].name.s, \ + "tname1", ret, done, \ + talloc_asprintf(tctx, \ + "nchanges=%d action=%d filter=0x%08x " \ + "name=%s expected_name=tname1\n", \ + notify.nttrans.out.num_changes, \ + notify.nttrans.out.changes[0].action, \ + notify.nttrans.in.completion_filter, \ + notify.nttrans.out.changes[0].name.s));\ } \ mask |= (1<