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

Unified Diff: runtime/vm/assert.h

Issue 8297004: Allow embedders to provide custom message delivery for an isolate. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years, 2 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/lib/isolate.cc ('k') | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/assert.h
===================================================================
--- runtime/vm/assert.h (revision 513)
+++ runtime/vm/assert.h (working copy)
@@ -39,6 +39,9 @@
template<typename E, typename A>
void Equals(const E& expected, const A& actual);
+ template<typename E, typename A>
+ void NotEquals(const E& not_expected, const A& actual);
+
template<typename E, typename A, typename T>
void FloatEquals(const E& expected, const A& actual, const T& tol);
@@ -95,6 +98,17 @@
}
+template<typename E, typename A>
+void DynamicAssertionHelper::NotEquals(const E& not_expected,
+ const A& actual) {
+ if (actual != not_expected) return;
+ std::stringstream ness;
+ ness << not_expected;
+ std::string nes = ness.str();
+ Fail("did not expect: <%s>", nes.c_str());
+}
+
+
template<typename E, typename A, typename T>
void DynamicAssertionHelper::FloatEquals(const E& expected,
const A& actual,
@@ -225,6 +239,9 @@
#define EXPECT_EQ(expected, actual) \
dart::Expect(__FILE__, __LINE__).Equals((expected), (actual))
+#define EXPECT_NE(not_expected, actual) \
+ dart::Expect(__FILE__, __LINE__).NotEquals((not_expected), (actual))
+
#define EXPECT_FLOAT_EQ(expected, actual, tol) \
dart::Expect(__FILE__, __LINE__).FloatEquals((expected), (actual), (tol))
« no previous file with comments | « runtime/lib/isolate.cc ('k') | runtime/vm/dart_api_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698