OLD | NEW |
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 "include/dart_debugger_api.h" | 5 #include "include/dart_debugger_api.h" |
6 #include "platform/assert.h" | 6 #include "platform/assert.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/dart_api_message.h" | 10 #include "vm/dart_api_message.h" |
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
716 // Check if the serialized script object matches the original script. | 716 // Check if the serialized script object matches the original script. |
717 String& expected_literal = String::Handle(); | 717 String& expected_literal = String::Handle(); |
718 String& actual_literal = String::Handle(); | 718 String& actual_literal = String::Handle(); |
719 String& str = String::Handle(); | 719 String& str = String::Handle(); |
720 str ^= serialized_script.url(); | 720 str ^= serialized_script.url(); |
721 EXPECT(url.Equals(str)); | 721 EXPECT(url.Equals(str)); |
722 | 722 |
723 const TokenStream& expected_tokens = TokenStream::Handle(script.tokens()); | 723 const TokenStream& expected_tokens = TokenStream::Handle(script.tokens()); |
724 const TokenStream& serialized_tokens = | 724 const TokenStream& serialized_tokens = |
725 TokenStream::Handle(serialized_script.tokens()); | 725 TokenStream::Handle(serialized_script.tokens()); |
726 EXPECT_EQ(expected_tokens.Length(), serialized_tokens.Length()); | 726 const ExternalUint8Array& expected_data = |
| 727 ExternalUint8Array::Handle(expected_tokens.GetStream()); |
| 728 const ExternalUint8Array& serialized_data = |
| 729 ExternalUint8Array::Handle(serialized_tokens.GetStream()); |
| 730 EXPECT_EQ(expected_data.Length(), serialized_data.Length()); |
727 TokenStream::Iterator expected_iterator(expected_tokens, 0); | 731 TokenStream::Iterator expected_iterator(expected_tokens, 0); |
728 TokenStream::Iterator serialized_iterator(serialized_tokens, 0); | 732 TokenStream::Iterator serialized_iterator(serialized_tokens, 0); |
729 Token::Kind expected_kind = expected_iterator.CurrentTokenKind(); | 733 Token::Kind expected_kind = expected_iterator.CurrentTokenKind(); |
730 Token::Kind serialized_kind = serialized_iterator.CurrentTokenKind(); | 734 Token::Kind serialized_kind = serialized_iterator.CurrentTokenKind(); |
731 while (expected_kind != Token::kEOS && serialized_kind != Token::kEOS) { | 735 while (expected_kind != Token::kEOS && serialized_kind != Token::kEOS) { |
732 EXPECT_EQ(expected_kind, serialized_kind); | 736 EXPECT_EQ(expected_kind, serialized_kind); |
733 expected_literal ^= expected_iterator.CurrentLiteral(); | 737 expected_literal ^= expected_iterator.CurrentLiteral(); |
734 actual_literal ^= serialized_iterator.CurrentLiteral(); | 738 actual_literal ^= serialized_iterator.CurrentLiteral(); |
735 EXPECT(expected_literal.Equals(actual_literal)); | 739 EXPECT(expected_literal.Equals(actual_literal)); |
736 expected_iterator.Advance(); | 740 expected_iterator.Advance(); |
(...skipping 785 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1522 EXPECT(Dart_ErrorHasException(result)); | 1526 EXPECT(Dart_ErrorHasException(result)); |
1523 EXPECT_SUBSTRING("Exception: nulltruefalse1234563.14[]100123456789\n", | 1527 EXPECT_SUBSTRING("Exception: nulltruefalse1234563.14[]100123456789\n", |
1524 Dart_GetError(result)); | 1528 Dart_GetError(result)); |
1525 | 1529 |
1526 Dart_ExitScope(); | 1530 Dart_ExitScope(); |
1527 } | 1531 } |
1528 | 1532 |
1529 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). | 1533 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). |
1530 | 1534 |
1531 } // namespace dart | 1535 } // namespace dart |
OLD | NEW |