| Index: runtime/vm/unit_test.h
|
| diff --git a/runtime/vm/unit_test.h b/runtime/vm/unit_test.h
|
| index f0c0fccc7bd37c8a041f6a55aba35365cfc7bba2..0557c40b21a659ac751895ee2f85766764e7e71c 100644
|
| --- a/runtime/vm/unit_test.h
|
| +++ b/runtime/vm/unit_test.h
|
| @@ -11,6 +11,7 @@
|
|
|
| #include "vm/ast.h"
|
| #include "vm/dart.h"
|
| +#include "vm/dart_api_state.h"
|
| #include "vm/globals.h"
|
| #include "vm/heap.h"
|
| #include "vm/isolate.h"
|
| @@ -539,6 +540,13 @@ class CompilerTest : public AllStatic {
|
| #define EXPECT_VALID(handle) \
|
| do { \
|
| Dart_Handle tmp_handle = (handle); \
|
| + if (!Api::IsValid(tmp_handle)) { \
|
| + dart::Expect(__FILE__, __LINE__) \
|
| + .Fail( \
|
| + "expected '%s' to be a valid handle but '%s' has already been " \
|
| + "freed\n", \
|
| + #handle, #handle); \
|
| + } \
|
| if (Dart_IsError(tmp_handle)) { \
|
| dart::Expect(__FILE__, __LINE__) \
|
| .Fail( \
|
|
|