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

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
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");
siva 2012/02/06 18:13:08 Why did you chop of the rest of the error regardin
regis 2012/02/06 19:43:16 The emitted error message is now much longer, sinc
regis 2012/02/06 20:07:48 As discussed, I will not chop off the error messag
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 1705 matching lines...) Expand 10 before | Expand all | Expand 10 after
3217 // We should have received the expected number of interrupts. 3215 // We should have received the expected number of interrupts.
3218 EXPECT_EQ(kInterruptCount, interrupt_count); 3216 EXPECT_EQ(kInterruptCount, interrupt_count);
3219 3217
3220 // Give the spawned thread enough time to properly exit. 3218 // Give the spawned thread enough time to properly exit.
3221 Isolate::SetInterruptCallback(saved); 3219 Isolate::SetInterruptCallback(saved);
3222 } 3220 }
3223 3221
3224 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64). 3222 #endif // defined(TARGET_ARCH_IA32) || defined(TARGET_ARCH_X64).
3225 3223
3226 } // namespace dart 3224 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698