mirror of
https://github.com/samba-team/samba.git
synced 2025-02-08 05:57:51 +03:00
s4:torture:raw:notify: make check_rename_reply() properly use torture_result
Only change currently: the CHECK_WSTR calls report the line number of this function now instead of the handed in line of the callers. This could be fixed by turning this function into a macro... Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
This commit is contained in:
parent
d9e01f1d77
commit
17ce9f428c
@ -333,7 +333,8 @@ done:
|
|||||||
* pair in any of the three following notify_changes.
|
* pair in any of the three following notify_changes.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static bool check_rename_reply(struct smbcli_state *cli,
|
static bool check_rename_reply(struct torture_context *tctx,
|
||||||
|
struct smbcli_state *cli,
|
||||||
int line,
|
int line,
|
||||||
struct notify_changes *actions,
|
struct notify_changes *actions,
|
||||||
uint32_t action, const char *name)
|
uint32_t action, const char *name)
|
||||||
@ -342,19 +343,14 @@ static bool check_rename_reply(struct smbcli_state *cli,
|
|||||||
|
|
||||||
for (i=0; i<3; i++) {
|
for (i=0; i<3; i++) {
|
||||||
if (actions[i].action == action) {
|
if (actions[i].action == action) {
|
||||||
if ((actions[i].name.s == NULL)
|
CHECK_WSTR(tctx, actions[i].name, name, STR_UNICODE);
|
||||||
|| (strcmp(actions[i].name.s, name) != 0)
|
|
||||||
|| (wire_bad_flags(&actions[i].name, STR_UNICODE,
|
|
||||||
cli->transport))) {
|
|
||||||
printf("(%d) name [%s] != %s\n", line,
|
|
||||||
actions[i].name.s, name);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("(%d) expected action %d, not found\n", line, action);
|
torture_result(tctx, TORTURE_FAIL,
|
||||||
|
__location__": (%d) expected action %d, not found\n",
|
||||||
|
line, action);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -490,23 +486,23 @@ static bool test_notify_recursive(struct torture_context *mem_ctx,
|
|||||||
CHECK_WSTR(mem_ctx, notify.nttrans.out.changes[4].name,
|
CHECK_WSTR(mem_ctx, notify.nttrans.out.changes[4].name,
|
||||||
"subdir-name\\subname1-r", STR_UNICODE);
|
"subdir-name\\subname1-r", STR_UNICODE);
|
||||||
|
|
||||||
ret &= check_rename_reply(
|
ret &= check_rename_reply(mem_ctx,
|
||||||
cli, __LINE__, ¬ify.nttrans.out.changes[5],
|
cli, __LINE__, ¬ify.nttrans.out.changes[5],
|
||||||
NOTIFY_ACTION_ADDED, "subname2-r");
|
NOTIFY_ACTION_ADDED, "subname2-r");
|
||||||
ret &= check_rename_reply(
|
ret &= check_rename_reply(mem_ctx,
|
||||||
cli, __LINE__, ¬ify.nttrans.out.changes[5],
|
cli, __LINE__, ¬ify.nttrans.out.changes[5],
|
||||||
NOTIFY_ACTION_REMOVED, "subdir-name\\subname2");
|
NOTIFY_ACTION_REMOVED, "subdir-name\\subname2");
|
||||||
ret &= check_rename_reply(
|
ret &= check_rename_reply(mem_ctx,
|
||||||
cli, __LINE__, ¬ify.nttrans.out.changes[5],
|
cli, __LINE__, ¬ify.nttrans.out.changes[5],
|
||||||
NOTIFY_ACTION_MODIFIED, "subname2-r");
|
NOTIFY_ACTION_MODIFIED, "subname2-r");
|
||||||
|
|
||||||
ret &= check_rename_reply(
|
ret &= check_rename_reply(mem_ctx,
|
||||||
cli, __LINE__, ¬ify.nttrans.out.changes[8],
|
cli, __LINE__, ¬ify.nttrans.out.changes[8],
|
||||||
NOTIFY_ACTION_OLD_NAME, "subname2-r");
|
NOTIFY_ACTION_OLD_NAME, "subname2-r");
|
||||||
ret &= check_rename_reply(
|
ret &= check_rename_reply(mem_ctx,
|
||||||
cli, __LINE__, ¬ify.nttrans.out.changes[8],
|
cli, __LINE__, ¬ify.nttrans.out.changes[8],
|
||||||
NOTIFY_ACTION_NEW_NAME, "subname3-r");
|
NOTIFY_ACTION_NEW_NAME, "subname3-r");
|
||||||
ret &= check_rename_reply(
|
ret &= check_rename_reply(mem_ctx,
|
||||||
cli, __LINE__, ¬ify.nttrans.out.changes[8],
|
cli, __LINE__, ¬ify.nttrans.out.changes[8],
|
||||||
NOTIFY_ACTION_MODIFIED, "subname3-r");
|
NOTIFY_ACTION_MODIFIED, "subname3-r");
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user