Rob Shearman : rpcrt4: Add tests for full pointers.

Alexandre Julliard julliard at winehq.org
Wed Nov 18 09:40:44 CST 2009


Module: wine
Branch: master
Commit: af271255f5ef44565d40d619d2ddd18b2e5d25c1
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=af271255f5ef44565d40d619d2ddd18b2e5d25c1

Author: Rob Shearman <robertshearman at gmail.com>
Date:   Wed Nov 18 00:25:53 2009 +0000

rpcrt4: Add tests for full pointers.

---

 dlls/rpcrt4/tests/server.c   |   19 +++++++++++++++++++
 dlls/rpcrt4/tests/server.idl |    4 ++++
 2 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/dlls/rpcrt4/tests/server.c b/dlls/rpcrt4/tests/server.c
index 1205ea4..6453f53 100644
--- a/dlls/rpcrt4/tests/server.c
+++ b/dlls/rpcrt4/tests/server.c
@@ -717,6 +717,21 @@ s_get_numbers_struct(numbers_struct_t **ns)
 }
 
 void
+s_full_pointer_test(int *a, int *b)
+{
+    ok(*a == 42, "Expected *a to be 42 instead of %d\n", *a);
+    ok(*b == 42, "Expected *b to be 42 instead of %d\n", *a);
+    ok(a == b, "Expected a (%p) to point to the same memory as b (%p)\n", a, b);
+}
+
+void
+s_full_pointer_null_test(int *a, int *b)
+{
+    ok(*a == 42, "Expected *a to be 42 instead of %d\n", *a);
+    ok(b == NULL, "Expected b to be NULL instead of %p\n", b);
+}
+
+void
 s_stop(void)
 {
   ok(RPC_S_OK == RpcMgmtStopServerListening(NULL), "RpcMgmtStopServerListening\n");
@@ -1077,6 +1092,7 @@ pointer_tests(void)
   void *buffer;
   int *pa2;
   s123_t *s123;
+  int val = 42;
 
   ok(test_list_length(list) == 3, "RPC test_list_length\n");
   ok(square_puint(p1) == 121, "RPC square_puint\n");
@@ -1137,6 +1153,9 @@ pointer_tests(void)
   s123 = get_s123();
   ok(s123->f1 == 1 && s123->f2 == 2 && s123->f3 == 3, "RPC get_s123\n");
   MIDL_user_free(s123);
+
+  full_pointer_test(&val, &val);
+  full_pointer_null_test(&val, NULL);
 }
 
 static int
diff --git a/dlls/rpcrt4/tests/server.idl b/dlls/rpcrt4/tests/server.idl
index d8e79bd..ee03c0b 100644
--- a/dlls/rpcrt4/tests/server.idl
+++ b/dlls/rpcrt4/tests/server.idl
@@ -357,5 +357,9 @@ cpp_quote("#endif")
   void get_ranged_enum([out] renum_t *re);
 
   void context_handle_test(void);
+
+  void full_pointer_test([in, ptr] int *a, [in, ptr] int *b);
+  void full_pointer_null_test([in, ptr] int *a, [in, ptr] int *b);
+
   void stop(void);
 }




More information about the wine-cvs mailing list