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

Unified Diff: src/trusted/plugin/string_encoding_test.cc

Issue 7799028: Remove src/trusted/plugin (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client
Patch Set: fix gyp file for necessary -I Created 9 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/trusted/plugin/string_encoding.cc ('k') | src/trusted/plugin/utility.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/trusted/plugin/string_encoding_test.cc
diff --git a/src/trusted/plugin/string_encoding_test.cc b/src/trusted/plugin/string_encoding_test.cc
deleted file mode 100644
index 8f25bb3fca4d8495062e6ebcb8392c19ecaf6597..0000000000000000000000000000000000000000
--- a/src/trusted/plugin/string_encoding_test.cc
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright 2010 The Native Client Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can
- * be found in the LICENSE file.
- */
-
-#include <string.h>
-
-#include "native_client/src/shared/platform/nacl_check.h"
-#include "native_client/src/trusted/plugin/string_encoding.h"
-
-
-int main() {
- const char* input;
- char* output;
- size_t output_size;
-
- // Valid input.
-
- input = "Hello world, \x80 and \xff";
- CHECK(plugin::ByteStringAsUTF8(input, strlen(input), &output, &output_size));
- CHECK(strcmp(output, "Hello world, \xc2\x80 and \xc3\xbf") == 0);
- CHECK(plugin::ByteStringFromUTF8(output, output_size, &output, &output_size));
- CHECK(strcmp(output, "Hello world, \x80 and \xff") == 0);
-
- // Valid UTF-8, but chars too big.
-
- // Three-byte sequence
- // This encodes \u1000
- input = "\xe1\x80\x80";
- CHECK(!plugin::ByteStringFromUTF8(input, strlen(input),
- &output, &output_size));
- // This encodes \u0100
- input = "\xc4\x80";
- CHECK(!plugin::ByteStringFromUTF8(input, strlen(input),
- &output, &output_size));
-
- // Invalid UTF-8.
-
- // Incomplete sequence
- input = "\xc2";
- CHECK(!plugin::ByteStringFromUTF8(input, strlen(input),
- &output, &output_size));
- // Subsequent byte is wrong
- input = "\xc2 ";
- CHECK(!plugin::ByteStringFromUTF8(input, strlen(input),
- &output, &output_size));
- // Over long encoding
- // This is a non-canonical encoding for \x00
- input = "\xc0\x80";
- CHECK(!plugin::ByteStringFromUTF8(input, strlen(input),
- &output, &output_size));
-
- return 0;
-}
« 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