UTPP
Loading...
Searching...
No Matches
Compatibility Macros
#define EXPECT_TRUE(x)
 
#define EXPECT_FALSE(x)
 
#define EXPECT_EQ(A, B)
 
#define EXPECT_NE(A, B)
 
#define EXPECT_GE(A, B)
 
#define EXPECT_GT(A, B)
 
#define EXPECT_LE(A, B)
 
#define EXPECT_LT(A, B)
 
#define EXPECT_NEAR(A, B, tol)
 
#define EXPECT_THROW(expr, except)
 
#define ASSERT_TRUE(expr)
 
#define ASSERT_FALSE(expr)
 
#define ASSERT_EQ(e1, e2)
 
#define ASSERT_NE(e1, e2)
 
#define ASSERT_GE(e1, e2)
 
#define ASSERT_GT(e1, e2)
 
#define ASSERT_LE(e1, e2)
 
#define ASSERT_LT(e1, e2)
 

Detailed Description

Macro Definition Documentation

◆ ASSERT_EQ

#define ASSERT_EQ ( e1,
e2 )
Value:
do \
{ \
std::string str__; \
if (!UnitTest::CheckEqual((e1), (e2), str__)) \
throw UnitTest::test_abort (__FILE__, __LINE__, str__.c_str()); \
} while (0)
bool CheckEqual(const expected_T &expected, const actual_T &actual, std::string &msg)
Definition checks.h:535
Exception thrown by ABORT macro.
Definition utpp.h:449

These macro definitions provide some compatibility with GoogleTest

◆ ASSERT_FALSE

#define ASSERT_FALSE ( expr)
Value:
ABORT (expr)
#define ABORT(value)
Abort current test if value is true. Abort message is the value itself.
Definition utpp.h:180

These macro definitions provide some compatibility with GoogleTest

◆ ASSERT_GE

#define ASSERT_GE ( e1,
e2 )
Value:
ABORT ((e1) < (e2))

These macro definitions provide some compatibility with GoogleTest

◆ ASSERT_GT

#define ASSERT_GT ( e1,
e2 )
Value:
ABORT ((e1) <= (e2))

These macro definitions provide some compatibility with GoogleTest

◆ ASSERT_LE

#define ASSERT_LE ( e1,
e2 )
Value:
ABORT ((e1) > (e2))

These macro definitions provide some compatibility with GoogleTest

◆ ASSERT_LT

#define ASSERT_LT ( e1,
e2 )
Value:
ABORT ((e1) >= (e2))

These macro definitions provide some compatibility with GoogleTest

◆ ASSERT_NE

#define ASSERT_NE ( e1,
e2 )
Value:
do \
{ \
std::string str__; \
if (UnitTest::CheckEqual ((e1), (e2), str__)) \
{ \
std::stringstream stream__; \
stream__ << (e1) << " and " << (e2) << " should be different"; \
throw UnitTest::test_abort (__FILE__, __LINE__, stream__.str ().c_str ());\
} \
} while (0)

These macro definitions provide some compatibility with GoogleTest

◆ ASSERT_TRUE

#define ASSERT_TRUE ( expr)
Value:
ABORT (!(expr))

These macro definitions provide some compatibility with GoogleTest

◆ EXPECT_EQ

#define EXPECT_EQ ( A,
B )
Value:
#define CHECK_EQUAL(expected, actual)
Generate a failure if actual value is different from expected.
Definition checks.h:91

These macro definitions provide some compatibility with GoogleTest

◆ EXPECT_FALSE

#define EXPECT_FALSE ( x)
Value:
CHECK (!(x))
#define CHECK(value)
Generate a failure if value is 0. Failure message is the value itself.
Definition checks.h:43

These macro definitions provide some compatibility with GoogleTest

◆ EXPECT_GE

#define EXPECT_GE ( A,
B )
Value:
CHECK ((A) >= (B))

These macro definitions provide some compatibility with GoogleTest

◆ EXPECT_GT

#define EXPECT_GT ( A,
B )
Value:
CHECK ((A) > (B))

These macro definitions provide some compatibility with GoogleTest

◆ EXPECT_LE

#define EXPECT_LE ( A,
B )
Value:
CHECK ((A) <= (B))

These macro definitions provide some compatibility with GoogleTest

◆ EXPECT_LT

#define EXPECT_LT ( A,
B )
Value:
CHECK ((A) < (B))

These macro definitions provide some compatibility with GoogleTest

◆ EXPECT_NE

#define EXPECT_NE ( A,
B )
Value:
do \
{ \
try { \
std::string str__; \
if (UnitTest::CheckEqual ((A), (B), str__)) \
UnitTest::ReportFailure (__FILE__, __LINE__, str__); \
} \
catch (...) { \
UnitTest::ReportFailure (__FILE__, __LINE__, \
"Unhandled exception in CHECK_EQUAL(" #A ", " #B ")"); \
} \
} while (0)

These macro definitions provide some compatibility with GoogleTest

◆ EXPECT_NEAR

#define EXPECT_NEAR ( A,
B,
tol )
Value:
CHECK_CLOSE(B, A, tol)
#define CHECK_CLOSE(expected, actual,...)
Generate a failure if actual value differs from expected value with more than tolerance.
Definition checks.h:169

These macro definitions provide some compatibility with GoogleTest

◆ EXPECT_THROW

#define EXPECT_THROW ( expr,
except )
Value:
CHECK_THROW(expr, except)
#define CHECK_THROW(expr, except)
Generate a failure if evaluating the expression does not throw an exception of the expected type.
Definition checks.h:341

These macro definitions provide some compatibility with GoogleTest

◆ EXPECT_TRUE

#define EXPECT_TRUE ( x)
Value:
CHECK (x)

These macro definitions provide some compatibility with GoogleTest