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

Unified Diff: vm/dart_api_impl_test.cc

Issue 11419259: Fix bug in Utf8::CodePointCount which was causing some strings with latin1 (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 1 month 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 | « no previous file | vm/dart_api_message.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/dart_api_impl_test.cc
===================================================================
--- vm/dart_api_impl_test.cc (revision 15591)
+++ vm/dart_api_impl_test.cc (working copy)
@@ -513,6 +513,17 @@
TEST_CASE(IsString) {
+ uint8_t latin1[] = { 'o', 'n', 'e', 0xC2, 0xA2 };
+
+ Dart_Handle latin1str = Dart_NewStringFromUTF8(latin1, ARRAY_SIZE(latin1));
+ EXPECT_VALID(latin1str);
+ EXPECT(Dart_IsString(latin1str));
+ EXPECT(Dart_IsStringLatin1(latin1str));
+ EXPECT(!Dart_IsExternalString(latin1str));
+ intptr_t len = -1;
+ EXPECT_VALID(Dart_StringLength(latin1str, &len));
+ EXPECT_EQ(4, len);
+
uint8_t data8[] = { 'o', 'n', 'e', 0x7F };
Dart_Handle str8 = Dart_NewStringFromUTF8(data8, ARRAY_SIZE(data8));
« no previous file with comments | « no previous file | vm/dart_api_message.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698