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

Side by Side Diff: runtime/vm/object_test.cc

Issue 2400523003: Fix bad canonicalization for strings whose utf32->utf16 conversion is lossy. (Closed)
Patch Set: Created 4 years, 2 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
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "platform/globals.h" 5 #include "platform/globals.h"
6 6
7 #include "vm/assembler.h" 7 #include "vm/assembler.h"
8 #include "vm/class_finalizer.h" 8 #include "vm/class_finalizer.h"
9 #include "vm/dart_api_impl.h" 9 #include "vm/dart_api_impl.h"
10 #include "vm/dart_entry.h" 10 #include "vm/dart_entry.h"
(...skipping 4708 matching lines...) Expand 10 before | Expand all | Expand 10 after
4719 }; 4719 };
4720 String& test = String::Handle(); 4720 String& test = String::Handle();
4721 String& result = String::Handle(); 4721 String& result = String::Handle();
4722 for (size_t i = 0; i < ARRAY_SIZE(tests); i++) { 4722 for (size_t i = 0; i < ARRAY_SIZE(tests); i++) {
4723 test = String::New(tests[i].in); 4723 test = String::New(tests[i].in);
4724 result = String::ScrubName(test); 4724 result = String::ScrubName(test);
4725 EXPECT_STREQ(tests[i].out, result.ToCString()); 4725 EXPECT_STREQ(tests[i].out, result.ToCString());
4726 } 4726 }
4727 } 4727 }
4728 4728
4729
4730 VM_TEST_CASE(String_EqualsUTF32) {
hausner 2016/10/06 22:14:41 Maybe a short comment what is being tested here an
rmacnak 2016/10/06 23:16:29 Done.
4731 int32_t char_codes[] = {
4732 0, 0x0a, 0x0d, 0x7f, 0xff, 0xffff, 0xd800, 0xdc00, 0xdbff, 0xdfff
4733 };
4734
4735 const String& str =
4736 String::Handle(String::FromUTF32(char_codes, ARRAY_SIZE(char_codes)));
4737 EXPECT(str.Equals(char_codes, ARRAY_SIZE(char_codes)));
4738 }
4739
4729 } // namespace dart 4740 } // namespace dart
OLDNEW
« runtime/vm/object.cc ('K') | « runtime/vm/object.cc ('k') | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698