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

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

Issue 10206009: NaCl: Remove unused file string_encoding.cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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 | « ppapi/native_client/src/trusted/plugin/string_encoding.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/native_client/src/trusted/plugin/string_encoding_test.cc
diff --git a/ppapi/native_client/src/trusted/plugin/string_encoding_test.cc b/ppapi/native_client/src/trusted/plugin/string_encoding_test.cc
deleted file mode 100644
index 3e01c677e70cbb7c51e1d4f425ce3cb7685c8e3b..0000000000000000000000000000000000000000
--- a/ppapi/native_client/src/trusted/plugin/string_encoding_test.cc
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright 2010 The Chromium 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 | « ppapi/native_client/src/trusted/plugin/string_encoding.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698