rpcrt4: Add tests for a complex array of pointers.

This commit is contained in:
Rob Shearman 2010-03-19 14:50:15 +00:00 committed by Alexandre Julliard
parent 3ae8d5888a
commit f6c4c49f86
2 changed files with 22 additions and 0 deletions

View File

@ -282,6 +282,15 @@ s_sum_var_array(int x[20], int n)
return s_sum_conf_array(x, n); return s_sum_conf_array(x, 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 int
s_dot_two_vectors(vector_t vs[2]) s_dot_two_vectors(vector_t vs[2])
{ {
@ -1213,6 +1222,7 @@ array_tests(void)
int *pi; int *pi;
pints_t api[5]; pints_t api[5];
numbers_struct_t *ns; numbers_struct_t *ns;
refpint_t rpi[5];
if (!old_windows_version) if (!old_windows_version)
{ {
@ -1317,6 +1327,15 @@ array_tests(void)
HeapFree(GetProcessHeap(), 0, ns); HeapFree(GetProcessHeap(), 0, ns);
} }
HeapFree(GetProcessHeap(), 0, pi); 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 void

View File

@ -120,6 +120,8 @@ cpp_quote("#endif")
} u; } u;
} test_list_t; } test_list_t;
typedef [ref] int *refpint_t;
int test_list_length(test_list_t *ls); int test_list_length(test_list_t *ls);
int sum_fixed_int_3d(int m[2][3][4]); int sum_fixed_int_3d(int m[2][3][4]);
int sum_conf_array([size_is(n)] int x[], int n); 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_cs(cs_t *cs);
int sum_cps(cps_t *cps); int sum_cps(cps_t *cps);
int sum_cpsc(cpsc_t *cpsc); int sum_cpsc(cpsc_t *cpsc);
int sum_complex_array(int n, refpint_t pi[n]);
typedef [wire_marshal(int)] void *puint_t; typedef [wire_marshal(int)] void *puint_t;
int square_puint(puint_t p); int square_puint(puint_t p);