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

Unified Diff: runtime/platform/assert.h

Issue 70613002: - Fix string conversion warnings. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 1 month 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 | « no previous file | runtime/vm/bigint_operations_test.cc » ('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 30187)
+++ runtime/platform/assert.h (working copy)
@@ -295,6 +295,12 @@
#if defined(TESTING)
+
+// EXPECT and FAIL are equivalent to ASSERT and FATAL except that they do not
+// cause early termination of the unit test. This allows testing to proceed
+// further to be able to report other failures before reporting the overall
+// unit tests as failing.
+
#define EXPECT(condition) \
if (!(condition)) { \
dart::Expect(__FILE__, __LINE__).Fail("expected: %s", #condition); \
@@ -332,20 +338,16 @@
#define EXPECT_NOTNULL(ptr) \
dart::Expect(__FILE__, __LINE__).NotNull((ptr))
-#endif
-// TODO(iposva): provide a better way to get extra info on an EXPECT
-// fail - you suggested EXPECT_EQ(expected, actual, msg_format,
-// parameters_for_msg...), I quite like the google3 method
-// EXPECT_EQ(a, b) << "more stuff here...". (benl).
-
-#define WARN(error) \
+#define FAIL(error) \
dart::Expect(__FILE__, __LINE__).Fail("%s", error)
-#define WARN1(format, p1) \
+#define FAIL1(format, p1) \
dart::Expect(__FILE__, __LINE__).Fail(format, (p1))
-#define WARN2(format, p1, p2) \
+#define FAIL2(format, p1, p2) \
dart::Expect(__FILE__, __LINE__).Fail(format, (p1), (p2))
+#endif // defined(TESTING)
+
#endif // PLATFORM_ASSERT_H_
« no previous file with comments | « no previous file | runtime/vm/bigint_operations_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698