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

Unified Diff: runtime/platform/assert.h

Issue 10416050: Remove the partially completed code for remote IsolateMirrors and (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 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/mirrors_impl.dart ('k') | runtime/tests/vm/dart/isolate_mirror_busy_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/platform/assert.h
===================================================================
--- runtime/platform/assert.h (revision 8116)
+++ runtime/platform/assert.h (working copy)
@@ -52,6 +52,9 @@
void IsSubstring(const E& needle, const A& haystack);
template<typename E, typename A>
+ void IsNotSubstring(const E& needle, const A& haystack);
+
+ template<typename E, typename A>
void LessThan(const E& left, const A& right);
template<typename E, typename A>
@@ -158,6 +161,19 @@
template<typename E, typename A>
+void DynamicAssertionHelper::IsNotSubstring(const E& needle,
+ const A& haystack) {
+ std::stringstream ess, ass;
+ ess << needle;
+ ass << haystack;
+ std::string es = ess.str(), as = ass.str();
+ if (as.find(es) == std::string::npos) return;
+ Fail("expected <\"%s\"> to not be a substring of <\"%s\">",
+ es.c_str(), as.c_str());
+}
+
+
+template<typename E, typename A>
void DynamicAssertionHelper::LessThan(const E& left, const A& right) {
if (left < right) return;
std::stringstream ess, ass;
@@ -276,6 +292,9 @@
#define EXPECT_SUBSTRING(needle, haystack) \
dart::Expect(__FILE__, __LINE__).IsSubstring((needle), (haystack))
+#define EXPECT_NOTSUBSTRING(needle, haystack) \
+ dart::Expect(__FILE__, __LINE__).IsNotSubstring((needle), (haystack))
+
#define EXPECT_LT(left, right) \
dart::Expect(__FILE__, __LINE__).LessThan((left), (right))
« no previous file with comments | « runtime/lib/mirrors_impl.dart ('k') | runtime/tests/vm/dart/isolate_mirror_busy_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698