Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(548)

Unified Diff: tests/unittests/shared/srpc/types_srpc_test.c

Issue 5622003: Restructure the structs/unions involved in SRPC argument passing. This will... (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: '' Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/syscalls_deprecated/srpc_av.c ('k') | tools/srpcgen.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/unittests/shared/srpc/types_srpc_test.c
===================================================================
--- tests/unittests/shared/srpc/types_srpc_test.c (revision 3898)
+++ tests/unittests/shared/srpc/types_srpc_test.c (working copy)
@@ -39,8 +39,8 @@
int i;
UNREFERENCED_PARAMETER(outs);
- for (i = 0; i < (int)ins[0]->u.caval.count; i++) {
- int cur = ins[0]->u.caval.carr[i];
+ for (i = 0; i < (int)ins[0]->u.count; i++) {
+ int cur = ins[0]->arrays.carr[i];
if (TEST_NUM != cur) {
fprintf(stderr,
"Wrong char at pos %d. Expected %d, has %d\n",
@@ -83,7 +83,8 @@
}
int main(int argc, char* argv[]) {
- struct NaClSrpcCharArray char_array;
+ nacl_abi_size_t char_array_count;
+ char* char_array_carr;
NaClHandle pair[2];
#ifdef __native_client__
int imc_desc[2];
@@ -142,17 +143,17 @@
failWithErrno("NaClSrpcClientCtor");
}
- char_array.count = TEST_ARRAY_LENGTH;
- char_array.carr = (char*) calloc(TEST_ARRAY_LENGTH, sizeof(char));
- if (!char_array.carr) {
+ char_array_count = TEST_ARRAY_LENGTH;
+ char_array_carr = (char*) calloc(TEST_ARRAY_LENGTH, sizeof(char));
+ if (!char_array_carr) {
failWithErrno("calloc for char_array");
}
- memset(char_array.carr, TEST_NUM, TEST_ARRAY_LENGTH);
+ memset(char_array_carr, TEST_NUM, TEST_ARRAY_LENGTH);
error = NaClSrpcInvokeBySignature(&channel,
"putArr:C:",
- char_array.count,
- char_array.carr);
+ char_array_count,
+ char_array_carr);
if (NACL_SRPC_RESULT_OK != error) {
fprintf(stderr,
@@ -160,7 +161,7 @@
NaClSrpcErrorString(error));
exit(EXIT_FAILURE);
}
- free(char_array.carr);
+ free(char_array_carr);
NaClSrpcDtor(&channel);
#ifdef __native_client__
« no previous file with comments | « tests/syscalls_deprecated/srpc_av.c ('k') | tools/srpcgen.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698