| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 #ifndef VM_UNIT_TEST_H_ | 5 #ifndef VM_UNIT_TEST_H_ |
| 6 #define VM_UNIT_TEST_H_ | 6 #define VM_UNIT_TEST_H_ |
| 7 | 7 |
| 8 #include "include/dart_api.h" | 8 #include "include/dart_api.h" |
| 9 | 9 |
| 10 #include "vm/ast.h" | 10 #include "vm/ast.h" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 const Array& kNoArgumentNames = Array::Handle(); \ | 125 const Array& kNoArgumentNames = Array::Handle(); \ |
| 126 Object& result = Object::Handle(); \ | 126 Object& result = Object::Handle(); \ |
| 127 result = DartEntry::InvokeStatic(function, arguments, kNoArgumentNames); \ | 127 result = DartEntry::InvokeStatic(function, arguments, kNoArgumentNames); \ |
| 128 EXPECT(!result.IsError()); \ | 128 EXPECT(!result.IsError()); \ |
| 129 Instance& actual = Instance::Handle(); \ | 129 Instance& actual = Instance::Handle(); \ |
| 130 actual ^= result.raw(); \ | 130 actual ^= result.raw(); \ |
| 131 EXPECT(actual.Equals(Instance::Handle(expected))); \ | 131 EXPECT(actual.Equals(Instance::Handle(expected))); \ |
| 132 } | 132 } |
| 133 | 133 |
| 134 | 134 |
| 135 inline Dart_Handle NewString(const char* str) { |
| 136 return Dart_NewStringFromCString(str); |
| 137 } |
| 138 |
| 139 |
| 135 namespace dart { | 140 namespace dart { |
| 136 | 141 |
| 137 // Forward declarations. | 142 // Forward declarations. |
| 138 class Assembler; | 143 class Assembler; |
| 139 class CodeGenerator; | 144 class CodeGenerator; |
| 140 class VirtualMemory; | 145 class VirtualMemory; |
| 141 | 146 |
| 142 | 147 |
| 143 class TestCaseBase { | 148 class TestCaseBase { |
| 144 public: | 149 public: |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 } else { \ | 309 } else { \ |
| 305 dart::Expect(__FILE__, __LINE__).Fail( \ | 310 dart::Expect(__FILE__, __LINE__).Fail( \ |
| 306 "expected '%s' to be an error handle but found a valid handle.\n", \ | 311 "expected '%s' to be an error handle but found a valid handle.\n", \ |
| 307 #handle); \ | 312 #handle); \ |
| 308 } \ | 313 } \ |
| 309 } while (0) | 314 } while (0) |
| 310 | 315 |
| 311 } // namespace dart | 316 } // namespace dart |
| 312 | 317 |
| 313 #endif // VM_UNIT_TEST_H_ | 318 #endif // VM_UNIT_TEST_H_ |
| OLD | NEW |