| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2011 The Native Client Authors. All rights reserved. | 2 * Copyright (c) 2011 The Native Client Authors. All rights reserved. |
| 3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
| 4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
| 5 */ | 5 */ |
| 6 | 6 |
| 7 // | 7 // |
| 8 // Post-message based test for simple rpc based access to name services. | 8 // Post-message based test for simple rpc based access to name services. |
| 9 // | 9 // |
| 10 | 10 |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 // and just strip the CR if it is present. | 144 // and just strip the CR if it is present. |
| 145 int len = strlen(buffer); | 145 int len = strlen(buffer); |
| 146 if (len >= 2 && buffer[len-1] == '\n' && buffer[len-2] == '\r') { | 146 if (len >= 2 && buffer[len-1] == '\n' && buffer[len-2] == '\r') { |
| 147 buffer[len-2] = '\n'; | 147 buffer[len-2] = '\n'; |
| 148 buffer[len-1] = '\0'; | 148 buffer[len-1] = '\0'; |
| 149 } | 149 } |
| 150 sb.Printf("%s", buffer); | 150 sb.Printf("%s", buffer); |
| 151 } | 151 } |
| 152 fclose(iob); // closed desc | 152 fclose(iob); // closed desc |
| 153 | 153 |
| 154 sb.Printf("\n"); |
| 154 sb.Printf("Opening non-existent file:\n"); | 155 sb.Printf("Opening non-existent file:\n"); |
| 155 if (NACL_SRPC_RESULT_OK != | 156 if (NACL_SRPC_RESULT_OK != |
| 156 NaClSrpcInvokeBySignature(&manifest_channel, | 157 NaClSrpcInvokeBySignature(&manifest_channel, |
| 157 NACL_NAME_SERVICE_LOOKUP, | 158 NACL_NAME_SERVICE_LOOKUP, |
| 158 "foobar/baz", O_RDONLY, | 159 "foobar/baz", O_RDONLY, |
| 159 &status, &desc)) { | 160 &status, &desc)) { |
| 160 sb.Printf("bogus manifest lookup RPC failed\n"); | 161 sb.Printf("bogus manifest lookup RPC failed\n"); |
| 161 NaClSrpcDtor(&manifest_channel); | 162 NaClSrpcDtor(&manifest_channel); |
| 162 manifest_contents = new std::string(sb.ToString()); | 163 manifest_contents = new std::string(sb.ToString()); |
| 163 return; | 164 return; |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 | 262 |
| 262 namespace pp { | 263 namespace pp { |
| 263 | 264 |
| 264 // Factory function for your specialization of the Module object. | 265 // Factory function for your specialization of the Module object. |
| 265 Module* CreateModule() { | 266 Module* CreateModule() { |
| 266 fprintf(stderr, "CreateModule invoked\n"); fflush(NULL); | 267 fprintf(stderr, "CreateModule invoked\n"); fflush(NULL); |
| 267 return new MyModule(); | 268 return new MyModule(); |
| 268 } | 269 } |
| 269 | 270 |
| 270 } // namespace pp | 271 } // namespace pp |
| OLD | NEW |