Commit f6c4c49f authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

rpcrt4: Add tests for a complex array of pointers.

parent 3ae8d588
......@@ -283,6 +283,15 @@ s_sum_var_array(int x[20], int n)
}
int
s_sum_complex_array(int n, refpint_t pi[])
{
int total = 0;
for (; n > 0; n--)
total += *pi[n - 1];
return total;
}
int
s_dot_two_vectors(vector_t vs[2])
{
return vs[0].x * vs[1].x + vs[0].y * vs[1].y + vs[0].z * vs[1].z;
......@@ -1213,6 +1222,7 @@ array_tests(void)
int *pi;
pints_t api[5];
numbers_struct_t *ns;
refpint_t rpi[5];
if (!old_windows_version)
{
......@@ -1317,6 +1327,15 @@ array_tests(void)
HeapFree(GetProcessHeap(), 0, ns);
}
HeapFree(GetProcessHeap(), 0, pi);
pi = HeapAlloc(GetProcessHeap(), 0, 5 * sizeof(*pi));
pi[0] = 3; rpi[0] = &pi[0];
pi[1] = 5; rpi[1] = &pi[1];
pi[2] = -2; rpi[2] = &pi[2];
pi[3] = -1; rpi[3] = &pi[3];
pi[4] = -4; rpi[4] = &pi[4];
ok(sum_complex_array(5, rpi) == 1, "RPC sum_complex_array\n");
HeapFree(GetProcessHeap(), 0, pi);
}
void
......
......@@ -120,6 +120,8 @@ cpp_quote("#endif")
} u;
} test_list_t;
typedef [ref] int *refpint_t;
int test_list_length(test_list_t *ls);
int sum_fixed_int_3d(int m[2][3][4]);
int sum_conf_array([size_is(n)] int x[], int n);
......@@ -154,6 +156,7 @@ cpp_quote("#endif")
int sum_cs(cs_t *cs);
int sum_cps(cps_t *cps);
int sum_cpsc(cpsc_t *cpsc);
int sum_complex_array(int n, refpint_t pi[n]);
typedef [wire_marshal(int)] void *puint_t;
int square_puint(puint_t p);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment