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

Unified Diff: vm/object_test.cc

Issue 11411341: Fix for issue 7089 (Symbols::New was not quite working correctly (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years 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 | « vm/object.cc ('k') | vm/symbols.h » ('j') | vm/symbols.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/object_test.cc
===================================================================
--- vm/object_test.cc (revision 15670)
+++ vm/object_test.cc (working copy)
@@ -268,11 +268,12 @@
const int kMonkeyLen = 4;
const uint8_t monkey_utf8[kMonkeyLen] = { 0xf0, 0x9f, 0x90, 0xb5 };
const String& monkey_face =
- String::Handle(String::New(monkey_utf8, kMonkeyLen));
+ String::Handle(String::FromUTF8(monkey_utf8, kMonkeyLen));
const int kDogLen = 4;
// 0x1f436 DOG FACE.
const uint8_t dog_utf8[kDogLen] = { 0xf0, 0x9f, 0x90, 0xb6 };
- const String& dog_face = String::Handle(String::New(dog_utf8, kDogLen));
+ const String& dog_face =
+ String::Handle(String::FromUTF8(dog_utf8, kDogLen));
EXPECT_EQ(0, monkey_face.CompareTo(monkey_face));
EXPECT_EQ(0, dog_face.CompareTo(dog_face));
EXPECT(monkey_face.CompareTo(dog_face) < 0);
@@ -281,7 +282,8 @@
const int kDominoLen = 4;
// 0x1f036 DOMINO TILE HORIZONTAL-00-05.
const uint8_t domino_utf8[kDominoLen] = { 0xf0, 0x9f, 0x80, 0xb6 };
- const String& domino = String::Handle(String::New(domino_utf8, kDominoLen));
+ const String& domino =
+ String::Handle(String::FromUTF8(domino_utf8, kDominoLen));
EXPECT_EQ(0, domino.CompareTo(domino));
EXPECT(domino.CompareTo(dog_face) < 0);
EXPECT(domino.CompareTo(monkey_face) < 0);
@@ -516,7 +518,7 @@
const uint8_t* motto =
reinterpret_cast<const uint8_t*>("Dart's bescht wos je hets gits");
- const String& str2 = String::Handle(String::New(motto+7, 4));
+ const String& str2 = String::Handle(String::FromUTF8(motto+7, 4));
EXPECT_EQ(4, str2.Length());
EXPECT_EQ('b', str2.CharAt(0));
EXPECT_EQ('e', str2.CharAt(1));
@@ -544,7 +546,7 @@
const intptr_t kCharsLen = 8;
const uint8_t chars[kCharsLen] = { 1, 2, 127, 64, 92, 0, 55, 55 };
- const String& str8 = String::Handle(String::New(chars, kCharsLen));
+ const String& str8 = String::Handle(String::FromUTF8(chars, kCharsLen));
EXPECT_EQ(kCharsLen, str8.Length());
EXPECT_EQ(1, str8.CharAt(0));
EXPECT_EQ(127, str8.CharAt(2));
« no previous file with comments | « vm/object.cc ('k') | vm/symbols.h » ('j') | vm/symbols.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698