mirror of
https://github.com/samba-team/samba.git
synced 2025-01-03 01:18:10 +03:00
s4:torture/raw: better error handling in streams.c
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15656 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
This commit is contained in:
parent
28fd1ea4a1
commit
3fd40cb8a9
@ -42,23 +42,8 @@
|
|||||||
#define CHECK_NTTIME(v, correct) \
|
#define CHECK_NTTIME(v, correct) \
|
||||||
torture_assert_u64_equal(tctx,v,correct,"CHECK_NTTIME")
|
torture_assert_u64_equal(tctx,v,correct,"CHECK_NTTIME")
|
||||||
|
|
||||||
#define CHECK_STR(v, correct) do { \
|
#define CHECK_STR(v, correct) \
|
||||||
bool ok; \
|
torture_assert_str_equal(tctx,v,correct,"CHECK_STR")
|
||||||
if ((v) && !(correct)) { \
|
|
||||||
ok = false; \
|
|
||||||
} else if (!(v) && (correct)) { \
|
|
||||||
ok = false; \
|
|
||||||
} else if (!(v) && !(correct)) { \
|
|
||||||
ok = true; \
|
|
||||||
} else if (strcmp((v), (correct)) == 0) { \
|
|
||||||
ok = true; \
|
|
||||||
} else { \
|
|
||||||
ok = false; \
|
|
||||||
} \
|
|
||||||
torture_assert(tctx,ok,\
|
|
||||||
talloc_asprintf(tctx, "got '%s', expected '%s'",\
|
|
||||||
(v)?(v):"NULL", (correct)?(correct):"NULL")); \
|
|
||||||
} while (0)
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
check that a stream has the right contents
|
check that a stream has the right contents
|
||||||
@ -1092,18 +1077,12 @@ done:
|
|||||||
sfinfo.generic.level = RAW_SFILEINFO_ ## call; \
|
sfinfo.generic.level = RAW_SFILEINFO_ ## call; \
|
||||||
sfinfo.generic.in.file.fnum = fnum; \
|
sfinfo.generic.in.file.fnum = fnum; \
|
||||||
status = smb_raw_setfileinfo(cli->tree, &sfinfo); \
|
status = smb_raw_setfileinfo(cli->tree, &sfinfo); \
|
||||||
if (!NT_STATUS_EQUAL(status, rightstatus)) { \
|
torture_assert_ntstatus_equal_goto(tctx, status, rightstatus, ret, done, #call); \
|
||||||
printf("(%s) %s - %s (should be %s)\n", __location__, #call, \
|
|
||||||
nt_errstr(status), nt_errstr(rightstatus)); \
|
|
||||||
ret = false; \
|
|
||||||
} \
|
|
||||||
finfo1.generic.level = RAW_FILEINFO_ALL_INFO; \
|
finfo1.generic.level = RAW_FILEINFO_ALL_INFO; \
|
||||||
finfo1.generic.in.file.fnum = fnum; \
|
finfo1.generic.in.file.fnum = fnum; \
|
||||||
status2 = smb_raw_fileinfo(cli->tree, tctx, &finfo1); \
|
status2 = smb_raw_fileinfo(cli->tree, tctx, &finfo1); \
|
||||||
if (!NT_STATUS_IS_OK(status2)) { \
|
torture_assert_ntstatus_ok_goto(tctx, status2, ret, done, "ALL_INFO"); \
|
||||||
printf("(%s) %s pathinfo - %s\n", __location__, #call, nt_errstr(status)); \
|
} while (0)
|
||||||
ret = false; \
|
|
||||||
}} while (0)
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
test stream renames
|
test stream renames
|
||||||
|
Loading…
Reference in New Issue
Block a user