summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorKamen Mazdrashki <kamen.mazdrashki@postpath.com>2009-09-18 18:11:56 +0300
committerAnatoliy Atanasov <anatoliy.atanasov@postpath.com>2009-10-01 11:29:22 +0300
commitb49249864a0d8d087c9bf5e1661824a7e8d96324 (patch)
tree5084da90cf5270b90353b3e62c7e960f3ec4e960 /source4
parent087ba21b41f8a857d239d8842b6bcdf355ad61c8 (diff)
downloadsamba-b49249864a0d8d087c9bf5e1661824a7e8d96324.tar.gz
samba-b49249864a0d8d087c9bf5e1661824a7e8d96324.tar.bz2
samba-b49249864a0d8d087c9bf5e1661824a7e8d96324.zip
s4-tort: Added assertion macro for DRSUAPI call
Signed-off-by: Anatoliy Atanasov <anatoliy.atanasov@postpath.com>
Diffstat (limited to 'source4')
-rw-r--r--source4/torture/rpc/drsuapi.h19
1 files changed, 16 insertions, 3 deletions
diff --git a/source4/torture/rpc/drsuapi.h b/source4/torture/rpc/drsuapi.h
index d32a35ee2c..8901767549 100644
--- a/source4/torture/rpc/drsuapi.h
+++ b/source4/torture/rpc/drsuapi.h
@@ -45,10 +45,11 @@ struct DsPrivate {
* \param _tctx torture context
* \param _p DCERPC pipe handle
* \param _ntstatus NTSTATUS for dcerpc_drsuapi_ call
- * \param _pr in/out DCEPRC request structure
+ * \param _werr_expected Expected windows error to be returned
+ * \param _pr in/out DCEPRC request structure - pointer
* \param _msg error message prefix
*/
-#define torture_drsuapi_assert_call(_tctx, _p, _ntstat, _pr, _msg) \
+#define torture_drsuapi_assert_call_werr(_tctx, _p, _ntstat, _werr_expected, _pr, _msg) \
do { \
NTSTATUS __nt = _ntstat; \
if (!NT_STATUS_IS_OK(__nt)) { \
@@ -58,6 +59,18 @@ struct DsPrivate {
} \
torture_fail(tctx, talloc_asprintf(_tctx, "%s failed - %s", _msg, errstr)); \
} \
- torture_assert_werr_ok(_tctx, (_pr)->out.result, _msg); \
+ torture_assert_werr_equal(_tctx, (_pr)->out.result, _werr_expected, _msg); \
} while(0)
+/**
+ * Custom torture macro to check dcerpc_drsuapi_ call
+ * return values printing more friendly messages
+ * \param _tctx torture context
+ * \param _p DCERPC pipe handle
+ * \param _ntstatus NTSTATUS for dcerpc_drsuapi_ call
+ * \param _pr in/out DCEPRC request structure
+ * \param _msg error message prefix
+ */
+#define torture_drsuapi_assert_call(_tctx, _p, _ntstat, _pr, _msg) \
+ torture_drsuapi_assert_call_werr(_tctx, _p, _ntstat, WERR_OK, _pr, _msg)
+