| 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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 // Test the Compiler::CompileScript functionality by checking the return | 245 // Test the Compiler::CompileScript functionality by checking the return |
| 246 // value to see if no parse errors were reported. | 246 // value to see if no parse errors were reported. |
| 247 static bool TestCompileScript(const Library& library, const Script& script); | 247 static bool TestCompileScript(const Library& library, const Script& script); |
| 248 | 248 |
| 249 // Test the Compiler::CompileFunction functionality by checking the return | 249 // Test the Compiler::CompileFunction functionality by checking the return |
| 250 // value to see if no parse errors were reported. | 250 // value to see if no parse errors were reported. |
| 251 static bool TestCompileFunction(const Function& function); | 251 static bool TestCompileFunction(const Function& function); |
| 252 }; | 252 }; |
| 253 | 253 |
| 254 #define EXPECT_VALID(handle) \ | 254 #define EXPECT_VALID(handle) \ |
| 255 if (!Dart_IsValid((handle))) { \ | 255 if (Dart_IsError((handle))) { \ |
| 256 dart::Expect(__FILE__, __LINE__).Fail("invalid handle '%s':\n '%s'\n", \ | 256 dart::Expect(__FILE__, __LINE__).Fail("invalid handle '%s':\n '%s'\n", \ |
| 257 #handle, Dart_GetError(handle)); \ | 257 #handle, Dart_GetError(handle)); \ |
| 258 } | 258 } |
| 259 | 259 |
| 260 } // namespace dart | 260 } // namespace dart |
| 261 | 261 |
| 262 #endif // VM_UNIT_TEST_H_ | 262 #endif // VM_UNIT_TEST_H_ |
| OLD | NEW |