Flutter Engine
The Flutter Engine
Classes | Namespaces | Macros
assert.h File Reference
#include "platform/globals.h"
#include "platform/memory_sanitizer.h"

Go to the source code of this file.

Classes

class  dart::DynamicAssertionHelper
 
class  dart::Assert
 
class  dart::Expect
 

Namespaces

namespace  dart
 

Macros

#define FATAL(format, ...)    dart::Assert(__FILE__, __LINE__).Fail(format, ##__VA_ARGS__);
 
#define UNIMPLEMENTED()   FATAL("unimplemented code")
 
#define UNREACHABLE()   FATAL("unreachable code")
 
#define OUT_OF_MEMORY()   FATAL("Out of memory.")
 
#define ASSERT(condition)
 
#define ASSERT_EQUAL(expected, actual)
 
#define ASSERT_LESS_OR_EQUAL(expected, actual)
 
#define ASSERT_IMPLIES(antecedent, consequent)
 
#define DEBUG_ASSERT(cond)
 
#define ASSERT_NOTNULL(ptr)   (ptr)
 
#define RELEASE_ASSERT(cond)
 
#define RELEASE_ASSERT_WITH_MSG(cond, msg)
 
#define COMPILE_ASSERT(expr)   static_assert(expr, "")
 

Macro Definition Documentation

◆ ASSERT

#define ASSERT (   condition)
Value:
do { \
} while (false && (condition))

Definition at line 305 of file assert.h.

◆ ASSERT_EQUAL

#define ASSERT_EQUAL (   expected,
  actual 
)
Value:
do { \
} while (false && ((expected) != (actual)))

Definition at line 309 of file assert.h.

◆ ASSERT_IMPLIES

#define ASSERT_IMPLIES (   antecedent,
  consequent 
)
Value:
do { \
} while (false && (!(antecedent) || (consequent)))

Definition at line 317 of file assert.h.

◆ ASSERT_LESS_OR_EQUAL

#define ASSERT_LESS_OR_EQUAL (   expected,
  actual 
)
Value:
do { \
} while (false && ((actual) > (expected)))

Definition at line 313 of file assert.h.

◆ ASSERT_NOTNULL

#define ASSERT_NOTNULL (   ptr)    (ptr)

Definition at line 323 of file assert.h.

◆ COMPILE_ASSERT

#define COMPILE_ASSERT (   expr)    static_assert(expr, "")

Definition at line 339 of file assert.h.

◆ DEBUG_ASSERT

#define DEBUG_ASSERT (   cond)

Definition at line 321 of file assert.h.

◆ FATAL

#define FATAL (   format,
  ... 
)     dart::Assert(__FILE__, __LINE__).Fail(format, ##__VA_ARGS__);

Definition at line 242 of file assert.h.

◆ OUT_OF_MEMORY

#define OUT_OF_MEMORY ( )    FATAL("Out of memory.")

Definition at line 250 of file assert.h.

◆ RELEASE_ASSERT

#define RELEASE_ASSERT (   cond)
Value:
do { \
if (!(cond)) dart::Assert(__FILE__, __LINE__).Fail("expected: %s", #cond); \
} while (false)
DART_NORETURN void Fail(const char *format,...) const PRINTF_ATTRIBUTE(2
Definition: assert.cc:45

Definition at line 327 of file assert.h.

◆ RELEASE_ASSERT_WITH_MSG

#define RELEASE_ASSERT_WITH_MSG (   cond,
  msg 
)
Value:
do { \
if (!(cond)) { \
dart::Assert(__FILE__, __LINE__).Fail("%s: expected: %s", msg, #cond); \
} \
} while (false)

Definition at line 332 of file assert.h.

◆ UNIMPLEMENTED

#define UNIMPLEMENTED ( )    FATAL("unimplemented code")

Definition at line 246 of file assert.h.

◆ UNREACHABLE

#define UNREACHABLE ( )    FATAL("unreachable code")

Definition at line 248 of file assert.h.