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

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

Issue 9325047: Add token index position to classes and types for more accurate error reporting. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 8 years, 10 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/code_patcher_x64_test.cc ('k') | runtime/vm/object.h » ('j') | 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 "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/dart_api_impl.h" 8 #include "vm/dart_api_impl.h"
9 #include "vm/dart_api_state.h" 9 #include "vm/dart_api_state.h"
10 #include "vm/thread.h" 10 #include "vm/thread.h"
(...skipping 1477 matching lines...) Expand 10 before | Expand all | Expand 10 after
1488 1488
1489 // Invoke a function which returns an object of type NativeFields. 1489 // Invoke a function which returns an object of type NativeFields.
1490 result = Dart_InvokeStatic(lib, 1490 result = Dart_InvokeStatic(lib,
1491 Dart_NewString("NativeFieldsTest"), 1491 Dart_NewString("NativeFieldsTest"),
1492 Dart_NewString("testMain"), 1492 Dart_NewString("testMain"),
1493 0, 1493 0,
1494 NULL); 1494 NULL);
1495 // We expect the test script to fail finalization with the error below: 1495 // We expect the test script to fail finalization with the error below:
1496 EXPECT(Dart_IsError(result)); 1496 EXPECT(Dart_IsError(result));
1497 Dart_Handle expected_error = Dart_Error( 1497 Dart_Handle expected_error = Dart_Error(
1498 "'dart:test-lib': Error: class 'NativeFields' is trying to extend a " 1498 "'dart:test-lib': Error: line 1 pos 38: class 'NativeFields' is trying");
1499 "native fields class, but library '%s' has no native resolvers", 1499 EXPECT_SUBSTRING(Dart_GetError(expected_error), Dart_GetError(result));
1500 TestCase::url());
1501 EXPECT_STREQ(Dart_GetError(expected_error), Dart_GetError(result));
1502 } 1500 }
1503 1501
1504 1502
1505 static void TestNativeFields(Dart_Handle retobj) { 1503 static void TestNativeFields(Dart_Handle retobj) {
1506 // Access and set various instance fields of the object. 1504 // Access and set various instance fields of the object.
1507 Dart_Handle result = Dart_GetInstanceField(retobj, Dart_NewString("fld3")); 1505 Dart_Handle result = Dart_GetInstanceField(retobj, Dart_NewString("fld3"));
1508 EXPECT(Dart_IsError(result)); 1506 EXPECT(Dart_IsError(result));
1509 result = Dart_GetInstanceField(retobj, Dart_NewString("fld0")); 1507 result = Dart_GetInstanceField(retobj, Dart_NewString("fld0"));
1510 EXPECT_VALID(result); 1508 EXPECT_VALID(result);
1511 EXPECT(Dart_IsNull(result)); 1509 EXPECT(Dart_IsNull(result));
(...skipping 1711 matching lines...) Expand 10 before | Expand all | Expand 10 after
3223 // We should have received the expected number of interrupts. 3221 // We should have received the expected number of interrupts.
3224 EXPECT_EQ(kInterruptCount, interrupt_count); 3222 EXPECT_EQ(kInterruptCount, interrupt_count);
3225 3223
3226 // Give the spawned thread enough time to properly exit. 3224 // Give the spawned thread enough time to properly exit.
3227 Isolate::SetInterruptCallback(saved); 3225 Isolate::SetInterruptCallback(saved);
3228 } 3226 }
3229 3227
3230 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). 3228 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64).
3231 3229
3232 } // namespace dart 3230 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/code_patcher_x64_test.cc ('k') | runtime/vm/object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698