Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(170)

Unified Diff: runtime/vm/unit_test.h

Issue 2640573003: Resolution for issue #5092: Unit test handle checks consider dangling handles to be valid. (Closed)
Patch Set: Removed Dart API entry for IsValid. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« runtime/vm/dart_api_impl.cc ('K') | « runtime/vm/thread_registry.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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( \
« runtime/vm/dart_api_impl.cc ('K') | « runtime/vm/thread_registry.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698