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

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

Issue 17099005: Add test to check that IsArray returns true for immutable array objects. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 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
« no previous file with comments | « no previous file | 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) 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/assert.h" 5 #include "platform/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/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/isolate.h" 10 #include "vm/isolate.h"
(...skipping 1652 matching lines...) Expand 10 before | Expand all | Expand 10 after
1663 1663
1664 other_array.SetAt(1, other_array); 1664 other_array.SetAt(1, other_array);
1665 EXPECT(!array.Equals(other_array)); 1665 EXPECT(!array.Equals(other_array));
1666 1666
1667 other_array = Array::New(kArrayLen - 1); 1667 other_array = Array::New(kArrayLen - 1);
1668 other_array.SetAt(0, array); 1668 other_array.SetAt(0, array);
1669 other_array.SetAt(2, array); 1669 other_array.SetAt(2, array);
1670 EXPECT(!array.Equals(other_array)); 1670 EXPECT(!array.Equals(other_array));
1671 1671
1672 EXPECT_EQ(0, Object::empty_array().Length()); 1672 EXPECT_EQ(0, Object::empty_array().Length());
1673
1674 array.MakeImmutable();
1675 Object& obj = Object::Handle(array.raw());
1676 ASSERT(obj.IsArray());
1673 } 1677 }
1674 1678
1675 1679
1676 TEST_CASE(StringCodePointIterator) { 1680 TEST_CASE(StringCodePointIterator) {
1677 const String& str0 = String::Handle(String::New("")); 1681 const String& str0 = String::Handle(String::New(""));
1678 String::CodePointIterator it0(str0); 1682 String::CodePointIterator it0(str0);
1679 EXPECT(!it0.Next()); 1683 EXPECT(!it0.Next());
1680 1684
1681 const String& str1 = String::Handle(String::New(" \xc3\xa7 ")); 1685 const String& str1 = String::Handle(String::New(" \xc3\xa7 "));
1682 String::CodePointIterator it1(str1); 1686 String::CodePointIterator it1(str1);
(...skipping 1638 matching lines...) Expand 10 before | Expand all | Expand 10 after
3321 const Function& test7 = Function::Handle(GetFunction(class_a, "test7")); 3325 const Function& test7 = Function::Handle(GetFunction(class_a, "test7"));
3322 EXPECT_EQ(test1.SourceFingerprint(), test2.SourceFingerprint()); 3326 EXPECT_EQ(test1.SourceFingerprint(), test2.SourceFingerprint());
3323 EXPECT_NE(test1.SourceFingerprint(), test3.SourceFingerprint()); 3327 EXPECT_NE(test1.SourceFingerprint(), test3.SourceFingerprint());
3324 EXPECT_NE(test3.SourceFingerprint(), test4.SourceFingerprint()); 3328 EXPECT_NE(test3.SourceFingerprint(), test4.SourceFingerprint());
3325 EXPECT_NE(test4.SourceFingerprint(), test5.SourceFingerprint()); 3329 EXPECT_NE(test4.SourceFingerprint(), test5.SourceFingerprint());
3326 EXPECT_NE(test5.SourceFingerprint(), test6.SourceFingerprint()); 3330 EXPECT_NE(test5.SourceFingerprint(), test6.SourceFingerprint());
3327 EXPECT_EQ(test6.SourceFingerprint(), test7.SourceFingerprint()); 3331 EXPECT_EQ(test6.SourceFingerprint(), test7.SourceFingerprint());
3328 } 3332 }
3329 3333
3330 } // namespace dart 3334 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698