s4-smbtorture: fill in COMPARE_STRING_ARRAY macro in spoolss driver test.
authorGünther Deschner <gd@samba.org>
Tue, 8 Dec 2009 09:21:28 +0000 (10:21 +0100)
committerGünther Deschner <gd@samba.org>
Tue, 8 Dec 2009 09:37:13 +0000 (10:37 +0100)
Guenther

source4/torture/rpc/spoolss.c

index 26083a7a20aa7794a331b5168b4068601ddcfb51..1a2c6ddea4a1ebb5442f2d5ea94cedb0c74e1ec7 100644 (file)
@@ -80,7 +80,21 @@ struct test_spoolss_context {
        torture_assert_int_equal(tctx, c.e, r.e, "invalid value"); \
 } while(0)
 
-#define COMPARE_STRING_ARRAY(tctx, c,r,e)
+#define COMPARE_STRING_ARRAY(tctx, c,r,e) do {\
+       int __i; \
+       if (!c.e && !r.e) { \
+               break; \
+       } \
+       if (c.e && !r.e) { \
+               torture_fail(tctx, #r "." #e " field is NULL and " #c "." #e " is not\n"); \
+       } \
+       if (!c.e && r.e) { \
+               torture_fail(tctx, #c "." #e " field is NULL and " #r "." #e " is not\n"); \
+       } \
+       for (__i=0;c.e[__i] != NULL; __i++) { \
+               torture_assert_str_equal(tctx, c.e[__i], r.e[__i], "invalid value"); \
+       } \
+} while(0)
 
 static bool test_OpenPrinter_server(struct torture_context *tctx,
                                    struct dcerpc_pipe *p,