Index: runtime/vm/unit_test.h |
diff --git a/runtime/vm/unit_test.h b/runtime/vm/unit_test.h |
index a8b063a2b6c8df56febdb2779c2e75da9e224a64..ec4a6e0e16fb6e9aebff086a618e0419b7c7736b 100644 |
--- a/runtime/vm/unit_test.h |
+++ b/runtime/vm/unit_test.h |
@@ -29,6 +29,22 @@ |
// The TEST_CASE macro is used for tests that need an isolate and zone |
// in order to test its functionality. |
+#define VM_TEST_CASE(name) \ |
+ static void Dart_TestHelper##name(Thread* thread); \ |
+ UNIT_TEST_CASE(name) \ |
+ { \ |
+ TestIsolateScope __test_isolate__; \ |
+ Thread* __thread__ = Thread::Current(); \ |
+ ASSERT(__thread__->isolate() == __test_isolate__.isolate()); \ |
+ TransitionNativeToVM transition(__thread__); \ |
+ StackZone __zone__(__thread__); \ |
+ HandleScope __hs__(__thread__); \ |
+ Dart_TestHelper##name(__thread__); \ |
+ } \ |
+ static void Dart_TestHelper##name(Thread* thread) |
+ |
+// The TEST_CASE macro is used for tests that need an isolate and zone |
zra
2016/01/08 23:32:07
This is the same comments that's on VM_TEST_CASE.
siva
2016/01/12 21:26:22
Fixed the comments.
|
+// in order to test its functionality. |
#define TEST_CASE(name) \ |
static void Dart_TestHelper##name(Thread* thread); \ |
UNIT_TEST_CASE(name) \ |
@@ -57,7 +73,7 @@ |
// C++ callee-saved registers are not preserved. Arguments may be passed in. |
#define ASSEMBLER_TEST_RUN(name, test) \ |
static void AssemblerTestRun##name(AssemblerTest* test); \ |
- TEST_CASE(name) { \ |
+ VM_TEST_CASE(name) { \ |
Assembler __assembler__; \ |
AssemblerTest test(""#name, &__assembler__); \ |
AssemblerTestGenerate##name(test.assembler()); \ |
@@ -80,7 +96,7 @@ |
// Pass the name of test and the expected results as RawObject. |
#define CODEGEN_TEST_RUN(name, expected) \ |
static void CodeGenTestRun##name(const Function& function); \ |
- TEST_CASE(name) { \ |
+ VM_TEST_CASE(name) { \ |
CodeGenTest __test__(""#name); \ |
CodeGenTestGenerate##name(&__test__); \ |
__test__.Compile(); \ |
@@ -100,7 +116,7 @@ |
// and evaluate its result. |
#define CODEGEN_TEST_RAW_RUN(name, function) \ |
static void CodeGenTestRun##name(const Function& function); \ |
- TEST_CASE(name) { \ |
+ VM_TEST_CASE(name) { \ |
CodeGenTest __test__(""#name); \ |
CodeGenTestGenerate##name(&__test__); \ |
__test__.Compile(); \ |
@@ -113,7 +129,7 @@ |
// The first one may reference the Function object generated by the second one. |
#define CODEGEN_TEST2_RUN(name1, name2, expected) \ |
static void CodeGenTestRun##name1(const Function& function); \ |
- TEST_CASE(name1) { \ |
+ VM_TEST_CASE(name1) { \ |
/* Generate code for name2 */ \ |
CodeGenTest __test2__(""#name2); \ |
CodeGenTestGenerate##name2(&__test2__); \ |