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

Side by Side Diff: tests/syscalls_deprecated/srpc_av.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/srpc_hw/srpc_hw.c ('k') | tests/unittests/shared/srpc/types_srpc_test.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2010 The Native Client Authors. All rights reserved. 2 * Copyright 2010 The Native Client Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can 3 * Use of this source code is governed by a BSD-style license that can
4 * be found in the LICENSE file. 4 * be found in the LICENSE file.
5 */ 5 */
6 6
7 /* 7 /*
8 * Test deprecated AV syscalls and verify that they fail in Chrome. 8 * Test deprecated AV syscalls and verify that they fail in Chrome.
9 * These tests intentionally invoke at the syscall level. 9 * These tests intentionally invoke at the syscall level.
10 */ 10 */
(...skipping 15 matching lines...) Expand all
26 #define kSampleCount 4096 26 #define kSampleCount 4096
27 #define kMessageSize 256 27 #define kMessageSize 256
28 28
29 uint32_t pixels[kWidth * kHeight]; 29 uint32_t pixels[kWidth * kHeight];
30 uint16_t samples[kSampleCount]; 30 uint16_t samples[kSampleCount];
31 31
32 NaClSrpcError ErrorMsg(NaClSrpcArg **out_args, const char *func, int retval) { 32 NaClSrpcError ErrorMsg(NaClSrpcArg **out_args, const char *func, int retval) {
33 char message[kMessageSize]; 33 char message[kMessageSize];
34 snprintf(message, kMessageSize, "Function %s returned %d\n", func, retval); 34 snprintf(message, kMessageSize, "Function %s returned %d\n", func, retval);
35 /* SRPC will free string, so use strndup to make a copy */ 35 /* SRPC will free string, so use strndup to make a copy */
36 out_args[0]->u.sval.str = strndup(message, kMessageSize); 36 out_args[0]->arrays.str = strndup(message, kMessageSize);
37 return NACL_SRPC_RESULT_OK; 37 return NACL_SRPC_RESULT_OK;
38 } 38 }
39 39
40 /* 40 /*
41 * Return a string. 41 * Return a string.
42 * "SUCCESS" - all tests passed 42 * "SUCCESS" - all tests passed
43 * !"SUCCESS" - string contains name and return value of failed test. 43 * !"SUCCESS" - string contains name and return value of failed test.
44 * 44 *
45 * AVTest will test deprecated multimedia syscalls (50..58) 45 * AVTest will test deprecated multimedia syscalls (50..58)
46 * These deprecated syscalls are expected to return -ENOSYS when nexe is 46 * These deprecated syscalls are expected to return -ENOSYS when nexe is
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 return; 174 return;
175 } 175 }
176 176
177 ret = NACL_SYSCALL(audio_stream)(samples, &count); 177 ret = NACL_SYSCALL(audio_stream)(samples, &count);
178 if (-ENOSYS != ret) { 178 if (-ENOSYS != ret) {
179 rpc->result = ErrorMsg(out_args, "audio_stream(samples, &count)", ret); 179 rpc->result = ErrorMsg(out_args, "audio_stream(samples, &count)", ret);
180 done->Run(done); 180 done->Run(done);
181 return; 181 return;
182 } 182 }
183 183
184 out_args[0]->u.sval.str = strdup("SUCCESS"); 184 out_args[0]->arrays.str = strdup("SUCCESS");
185 rpc->result = NACL_SRPC_RESULT_OK; 185 rpc->result = NACL_SRPC_RESULT_OK;
186 done->Run(done); 186 done->Run(done);
187 } 187 }
188 188
189 const struct NaClSrpcHandlerDesc srpc_methods[] = { 189 const struct NaClSrpcHandlerDesc srpc_methods[] = {
190 { "avtest::s", AVTest }, 190 { "avtest::s", AVTest },
191 { NULL, NULL }, 191 { NULL, NULL },
192 }; 192 };
193 193
194 int main() { 194 int main() {
195 if (!NaClSrpcModuleInit()) { 195 if (!NaClSrpcModuleInit()) {
196 return 1; 196 return 1;
197 } 197 }
198 if (!NaClSrpcAcceptClientConnection(srpc_methods)) { 198 if (!NaClSrpcAcceptClientConnection(srpc_methods)) {
199 return 1; 199 return 1;
200 } 200 }
201 NaClSrpcModuleFini(); 201 NaClSrpcModuleFini();
202 return 0; 202 return 0;
203 } 203 }
OLDNEW
« no previous file with comments | « tests/srpc_hw/srpc_hw.c ('k') | tests/unittests/shared/srpc/types_srpc_test.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698