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 8360027: Proper string comparison. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Test added. Created 9 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 | Annotate | Revision Log
« runtime/vm/object.cc ('K') | « runtime/vm/object.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 "vm/assert.h" 5 #include "vm/assert.h"
6 #include "vm/assembler.h" 6 #include "vm/assembler.h"
7 #include "vm/bigint_operations.h" 7 #include "vm/bigint_operations.h"
8 #include "vm/isolate.h" 8 #include "vm/isolate.h"
9 #include "vm/object.h" 9 #include "vm/object.h"
10 #include "vm/object_store.h" 10 #include "vm/object_store.h"
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 649
650 const Array& array3 = Array::Handle(Array::New(3)); 650 const Array& array3 = Array::Handle(Array::New(3));
651 EXPECT_EQ(3, array3.Length()); 651 EXPECT_EQ(3, array3.Length());
652 array3.SetAt(0, str2); 652 array3.SetAt(0, str2);
653 array3.SetAt(1, str1); 653 array3.SetAt(1, str1);
654 array3.SetAt(2, str2); 654 array3.SetAt(2, str2);
655 const String& str7 = String::Handle(String::ConcatAll(array3)); 655 const String& str7 = String::Handle(String::ConcatAll(array3));
656 EXPECT(str7.IsOneByteString()); 656 EXPECT(str7.IsOneByteString());
657 EXPECT_EQ(6, str7.Length()); 657 EXPECT_EQ(6, str7.Length());
658 EXPECT(str7.Equals("oneone")); 658 EXPECT(str7.Equals("oneone"));
659 EXPECT(!str7.Equals("oneoneone"));
659 } 660 }
660 661
661 // Create a string by concatenating non-empty 1-byte strings. 662 // Create a string by concatenating non-empty 1-byte strings.
662 { 663 {
663 const char* one = "one"; 664 const char* one = "one";
664 intptr_t one_len = strlen(one); 665 intptr_t one_len = strlen(one);
665 const String& onestr = String::Handle(String::New(one)); 666 const String& onestr = String::Handle(String::New(one));
666 EXPECT(onestr.IsOneByteString()); 667 EXPECT(onestr.IsOneByteString());
667 EXPECT_EQ(one_len, onestr.Length()); 668 EXPECT_EQ(one_len, onestr.Length());
668 669
(...skipping 1280 matching lines...) Expand 10 before | Expand all | Expand 10 after
1949 cls = iterator.GetNextClass(); 1950 cls = iterator.GetNextClass();
1950 ASSERT((cls.raw() == ae66.raw()) || (cls.raw() == re44.raw())); 1951 ASSERT((cls.raw() == ae66.raw()) || (cls.raw() == re44.raw()));
1951 count++; 1952 count++;
1952 } 1953 }
1953 ASSERT(count == 2); 1954 ASSERT(count == 2);
1954 } 1955 }
1955 1956
1956 #endif // TARGET_ARCH_IA32. 1957 #endif // TARGET_ARCH_IA32.
1957 1958
1958 } // namespace dart 1959 } // namespace dart
OLDNEW
« runtime/vm/object.cc ('K') | « runtime/vm/object.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698