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

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

Issue 25418002: Respond to Ivan's code review comments from previous TBR cl. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: PTAL Created 7 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
« no previous file with comments | « 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) 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 "vm/assembler.h" 5 #include "vm/assembler.h"
6 #include "vm/bigint_operations.h" 6 #include "vm/bigint_operations.h"
7 #include "vm/class_finalizer.h" 7 #include "vm/class_finalizer.h"
8 #include "vm/dart_api_impl.h" 8 #include "vm/dart_api_impl.h"
9 #include "vm/dart_entry.h" 9 #include "vm/dart_entry.h"
10 #include "vm/isolate.h" 10 #include "vm/isolate.h"
(...skipping 1526 matching lines...) Expand 10 before | Expand all | Expand 10 after
1537 const String& str = 1537 const String& str =
1538 String::Handle( 1538 String::Handle(
1539 OneByteString::New(characters, len, Heap::kNew)); 1539 OneByteString::New(characters, len, Heap::kNew));
1540 EXPECT(str.IsOneByteString()); 1540 EXPECT(str.IsOneByteString());
1541 EXPECT_EQ(str.Length(), len); 1541 EXPECT_EQ(str.Length(), len);
1542 EXPECT(str.Equals("a\n\f\b\t\v\r\\$z")); 1542 EXPECT(str.Equals("a\n\f\b\t\v\r\\$z"));
1543 const String& escaped_str = 1543 const String& escaped_str =
1544 String::Handle(String::EscapeSpecialCharacters(str)); 1544 String::Handle(String::EscapeSpecialCharacters(str));
1545 EXPECT(escaped_str.Equals("a\\n\\f\\b\\t\\v\\r\\\\\\$z")); 1545 EXPECT(escaped_str.Equals("a\\n\\f\\b\\t\\v\\r\\\\\\$z"));
1546 1546
1547 const String& empty_str = String::Handle(
1548 OneByteString::New(static_cast<intptr_t>(0), Heap::kNew));
1549 const String& escaped_empty_str = 1547 const String& escaped_empty_str =
1550 String::Handle(String::EscapeSpecialCharacters(empty_str)); 1548 String::Handle(String::EscapeSpecialCharacters(Symbols::Empty()));
1551 EXPECT_EQ(empty_str.Length(), 0);
1552 EXPECT_EQ(escaped_empty_str.Length(), 0); 1549 EXPECT_EQ(escaped_empty_str.Length(), 0);
1553 } 1550 }
1554 1551
1555 1552
1556 TEST_CASE(EscapeSpecialCharactersExternalOneByteString) { 1553 TEST_CASE(EscapeSpecialCharactersExternalOneByteString) {
1557 uint8_t characters[] = 1554 uint8_t characters[] =
1558 { 'a', '\n', '\f', '\b', '\t', '\v', '\r', '\\', '$', 'z' }; 1555 { 'a', '\n', '\f', '\b', '\t', '\v', '\r', '\\', '$', 'z' };
1559 intptr_t len = ARRAY_SIZE(characters); 1556 intptr_t len = ARRAY_SIZE(characters);
1560 1557
1561 const String& str = 1558 const String& str =
(...skipping 2011 matching lines...) Expand 10 before | Expand all | Expand 10 after
3573 cls = Object::dynamic_class(); 3570 cls = Object::dynamic_class();
3574 array = cls.fields(); 3571 array = cls.fields();
3575 EXPECT(!array.IsNull()); 3572 EXPECT(!array.IsNull());
3576 EXPECT(array.IsArray()); 3573 EXPECT(array.IsArray());
3577 array = cls.functions(); 3574 array = cls.functions();
3578 EXPECT(!array.IsNull()); 3575 EXPECT(!array.IsNull());
3579 EXPECT(array.IsArray()); 3576 EXPECT(array.IsArray());
3580 } 3577 }
3581 3578
3582 } // namespace dart 3579 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698