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

Side by Side Diff: src/trusted/plugin/string_encoding_test.cc

Issue 2981011: Move plugin/srpc contents to the more appropriately named plugin/common.... (Closed) Base URL: http://nativeclient.googlecode.com/svn/trunk/src/native_client/
Patch Set: '' Created 10 years, 5 months 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 | « src/trusted/plugin/string_encoding.cc ('k') | src/trusted/plugin/utility.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:mergeinfo
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 #include <string.h> 7 #include <string.h>
8 8
9 #include "native_client/src/shared/platform/nacl_check.h" 9 #include "native_client/src/shared/platform/nacl_check.h"
10 #include "native_client/src/trusted/plugin/srpc/string_encoding.h" 10 #include "native_client/src/trusted/plugin/string_encoding.h"
11 11
12 12
13 int main() { 13 int main() {
14 const char* input; 14 const char* input;
15 char* output; 15 char* output;
16 size_t output_size; 16 size_t output_size;
17 17
18 // Valid input. 18 // Valid input.
19 19
20 input = "Hello world, \x80 and \xff"; 20 input = "Hello world, \x80 and \xff";
(...skipping 25 matching lines...) Expand all
46 CHECK(!plugin::ByteStringFromUTF8(input, strlen(input), 46 CHECK(!plugin::ByteStringFromUTF8(input, strlen(input),
47 &output, &output_size)); 47 &output, &output_size));
48 // Over long encoding 48 // Over long encoding
49 // This is a non-canonical encoding for \x00 49 // This is a non-canonical encoding for \x00
50 input = "\xc0\x80"; 50 input = "\xc0\x80";
51 CHECK(!plugin::ByteStringFromUTF8(input, strlen(input), 51 CHECK(!plugin::ByteStringFromUTF8(input, strlen(input),
52 &output, &output_size)); 52 &output, &output_size));
53 53
54 return 0; 54 return 0;
55 } 55 }
OLDNEW
« no previous file with comments | « src/trusted/plugin/string_encoding.cc ('k') | src/trusted/plugin/utility.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698