proxygen
SafeAssertTest.cpp File Reference
#include <folly/lang/SafeAssert.h>
#include <glog/logging.h>
#include <folly/Benchmark.h>
#include <folly/portability/GTest.h>

Go to the source code of this file.

Functions

void fail ()
 
void succeed ()
 
 TEST (SafeAssert, AssertionFailure)
 

Function Documentation

void fail ( )

Definition at line 27 of file SafeAssertTest.cpp.

References FOLLY_SAFE_CHECK.

Referenced by TEST(), folly::TEST(), TEST_F(), and folly::test::TEST_F().

27  {
28  FOLLY_SAFE_CHECK(0 + 0, "hello");
29 }
#define FOLLY_SAFE_CHECK(expr, msg)
Definition: SafeAssert.h:35
void succeed ( )

Definition at line 32 of file SafeAssertTest.cpp.

References FOLLY_SAFE_CHECK.

Referenced by TEST().

32  {
33  FOLLY_SAFE_CHECK(1, "world");
34 }
#define FOLLY_SAFE_CHECK(expr, msg)
Definition: SafeAssert.h:35
TEST ( SafeAssert  ,
AssertionFailure   
)

Definition at line 36 of file SafeAssertTest.cpp.

References fail(), and succeed().

36  {
37  succeed();
38  EXPECT_DEATH(fail(), "Assertion failure: 0 \\+ 0");
39  EXPECT_DEATH(fail(), "Message: hello");
40 }
void succeed()
void fail()