summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2007-09-21 10:36:51 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 15:07:04 -0500
commita84bdcd1cb4a8e6c265f2c271d849d343696c0c8 (patch)
treefc84411a4221683b9844ac48a83b0aa3cd8bce46
parentba7f46418e939c5eeaca3e8b4f66d342df77c8a0 (diff)
downloadsamba-a84bdcd1cb4a8e6c265f2c271d849d343696c0c8.tar.gz
samba-a84bdcd1cb4a8e6c265f2c271d849d343696c0c8.tar.bz2
samba-a84bdcd1cb4a8e6c265f2c271d849d343696c0c8.zip
r25278: add a more extented macro for doing struct based winbind requests
metze (This used to be commit ad3ec174088393a9efb265fa7a135fbfd080b6a7)
-rw-r--r--source4/torture/winbind/struct_based.c31
1 files changed, 27 insertions, 4 deletions
diff --git a/source4/torture/winbind/struct_based.c b/source4/torture/winbind/struct_based.c
index b6686e8a04..33ed0c79de 100644
--- a/source4/torture/winbind/struct_based.c
+++ b/source4/torture/winbind/struct_based.c
@@ -25,11 +25,34 @@
#include "libcli/security/security.h"
#include "param/param.h"
+#define DO_STRUCT_REQ_REP_EXT(op,req,rep,expected,strict,warnaction,cmt) do { \
+ NSS_STATUS __got, __expected = (expected); \
+ __got = winbindd_request_response(op, req, rep); \
+ if (__got != __expected) { \
+ const char *__cmt = (cmt); \
+ if (strict) { \
+ torture_result(torture, TORTURE_FAIL, \
+ __location__ ": " __STRING(op) \
+ " returned %d, expected %d%s%s", \
+ __got, __expected, \
+ (__cmt) ? ": " : "", \
+ (__cmt) ? (__cmt) : ""); \
+ return false; \
+ } else { \
+ torture_warning(torture, \
+ __location__ ": " __STRING(op) \
+ " returned %d, expected %d%s%s", \
+ __got, __expected, \
+ (__cmt) ? ": " : "", \
+ (__cmt) ? (__cmt) : ""); \
+ warnaction; \
+ } \
+ } \
+} while(0)
+
#define DO_STRUCT_REQ_REP(op,req,rep) do { \
- NSS_STATUS _result; \
- _result = winbindd_request_response(op, req, rep); \
- torture_assert_int_equal(torture, _result, NSS_STATUS_SUCCESS, \
- __STRING(op) "(struct based)"); \
+ bool __noop = false; \
+ DO_STRUCT_REQ_REP_EXT(op,req,rep,NSS_STATUS_SUCCESS,true,__noop=true,NULL); \
} while (0)
static bool torture_winbind_struct_ping(struct torture_context *torture)