r6541: added double pointer test to win32 echo client
authorAndrew Tridgell <tridge@samba.org>
Sun, 1 May 2005 06:55:39 +0000 (06:55 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:16:24 +0000 (13:16 -0500)
(This used to be commit cb4e07744d87970719c69f8553900efa507589ce)

testprogs/win32/rpcecho/client.c
testprogs/win32/rpcecho/server.c

index 1724f482c388c15350609183e158f57d88b629fb..9d06f8e3116a0283990b2491f67f2dd5c2956550 100644 (file)
@@ -301,6 +301,23 @@ void main(int argc, char **argv)
                        continue;
                }
 
                        continue;
                }
 
+               if (strcmp(argv[0], "double") == 0) {
+                       typedef unsigned short uint16;
+                       uint16 v = 13;
+                       uint16 *pv = &v;
+                       uint16 **ppv = &pv;
+                       uint16 ret;
+
+                       argc -= 1;
+                       argv += 1;
+
+                       ret = echo_TestDoublePointer(&ppv);
+
+                       printf("TestDoublePointer v=%d ret=%d\n", v, ret);
+                       
+                       continue;
+               }
+
                if (strcmp(argv[0], "sleep") == 0) {
                        long arg, result;
 
                if (strcmp(argv[0], "sleep") == 0) {
                        long arg, result;
 
index 17b13f0013d743fa6ebd3f1485373a0b9ba04719..b5127596dfc906be54eeeb9bad481af653b99d1f 100644 (file)
@@ -142,9 +142,11 @@ void echo_TestSurrounding(echo_Surrounding *data)
 short echo_TestDoublePointer(short ***data)
 {
        if (!*data) {
 short echo_TestDoublePointer(short ***data)
 {
        if (!*data) {
+               printf("WARNING: *data == NULL\n");
                return 0;
        }
        if (!**data) {
                return 0;
        }
        if (!**data) {
+               printf("WARNING: **data == NULL\n");
                return 0;
        }
        printf("Incoming double pointer: %d\n", ***data);
                return 0;
        }
        printf("Incoming double pointer: %d\n", ***data);