From a84bdcd1cb4a8e6c265f2c271d849d343696c0c8 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 21 Sep 2007 10:36:51 +0000 Subject: r25278: add a more extented macro for doing struct based winbind requests metze (This used to be commit ad3ec174088393a9efb265fa7a135fbfd080b6a7) --- source4/torture/winbind/struct_based.c | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) (limited to 'source4') 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) -- cgit