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

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

Issue 274333002: Instance equality (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 7 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 "vm/class_finalizer.h" 7 #include "vm/class_finalizer.h"
8 #include "vm/compiler.h" 8 #include "vm/compiler.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 24 matching lines...) Expand all
35 35
36 #define FUNCTION_NAME(name) StackFrame_##name 36 #define FUNCTION_NAME(name) StackFrame_##name
37 #define REGISTER_FUNCTION(name, count) \ 37 #define REGISTER_FUNCTION(name, count) \
38 { ""#name, FUNCTION_NAME(name), count }, 38 { ""#name, FUNCTION_NAME(name), count },
39 39
40 40
41 void FUNCTION_NAME(StackFrame_equals)(Dart_NativeArguments args) { 41 void FUNCTION_NAME(StackFrame_equals)(Dart_NativeArguments args) {
42 NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args); 42 NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args);
43 const Instance& expected = Instance::CheckedHandle(arguments->NativeArgAt(0)); 43 const Instance& expected = Instance::CheckedHandle(arguments->NativeArgAt(0));
44 const Instance& actual = Instance::CheckedHandle(arguments->NativeArgAt(1)); 44 const Instance& actual = Instance::CheckedHandle(arguments->NativeArgAt(1));
45 if (!expected.Equals(actual)) { 45 if (!expected.OperatorEquals(actual)) {
46 OS::Print("expected: '%s' actual: '%s'\n", 46 OS::Print("expected: '%s' actual: '%s'\n",
47 expected.ToCString(), actual.ToCString()); 47 expected.ToCString(), actual.ToCString());
48 FATAL("Expect_equals fails.\n"); 48 FATAL("Expect_equals fails.\n");
49 } 49 }
50 } 50 }
51 51
52 52
53 void FUNCTION_NAME(StackFrame_frameCount)(Dart_NativeArguments args) { 53 void FUNCTION_NAME(StackFrame_frameCount)(Dart_NativeArguments args) {
54 int count = 0; 54 int count = 0;
55 StackFrameIterator frames(StackFrameIterator::kValidateFrames); 55 StackFrameIterator frames(StackFrameIterator::kValidateFrames);
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 " }" 279 " }"
280 "}"; 280 "}";
281 Dart_Handle lib = TestCase::LoadTestScript( 281 Dart_Handle lib = TestCase::LoadTestScript(
282 kScriptChars, 282 kScriptChars,
283 reinterpret_cast<Dart_NativeEntryResolver>(native_lookup)); 283 reinterpret_cast<Dart_NativeEntryResolver>(native_lookup));
284 Dart_Handle cls = Dart_GetClass(lib, NewString("StackFrame2Test")); 284 Dart_Handle cls = Dart_GetClass(lib, NewString("StackFrame2Test"));
285 EXPECT_VALID(Dart_Invoke(cls, NewString("testMain"), 0, NULL)); 285 EXPECT_VALID(Dart_Invoke(cls, NewString("testMain"), 0, NULL));
286 } 286 }
287 287
288 } // namespace dart 288 } // namespace dart
OLDNEW
« runtime/vm/object.h ('K') | « runtime/vm/snapshot_test.cc ('k') | runtime/vm/unit_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698