Zebediah Figura : rpcrt4/tests: Add some tests for nesting arrays and pointers.

Alexandre Julliard julliard at winehq.org
Tue Oct 9 16:22:47 CDT 2018


Module: wine
Branch: master
Commit: 935eed8e980a62557b19b3313e32106752b4e4f6
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=935eed8e980a62557b19b3313e32106752b4e4f6

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Fri Oct  5 16:57:52 2018 -0500

rpcrt4/tests: Add some tests for nesting arrays and pointers.

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/rpcrt4/tests/server.c   | 14 ++++++++++++++
 dlls/rpcrt4/tests/server.idl |  3 +++
 2 files changed, 17 insertions(+)

diff --git a/dlls/rpcrt4/tests/server.c b/dlls/rpcrt4/tests/server.c
index b35b71b..1494904 100644
--- a/dlls/rpcrt4/tests/server.c
+++ b/dlls/rpcrt4/tests/server.c
@@ -861,6 +861,16 @@ void __cdecl s_ip_test(ipu_t *a)
     ok(hr == S_OK, "got %#x\n", hr);
 }
 
+int __cdecl s_sum_ptr_array(int *a[2])
+{
+    return *a[0] + *a[1];
+}
+
+int __cdecl s_sum_array_ptr(int (*a)[2])
+{
+    return (*a)[0] + (*a)[1];
+}
+
 static void
 make_cmdline(char buffer[MAX_PATH], const char *test)
 {
@@ -1388,6 +1398,7 @@ array_tests(void)
   pints_t api[5];
   numbers_struct_t *ns;
   refpint_t rpi[5];
+  int i0 = 1, i1 = 2, *ptr_array[2] = {&i0, &i1}, array[2] = {3, 4};
 
   if (!old_windows_version)
   {
@@ -1518,6 +1529,9 @@ array_tests(void)
   pi[4] = -4; rpi[4] = &pi[4];
   ok(sum_complex_array(5, rpi) == 1, "RPC sum_complex_array\n");
   HeapFree(GetProcessHeap(), 0, pi);
+
+  ok(sum_ptr_array(ptr_array) == 3, "RPC sum_ptr_array\n");
+  ok(sum_array_ptr(&array) == 7, "RPC sum_array_ptr\n");
 }
 
 void __cdecl s_authinfo_test(unsigned int protseq, int secure)
diff --git a/dlls/rpcrt4/tests/server.idl b/dlls/rpcrt4/tests/server.idl
index 6aa7382..7d89445 100644
--- a/dlls/rpcrt4/tests/server.idl
+++ b/dlls/rpcrt4/tests/server.idl
@@ -393,4 +393,7 @@ cpp_quote("#endif")
   } ipu_t;
 
   void ip_test([in] ipu_t *a);
+
+  int sum_ptr_array([in] int *a[2]);
+  int sum_array_ptr([in] int (*a)[2]);
 }




More information about the wine-cvs mailing list