| Index: runtime/platform/assert.h
|
| diff --git a/runtime/platform/assert.h b/runtime/platform/assert.h
|
| index 02e0e8f3bc3fac6763d66a52c8f2b6295b74a9a5..1b01b736b107de3e56b02e488fa613b14d0d44ab 100644
|
| --- a/runtime/platform/assert.h
|
| +++ b/runtime/platform/assert.h
|
| @@ -80,21 +80,18 @@ class DynamicAssertionHelper {
|
| DISALLOW_IMPLICIT_CONSTRUCTORS(DynamicAssertionHelper);
|
| };
|
|
|
| -
|
| class Assert : public DynamicAssertionHelper {
|
| public:
|
| Assert(const char* file, int line)
|
| : DynamicAssertionHelper(file, line, ASSERT) {}
|
| };
|
|
|
| -
|
| class Expect : public DynamicAssertionHelper {
|
| public:
|
| Expect(const char* file, int line)
|
| : DynamicAssertionHelper(file, line, EXPECT) {}
|
| };
|
|
|
| -
|
| #if defined(TESTING)
|
| // Only allow the expensive (with respect to code size) assertions
|
| // in testing code.
|
| @@ -108,7 +105,6 @@ void DynamicAssertionHelper::Equals(const E& expected, const A& actual) {
|
| Fail("expected: <%s> but was: <%s>", es.c_str(), as.c_str());
|
| }
|
|
|
| -
|
| template <typename E, typename A>
|
| void DynamicAssertionHelper::NotEquals(const E& not_expected, const A& actual) {
|
| if (actual != not_expected) return;
|
| @@ -118,7 +114,6 @@ void DynamicAssertionHelper::NotEquals(const E& not_expected, const A& actual) {
|
| Fail("did not expect: <%s>", nes.c_str());
|
| }
|
|
|
| -
|
| template <typename E, typename A, typename T>
|
| void DynamicAssertionHelper::FloatEquals(const E& expected,
|
| const A& actual,
|
| @@ -135,7 +130,6 @@ void DynamicAssertionHelper::FloatEquals(const E& expected,
|
| tols.c_str());
|
| }
|
|
|
| -
|
| template <typename E, typename A>
|
| NO_SANITIZE_MEMORY void DynamicAssertionHelper::StringEquals(const E& expected,
|
| const A& actual) {
|
| @@ -147,7 +141,6 @@ NO_SANITIZE_MEMORY void DynamicAssertionHelper::StringEquals(const E& expected,
|
| Fail("expected:\n<\"%s\">\nbut was:\n<\"%s\">", es.c_str(), as.c_str());
|
| }
|
|
|
| -
|
| template <typename E, typename A>
|
| NO_SANITIZE_MEMORY void DynamicAssertionHelper::IsSubstring(const E& needle,
|
| const A& haystack) {
|
| @@ -160,7 +153,6 @@ NO_SANITIZE_MEMORY void DynamicAssertionHelper::IsSubstring(const E& needle,
|
| as.c_str());
|
| }
|
|
|
| -
|
| template <typename E, typename A>
|
| NO_SANITIZE_MEMORY void DynamicAssertionHelper::IsNotSubstring(
|
| const E& needle,
|
| @@ -174,7 +166,6 @@ NO_SANITIZE_MEMORY void DynamicAssertionHelper::IsNotSubstring(
|
| as.c_str());
|
| }
|
|
|
| -
|
| template <typename E, typename A>
|
| void DynamicAssertionHelper::LessThan(const E& left, const A& right) {
|
| if (left < right) return;
|
| @@ -185,7 +176,6 @@ void DynamicAssertionHelper::LessThan(const E& left, const A& right) {
|
| Fail("expected: %s < %s", es.c_str(), as.c_str());
|
| }
|
|
|
| -
|
| template <typename E, typename A>
|
| void DynamicAssertionHelper::LessEqual(const E& left, const A& right) {
|
| if (left <= right) return;
|
| @@ -196,7 +186,6 @@ void DynamicAssertionHelper::LessEqual(const E& left, const A& right) {
|
| Fail("expected: %s <= %s", es.c_str(), as.c_str());
|
| }
|
|
|
| -
|
| template <typename E, typename A>
|
| void DynamicAssertionHelper::GreaterThan(const E& left, const A& right) {
|
| if (left > right) return;
|
| @@ -207,7 +196,6 @@ void DynamicAssertionHelper::GreaterThan(const E& left, const A& right) {
|
| Fail("expected: %s > %s", es.c_str(), as.c_str());
|
| }
|
|
|
| -
|
| template <typename E, typename A>
|
| void DynamicAssertionHelper::GreaterEqual(const E& left, const A& right) {
|
| if (left >= right) return;
|
| @@ -219,7 +207,6 @@ void DynamicAssertionHelper::GreaterEqual(const E& left, const A& right) {
|
| }
|
| #endif
|
|
|
| -
|
| template <typename T>
|
| T DynamicAssertionHelper::NotNull(const T p) {
|
| if (p != NULL) return p;
|
| @@ -229,7 +216,6 @@ T DynamicAssertionHelper::NotNull(const T p) {
|
|
|
| } // namespace dart
|
|
|
| -
|
| #define FATAL(error) dart::Assert(__FILE__, __LINE__).Fail("%s", error)
|
|
|
| #define FATAL1(format, p1) dart::Assert(__FILE__, __LINE__).Fail(format, (p1))
|
| @@ -246,7 +232,6 @@ T DynamicAssertionHelper::NotNull(const T p) {
|
|
|
| #define OUT_OF_MEMORY() FATAL("Out of memory.")
|
|
|
| -
|
| #if defined(DEBUG)
|
| // DEBUG binaries use assertions in the code.
|
| // Note: We wrap the if statement in a do-while so that we get a compile
|
| @@ -281,13 +266,11 @@ T DynamicAssertionHelper::NotNull(const T p) {
|
|
|
| #endif // if defined(DEBUG)
|
|
|
| -
|
| #define RELEASE_ASSERT(cond) \
|
| do { \
|
| if (!(cond)) dart::Assert(__FILE__, __LINE__).Fail("expected: %s", #cond); \
|
| } while (false)
|
|
|
| -
|
| // The COMPILE_ASSERT macro can be used to verify that a compile time
|
| // expression is true. For example, you could use it to verify the
|
| // size of a static array:
|
|
|