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

Unified Diff: runtime/vm/unit_test.h

Issue 13009004: Added EXPECT_TRUE macro, updated debugger unit tests to use it for (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 9 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
« no previous file with comments | « runtime/vm/debugger_api_impl_test.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
===================================================================
--- runtime/vm/unit_test.h (revision 20385)
+++ runtime/vm/unit_test.h (working copy)
@@ -360,6 +360,22 @@
} \
} while (0)
+#define EXPECT_TRUE(handle) \
+ do { \
+ Dart_Handle tmp_handle = (handle); \
+ if (Dart_IsBoolean(tmp_handle)) { \
+ bool value; \
+ Dart_BooleanValue(tmp_handle, &value); \
+ if (!value) { \
+ dart::Expect(__FILE__, __LINE__).Fail("expected True, but was '%s'\n", \
+ #handle); \
+ } \
+ } else { \
+ dart::Expect(__FILE__, __LINE__).Fail("expected True, but was '%s'\n", \
+ #handle); \
+ } \
+ } while (0)
+
} // namespace dart
#endif // VM_UNIT_TEST_H_
« no previous file with comments | « runtime/vm/debugger_api_impl_test.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698