| 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 "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 2467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2478 EXPECT_EQ(9, last_idx.value()); | 2478 EXPECT_EQ(9, last_idx.value()); |
| 2479 script.TokenRangeAtLine(1, &first_idx, &last_idx); | 2479 script.TokenRangeAtLine(1, &first_idx, &last_idx); |
| 2480 EXPECT_EQ(0, first_idx.value()); | 2480 EXPECT_EQ(0, first_idx.value()); |
| 2481 EXPECT_EQ(3, last_idx.value()); | 2481 EXPECT_EQ(3, last_idx.value()); |
| 2482 script.TokenRangeAtLine(6, &first_idx, &last_idx); | 2482 script.TokenRangeAtLine(6, &first_idx, &last_idx); |
| 2483 EXPECT_EQ(-1, first_idx.value()); | 2483 EXPECT_EQ(-1, first_idx.value()); |
| 2484 EXPECT_EQ(-1, last_idx.value()); | 2484 EXPECT_EQ(-1, last_idx.value()); |
| 2485 script.TokenRangeAtLine(1000, &first_idx, &last_idx); | 2485 script.TokenRangeAtLine(1000, &first_idx, &last_idx); |
| 2486 EXPECT_EQ(-1, first_idx.value()); | 2486 EXPECT_EQ(-1, first_idx.value()); |
| 2487 EXPECT_EQ(-1, last_idx.value()); | 2487 EXPECT_EQ(-1, last_idx.value()); |
| 2488 |
| 2489 free(src_chars); |
| 2488 } | 2490 } |
| 2489 | 2491 |
| 2490 | 2492 |
| 2491 VM_TEST_CASE(Context) { | 2493 VM_TEST_CASE(Context) { |
| 2492 const int kNumVariables = 5; | 2494 const int kNumVariables = 5; |
| 2493 const Context& parent_context = Context::Handle(Context::New(0)); | 2495 const Context& parent_context = Context::Handle(Context::New(0)); |
| 2494 const Context& context = Context::Handle(Context::New(kNumVariables)); | 2496 const Context& context = Context::Handle(Context::New(kNumVariables)); |
| 2495 context.set_parent(parent_context); | 2497 context.set_parent(parent_context); |
| 2496 EXPECT_EQ(kNumVariables, context.num_variables()); | 2498 EXPECT_EQ(kNumVariables, context.num_variables()); |
| 2497 EXPECT(Context::Handle(context.parent()).raw() == parent_context.raw()); | 2499 EXPECT(Context::Handle(context.parent()).raw() == parent_context.raw()); |
| (...skipping 2195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4693 // utf32->utf16 conversion. | 4695 // utf32->utf16 conversion. |
| 4694 int32_t char_codes[] = {0, 0x0a, 0x0d, 0x7f, 0xff, | 4696 int32_t char_codes[] = {0, 0x0a, 0x0d, 0x7f, 0xff, |
| 4695 0xffff, 0xd800, 0xdc00, 0xdbff, 0xdfff}; | 4697 0xffff, 0xd800, 0xdc00, 0xdbff, 0xdfff}; |
| 4696 | 4698 |
| 4697 const String& str = | 4699 const String& str = |
| 4698 String::Handle(String::FromUTF32(char_codes, ARRAY_SIZE(char_codes))); | 4700 String::Handle(String::FromUTF32(char_codes, ARRAY_SIZE(char_codes))); |
| 4699 EXPECT(str.Equals(char_codes, ARRAY_SIZE(char_codes))); | 4701 EXPECT(str.Equals(char_codes, ARRAY_SIZE(char_codes))); |
| 4700 } | 4702 } |
| 4701 | 4703 |
| 4702 } // namespace dart | 4704 } // namespace dart |
| OLD | NEW |