| 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_api.h" | 5 #include "include/dart_api.h" |
| 6 #include "platform/assert.h" | 6 #include "platform/assert.h" |
| 7 #include "platform/utils.h" | 7 #include "platform/utils.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_state.h" | 10 #include "vm/dart_api_state.h" |
| (...skipping 2248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2259 EXPECT_EQ(iso_2, Dart_CurrentIsolate()); | 2259 EXPECT_EQ(iso_2, Dart_CurrentIsolate()); |
| 2260 Dart_ShutdownIsolate(); | 2260 Dart_ShutdownIsolate(); |
| 2261 EXPECT(NULL == Dart_CurrentIsolate()); | 2261 EXPECT(NULL == Dart_CurrentIsolate()); |
| 2262 Dart_EnterIsolate(iso_1); | 2262 Dart_EnterIsolate(iso_1); |
| 2263 EXPECT_EQ(iso_1, Dart_CurrentIsolate()); | 2263 EXPECT_EQ(iso_1, Dart_CurrentIsolate()); |
| 2264 Dart_ShutdownIsolate(); | 2264 Dart_ShutdownIsolate(); |
| 2265 EXPECT(NULL == Dart_CurrentIsolate()); | 2265 EXPECT(NULL == Dart_CurrentIsolate()); |
| 2266 } | 2266 } |
| 2267 | 2267 |
| 2268 | 2268 |
| 2269 UNIT_TEST_CASE(CurrentIsolateData) { |
| 2270 intptr_t mydata = 12345; |
| 2271 char* err; |
| 2272 Dart_Isolate isolate = |
| 2273 Dart_CreateIsolate(NULL, NULL, NULL, |
| 2274 reinterpret_cast<void*>(mydata), |
| 2275 &err); |
| 2276 EXPECT(isolate != NULL); |
| 2277 EXPECT_EQ(mydata, reinterpret_cast<intptr_t>(Dart_CurrentIsolateData())); |
| 2278 Dart_ShutdownIsolate(); |
| 2279 } |
| 2280 |
| 2281 |
| 2269 TEST_CASE(DebugName) { | 2282 TEST_CASE(DebugName) { |
| 2270 Dart_Handle debug_name = Dart_DebugName(); | 2283 Dart_Handle debug_name = Dart_DebugName(); |
| 2271 EXPECT_VALID(debug_name); | 2284 EXPECT_VALID(debug_name); |
| 2272 EXPECT(Dart_IsString(debug_name)); | 2285 EXPECT(Dart_IsString(debug_name)); |
| 2273 } | 2286 } |
| 2274 | 2287 |
| 2275 | 2288 |
| 2276 static void MyMessageNotifyCallback(Dart_Isolate dest_isolate) { | 2289 static void MyMessageNotifyCallback(Dart_Isolate dest_isolate) { |
| 2277 } | 2290 } |
| 2278 | 2291 |
| (...skipping 3271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5550 EXPECT_VALID(result); | 5563 EXPECT_VALID(result); |
| 5551 EXPECT(Dart_IsInteger(result)); | 5564 EXPECT(Dart_IsInteger(result)); |
| 5552 int64_t value = 0; | 5565 int64_t value = 0; |
| 5553 EXPECT_VALID(Dart_IntegerToInt64(result, &value)); | 5566 EXPECT_VALID(Dart_IntegerToInt64(result, &value)); |
| 5554 EXPECT_EQ(0, value); | 5567 EXPECT_EQ(0, value); |
| 5555 } | 5568 } |
| 5556 | 5569 |
| 5557 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). | 5570 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). |
| 5558 | 5571 |
| 5559 } // namespace dart | 5572 } // namespace dart |
| OLD | NEW |