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 #define NewString(str) Dart_NewStringFromCString(str) | |
cshapiro
2012/10/24 23:52:29
Why not just rename this function globally?
siva
2012/10/26 21:38:29
Causes too many indentation issues and since most
| |
136 | |
137 | |
135 namespace dart { | 138 namespace dart { |
136 | 139 |
137 // Forward declarations. | 140 // Forward declarations. |
138 class Assembler; | 141 class Assembler; |
139 class CodeGenerator; | 142 class CodeGenerator; |
140 class VirtualMemory; | 143 class VirtualMemory; |
141 | 144 |
142 | 145 |
143 class TestCaseBase { | 146 class TestCaseBase { |
144 public: | 147 public: |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
304 } else { \ | 307 } else { \ |
305 dart::Expect(__FILE__, __LINE__).Fail( \ | 308 dart::Expect(__FILE__, __LINE__).Fail( \ |
306 "expected '%s' to be an error handle but found a valid handle.\n", \ | 309 "expected '%s' to be an error handle but found a valid handle.\n", \ |
307 #handle); \ | 310 #handle); \ |
308 } \ | 311 } \ |
309 } while (0) | 312 } while (0) |
310 | 313 |
311 } // namespace dart | 314 } // namespace dart |
312 | 315 |
313 #endif // VM_UNIT_TEST_H_ | 316 #endif // VM_UNIT_TEST_H_ |
OLD | NEW |