Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
gtest.h File Reference
#include <limits>
#include <ostream>
#include <vector>
#include "gtest/internal/gtest-internal.h"
#include "gtest/internal/gtest-string.h"
#include "gtest/gtest-death-test.h"
#include "gtest/gtest-message.h"
#include "gtest/gtest-param-test.h"
#include "gtest/gtest-printers.h"
#include "gtest/gtest_prod.h"
#include "gtest/gtest-test-part.h"
#include "gtest/gtest-typed-test.h"
#include "gtest/gtest_pred_impl.h"
Include dependency graph for gtest.h:

Go to the source code of this file.

Classes

class  testing::AssertionResult
 
class  testing::Test
 
class  testing::TestProperty
 
class  testing::TestResult
 
class  testing::TestInfo
 
class  testing::TestCase
 
class  testing::Environment
 
class  testing::TestEventListener
 
class  testing::EmptyTestEventListener
 
class  testing::TestEventListeners
 
class  testing::UnitTest
 
class  testing::internal::EqHelper< lhs_is_null_literal >
 
class  testing::internal::EqHelper< true >
 
class  testing::internal::AssertHelper
 
class  testing::WithParamInterface< T >
 
class  testing::TestWithParam< T >
 
class  testing::ScopedTrace
 

Namespaces

namespace  testing
 
namespace  testing::internal
 

Macros

#define GTEST_IMPL_CMP_HELPER_(op_name, op)
 
#define ADD_FAILURE()
 
#define ADD_FAILURE_AT(file, line)
 
#define GTEST_FAIL()
 
#define FAIL()
 
#define GTEST_SUCCEED()
 
#define SUCCEED()
 
#define EXPECT_THROW(statement, expected_exception)
 
#define EXPECT_NO_THROW(statement)
 
#define EXPECT_ANY_THROW(statement)
 
#define ASSERT_THROW(statement, expected_exception)
 
#define ASSERT_NO_THROW(statement)
 
#define ASSERT_ANY_THROW(statement)
 
#define EXPECT_TRUE(condition)
 
#define EXPECT_FALSE(condition)
 
#define ASSERT_TRUE(condition)
 
#define ASSERT_FALSE(condition)
 
#define EXPECT_EQ(val1, val2)
 
#define EXPECT_NE(val1, val2)
 
#define EXPECT_LE(val1, val2)
 
#define EXPECT_LT(val1, val2)
 
#define EXPECT_GE(val1, val2)
 
#define EXPECT_GT(val1, val2)
 
#define GTEST_ASSERT_EQ(val1, val2)
 
#define GTEST_ASSERT_NE(val1, val2)
 
#define GTEST_ASSERT_LE(val1, val2)
 
#define GTEST_ASSERT_LT(val1, val2)
 
#define GTEST_ASSERT_GE(val1, val2)
 
#define GTEST_ASSERT_GT(val1, val2)
 
#define ASSERT_EQ(val1, val2)
 
#define ASSERT_NE(val1, val2)
 
#define ASSERT_LE(val1, val2)
 
#define ASSERT_LT(val1, val2)
 
#define ASSERT_GE(val1, val2)
 
#define ASSERT_GT(val1, val2)
 
#define EXPECT_STREQ(s1, s2)
 
#define EXPECT_STRNE(s1, s2)
 
#define EXPECT_STRCASEEQ(s1, s2)
 
#define EXPECT_STRCASENE(s1, s2)
 
#define ASSERT_STREQ(s1, s2)
 
#define ASSERT_STRNE(s1, s2)
 
#define ASSERT_STRCASEEQ(s1, s2)
 
#define ASSERT_STRCASENE(s1, s2)
 
#define EXPECT_FLOAT_EQ(val1, val2)
 
#define EXPECT_DOUBLE_EQ(val1, val2)
 
#define ASSERT_FLOAT_EQ(val1, val2)
 
#define ASSERT_DOUBLE_EQ(val1, val2)
 
#define EXPECT_NEAR(val1, val2, abs_error)
 
#define ASSERT_NEAR(val1, val2, abs_error)
 
#define ASSERT_NO_FATAL_FAILURE(statement)
 
#define EXPECT_NO_FATAL_FAILURE(statement)
 
#define SCOPED_TRACE(message)
 
#define GTEST_TEST(test_case_name, test_name)
 
#define TEST(test_case_name, test_name)
 
#define TEST_F(test_fixture, test_name)
 

Typedefs

typedef internal::TimeInMillis testing::TimeInMillis
 

Functions

 testing::GTEST_DECLARE_bool_ (also_run_disabled_tests)
 
 testing::GTEST_DECLARE_bool_ (break_on_failure)
 
 testing::GTEST_DECLARE_bool_ (catch_exceptions)
 
 testing::GTEST_DECLARE_string_ (color)
 
 testing::GTEST_DECLARE_string_ (filter)
 
 testing::GTEST_DECLARE_bool_ (list_tests)
 
 testing::GTEST_DECLARE_string_ (output)
 
 testing::GTEST_DECLARE_bool_ (print_time)
 
 testing::GTEST_DECLARE_bool_ (print_utf8)
 
 testing::GTEST_DECLARE_int32_ (random_seed)
 
 testing::GTEST_DECLARE_int32_ (repeat)
 
 testing::GTEST_DECLARE_bool_ (show_internal_stack_frames)
 
 testing::GTEST_DECLARE_bool_ (shuffle)
 
 testing::GTEST_DECLARE_int32_ (stack_trace_depth)
 
 testing::GTEST_DECLARE_bool_ (throw_on_failure)
 
 testing::GTEST_DECLARE_string_ (stream_result_to)
 
class UnitTestImpltesting::internal::GetUnitTestImpl ()
 
void testing::internal::ReportFailureInUnknownLocation (TestPartResult::Type result_type, const std::string &message)
 
GTEST_API_ AssertionResult testing::AssertionSuccess ()
 
GTEST_API_ AssertionResult testing::AssertionFailure ()
 
GTEST_API_ AssertionResult testing::AssertionFailure (const Message &msg)
 
Environmenttesting::AddGlobalTestEnvironment (Environment *env)
 
GTEST_API_ void testing::InitGoogleTest (int *argc, char **argv)
 
GTEST_API_ void testing::InitGoogleTest (int *argc, wchar_t **argv)
 
template<typename T1 , typename T2 >
AssertionResult testing::internal::CmpHelperEQFailure (const char *lhs_expression, const char *rhs_expression, const T1 &lhs, const T2 &rhs)
 
template<typename T1 , typename T2 >
AssertionResult testing::internal::CmpHelperEQ (const char *lhs_expression, const char *rhs_expression, const T1 &lhs, const T2 &rhs)
 
GTEST_API_ AssertionResult testing::internal::CmpHelperEQ (const char *lhs_expression, const char *rhs_expression, BiggestInt lhs, BiggestInt rhs)
 
template<typename T1 , typename T2 >
AssertionResult testing::internal::CmpHelperOpFailure (const char *expr1, const char *expr2, const T1 &val1, const T2 &val2, const char *op)
 
 testing::internal::GTEST_IMPL_CMP_HELPER_ (NE, !=)
 
 testing::internal::GTEST_IMPL_CMP_HELPER_ (LE,<=)
 
 testing::internal::GTEST_IMPL_CMP_HELPER_ (LT,<)
 
 testing::internal::GTEST_IMPL_CMP_HELPER_ (GE, >=)
 
 testing::internal::GTEST_IMPL_CMP_HELPER_ (GT, >)
 
GTEST_API_ AssertionResult testing::internal::CmpHelperSTREQ (const char *s1_expression, const char *s2_expression, const char *s1, const char *s2)
 
GTEST_API_ AssertionResult testing::internal::CmpHelperSTRCASEEQ (const char *s1_expression, const char *s2_expression, const char *s1, const char *s2)
 
GTEST_API_ AssertionResult testing::internal::CmpHelperSTRNE (const char *s1_expression, const char *s2_expression, const char *s1, const char *s2)
 
GTEST_API_ AssertionResult testing::internal::CmpHelperSTRCASENE (const char *s1_expression, const char *s2_expression, const char *s1, const char *s2)
 
GTEST_API_ AssertionResult testing::internal::CmpHelperSTREQ (const char *s1_expression, const char *s2_expression, const wchar_t *s1, const wchar_t *s2)
 
GTEST_API_ AssertionResult testing::internal::CmpHelperSTRNE (const char *s1_expression, const char *s2_expression, const wchar_t *s1, const wchar_t *s2)
 
GTEST_API_ AssertionResult testing::IsSubstring (const char *needle_expr, const char *haystack_expr, const char *needle, const char *haystack)
 
GTEST_API_ AssertionResult testing::IsSubstring (const char *needle_expr, const char *haystack_expr, const wchar_t *needle, const wchar_t *haystack)
 
GTEST_API_ AssertionResult testing::IsNotSubstring (const char *needle_expr, const char *haystack_expr, const char *needle, const char *haystack)
 
GTEST_API_ AssertionResult testing::IsNotSubstring (const char *needle_expr, const char *haystack_expr, const wchar_t *needle, const wchar_t *haystack)
 
GTEST_API_ AssertionResult testing::IsSubstring (const char *needle_expr, const char *haystack_expr, const ::std::string &needle, const ::std::string &haystack)
 
GTEST_API_ AssertionResult testing::IsNotSubstring (const char *needle_expr, const char *haystack_expr, const ::std::string &needle, const ::std::string &haystack)
 
template<typename RawType >
AssertionResult testing::internal::CmpHelperFloatingPointEQ (const char *lhs_expression, const char *rhs_expression, RawType lhs_value, RawType rhs_value)
 
GTEST_API_ AssertionResult testing::internal::DoubleNearPredFormat (const char *expr1, const char *expr2, const char *abs_error_expr, double val1, double val2, double abs_error)
 
GTEST_API_ AssertionResult testing::FloatLE (const char *expr1, const char *expr2, float val1, float val2)
 
GTEST_API_ AssertionResult testing::DoubleLE (const char *expr1, const char *expr2, double val1, double val2)
 
template<typename T1 , typename T2 >
bool testing::StaticAssertTypeEq ()
 
GTEST_API_ std::string testing::TempDir ()
 
int RUN_ALL_TESTS () GTEST_MUST_USE_RESULT_
 

Variables

const int testing::kMaxStackTraceDepth = 100
 

Macro Definition Documentation

◆ ADD_FAILURE

#define ADD_FAILURE ( )
Value:
#define GTEST_NONFATAL_FAILURE_(message)

Definition at line 1844 of file gtest.h.

◆ ADD_FAILURE_AT

#define ADD_FAILURE_AT ( file,
line )
Value:
GTEST_MESSAGE_AT_(file, line, "Failed", \
#define GTEST_MESSAGE_AT_(file, line, message, result_type)

Definition at line 1848 of file gtest.h.

1848#define ADD_FAILURE_AT(file, line) \
1849 GTEST_MESSAGE_AT_(file, line, "Failed", \
1850 ::testing::TestPartResult::kNonFatalFailure)

◆ ASSERT_ANY_THROW

#define ASSERT_ANY_THROW ( statement)
Value:
#define GTEST_FATAL_FAILURE_(message)
#define GTEST_TEST_ANY_THROW_(statement, fail)

Definition at line 1889 of file gtest.h.

1889#define ASSERT_ANY_THROW(statement) \
1890 GTEST_TEST_ANY_THROW_(statement, GTEST_FATAL_FAILURE_)

◆ ASSERT_DOUBLE_EQ

#define ASSERT_DOUBLE_EQ ( val1,
val2 )
Value:
val1, val2)
#define ASSERT_PRED_FORMAT2(pred_format, v1, v2)
AssertionResult CmpHelperFloatingPointEQ(const char *lhs_expression, const char *rhs_expression, RawType lhs_value, RawType rhs_value)
Definition gtest.h:1670

Definition at line 2071 of file gtest.h.

2071#define ASSERT_DOUBLE_EQ(val1, val2)\
2072 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
2073 val1, val2)

◆ ASSERT_EQ

#define ASSERT_EQ ( val1,
val2 )
Value:
GTEST_ASSERT_EQ(val1, val2)
#define GTEST_ASSERT_EQ(val1, val2)
Definition gtest.h:1969

Definition at line 1988 of file gtest.h.

◆ ASSERT_FALSE

#define ASSERT_FALSE ( condition)
Value:
GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
#define GTEST_TEST_BOOLEAN_(expression, text, actual, expected, fail)

Definition at line 1904 of file gtest.h.

1904#define ASSERT_FALSE(condition) \
1905 GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
1906 GTEST_FATAL_FAILURE_)

◆ ASSERT_FLOAT_EQ

#define ASSERT_FLOAT_EQ ( val1,
val2 )
Value:

Definition at line 2067 of file gtest.h.

2067#define ASSERT_FLOAT_EQ(val1, val2)\
2068 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
2069 val1, val2)

◆ ASSERT_GE

#define ASSERT_GE ( val1,
val2 )
Value:
GTEST_ASSERT_GE(val1, val2)
#define GTEST_ASSERT_GE(val1, val2)
Definition gtest.h:1979

Definition at line 2004 of file gtest.h.

◆ ASSERT_GT

#define ASSERT_GT ( val1,
val2 )
Value:
GTEST_ASSERT_GT(val1, val2)
#define GTEST_ASSERT_GT(val1, val2)
Definition gtest.h:1981

Definition at line 2008 of file gtest.h.

◆ ASSERT_LE

#define ASSERT_LE ( val1,
val2 )
Value:
GTEST_ASSERT_LE(val1, val2)
#define GTEST_ASSERT_LE(val1, val2)
Definition gtest.h:1975

Definition at line 1996 of file gtest.h.

◆ ASSERT_LT

#define ASSERT_LT ( val1,
val2 )
Value:
GTEST_ASSERT_LT(val1, val2)
#define GTEST_ASSERT_LT(val1, val2)
Definition gtest.h:1977

Definition at line 2000 of file gtest.h.

◆ ASSERT_NE

#define ASSERT_NE ( val1,
val2 )
Value:
GTEST_ASSERT_NE(val1, val2)
#define GTEST_ASSERT_NE(val1, val2)
Definition gtest.h:1973

Definition at line 1992 of file gtest.h.

◆ ASSERT_NEAR

#define ASSERT_NEAR ( val1,
val2,
abs_error )
Value:
val1, val2, abs_error)
#define ASSERT_PRED_FORMAT3(pred_format, v1, v2, v3)
GTEST_API_ AssertionResult DoubleNearPredFormat(const char *expr1, const char *expr2, const char *abs_error_expr, double val1, double val2, double abs_error)
Definition gtest.cc:1377

Definition at line 2079 of file gtest.h.

2079#define ASSERT_NEAR(val1, val2, abs_error)\
2080 ASSERT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
2081 val1, val2, abs_error)

◆ ASSERT_NO_FATAL_FAILURE

#define ASSERT_NO_FATAL_FAILURE ( statement)
Value:
#define GTEST_TEST_NO_FATAL_FAILURE_(statement, fail)

Definition at line 2131 of file gtest.h.

2131#define ASSERT_NO_FATAL_FAILURE(statement) \
2132 GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_FATAL_FAILURE_)

◆ ASSERT_NO_THROW

#define ASSERT_NO_THROW ( statement)
Value:
#define GTEST_TEST_NO_THROW_(statement, fail)

Definition at line 1887 of file gtest.h.

1887#define ASSERT_NO_THROW(statement) \
1888 GTEST_TEST_NO_THROW_(statement, GTEST_FATAL_FAILURE_)

◆ ASSERT_STRCASEEQ

#define ASSERT_STRCASEEQ ( s1,
s2 )
Value:
GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char *s1_expression, const char *s2_expression, const char *s1, const char *s2)
Definition gtest.cc:1518

Definition at line 2040 of file gtest.h.

2040#define ASSERT_STRCASEEQ(s1, s2) \
2041 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, s1, s2)

◆ ASSERT_STRCASENE

#define ASSERT_STRCASENE ( s1,
s2 )
Value:
GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char *s1_expression, const char *s2_expression, const char *s1, const char *s2)
Definition gtest.cc:1548

Definition at line 2042 of file gtest.h.

2042#define ASSERT_STRCASENE(s1, s2)\
2043 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)

◆ ASSERT_STREQ

#define ASSERT_STREQ ( s1,
s2 )
Value:
GTEST_API_ AssertionResult CmpHelperSTREQ(const char *s1_expression, const char *s2_expression, const char *s1, const char *s2)
Definition gtest.cc:1502

Definition at line 2036 of file gtest.h.

2036#define ASSERT_STREQ(s1, s2) \
2037 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, s1, s2)

◆ ASSERT_STRNE

#define ASSERT_STRNE ( s1,
s2 )
Value:
GTEST_API_ AssertionResult CmpHelperSTRNE(const char *s1_expression, const char *s2_expression, const char *s1, const char *s2)
Definition gtest.cc:1534

Definition at line 2038 of file gtest.h.

2038#define ASSERT_STRNE(s1, s2) \
2039 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)

◆ ASSERT_THROW

#define ASSERT_THROW ( statement,
expected_exception )
Value:
GTEST_TEST_THROW_(statement, expected_exception, GTEST_FATAL_FAILURE_)
#define GTEST_TEST_THROW_(statement, expected_exception, fail)

Definition at line 1885 of file gtest.h.

1885#define ASSERT_THROW(statement, expected_exception) \
1886 GTEST_TEST_THROW_(statement, expected_exception, GTEST_FATAL_FAILURE_)

◆ ASSERT_TRUE

#define ASSERT_TRUE ( condition)
Value:
GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \

Definition at line 1901 of file gtest.h.

1901#define ASSERT_TRUE(condition) \
1902 GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
1903 GTEST_FATAL_FAILURE_)

◆ EXPECT_ANY_THROW

#define EXPECT_ANY_THROW ( statement)
Value:

Definition at line 1883 of file gtest.h.

1883#define EXPECT_ANY_THROW(statement) \
1884 GTEST_TEST_ANY_THROW_(statement, GTEST_NONFATAL_FAILURE_)

◆ EXPECT_DOUBLE_EQ

#define EXPECT_DOUBLE_EQ ( val1,
val2 )
Value:
val1, val2)
#define EXPECT_PRED_FORMAT2(pred_format, v1, v2)

Definition at line 2063 of file gtest.h.

2063#define EXPECT_DOUBLE_EQ(val1, val2)\
2064 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
2065 val1, val2)

◆ EXPECT_EQ

#define EXPECT_EQ ( val1,
val2 )
Value:
EXPECT_PRED_FORMAT2(::testing::internal:: \
EqHelper<GTEST_IS_NULL_LITERAL_(val1)>::Compare, \
val1, val2)
#define GTEST_IS_NULL_LITERAL_(x)

Definition at line 1954 of file gtest.h.

1954#define EXPECT_EQ(val1, val2) \
1955 EXPECT_PRED_FORMAT2(::testing::internal:: \
1956 EqHelper<GTEST_IS_NULL_LITERAL_(val1)>::Compare, \
1957 val1, val2)

◆ EXPECT_FALSE

#define EXPECT_FALSE ( condition)
Value:
GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \

Definition at line 1898 of file gtest.h.

1898#define EXPECT_FALSE(condition) \
1899 GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
1900 GTEST_NONFATAL_FAILURE_)

◆ EXPECT_FLOAT_EQ

#define EXPECT_FLOAT_EQ ( val1,
val2 )
Value:

Definition at line 2059 of file gtest.h.

2059#define EXPECT_FLOAT_EQ(val1, val2)\
2060 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
2061 val1, val2)

◆ EXPECT_GE

#define EXPECT_GE ( val1,
val2 )
Value:
EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)

Definition at line 1964 of file gtest.h.

1964#define EXPECT_GE(val1, val2) \
1965 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)

◆ EXPECT_GT

#define EXPECT_GT ( val1,
val2 )
Value:
EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)

Definition at line 1966 of file gtest.h.

1966#define EXPECT_GT(val1, val2) \
1967 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)

◆ EXPECT_LE

#define EXPECT_LE ( val1,
val2 )
Value:
EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)

Definition at line 1960 of file gtest.h.

1960#define EXPECT_LE(val1, val2) \
1961 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)

◆ EXPECT_LT

#define EXPECT_LT ( val1,
val2 )
Value:
EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)

Definition at line 1962 of file gtest.h.

1962#define EXPECT_LT(val1, val2) \
1963 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)

◆ EXPECT_NE

#define EXPECT_NE ( val1,
val2 )
Value:
EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)

Definition at line 1958 of file gtest.h.

1958#define EXPECT_NE(val1, val2) \
1959 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)

◆ EXPECT_NEAR

#define EXPECT_NEAR ( val1,
val2,
abs_error )
Value:
val1, val2, abs_error)
#define EXPECT_PRED_FORMAT3(pred_format, v1, v2, v3)

Definition at line 2075 of file gtest.h.

2075#define EXPECT_NEAR(val1, val2, abs_error)\
2076 EXPECT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
2077 val1, val2, abs_error)

◆ EXPECT_NO_FATAL_FAILURE

#define EXPECT_NO_FATAL_FAILURE ( statement)
Value:

Definition at line 2133 of file gtest.h.

2133#define EXPECT_NO_FATAL_FAILURE(statement) \
2134 GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_NONFATAL_FAILURE_)

◆ EXPECT_NO_THROW

#define EXPECT_NO_THROW ( statement)
Value:

Definition at line 1881 of file gtest.h.

1881#define EXPECT_NO_THROW(statement) \
1882 GTEST_TEST_NO_THROW_(statement, GTEST_NONFATAL_FAILURE_)

◆ EXPECT_STRCASEEQ

#define EXPECT_STRCASEEQ ( s1,
s2 )
Value:

Definition at line 2031 of file gtest.h.

2031#define EXPECT_STRCASEEQ(s1, s2) \
2032 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, s1, s2)

◆ EXPECT_STRCASENE

#define EXPECT_STRCASENE ( s1,
s2 )
Value:

Definition at line 2033 of file gtest.h.

2033#define EXPECT_STRCASENE(s1, s2)\
2034 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)

◆ EXPECT_STREQ

#define EXPECT_STREQ ( s1,
s2 )
Value:

Definition at line 2027 of file gtest.h.

2027#define EXPECT_STREQ(s1, s2) \
2028 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, s1, s2)

◆ EXPECT_STRNE

#define EXPECT_STRNE ( s1,
s2 )
Value:

Definition at line 2029 of file gtest.h.

2029#define EXPECT_STRNE(s1, s2) \
2030 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)

◆ EXPECT_THROW

#define EXPECT_THROW ( statement,
expected_exception )
Value:
GTEST_TEST_THROW_(statement, expected_exception, GTEST_NONFATAL_FAILURE_)

Definition at line 1879 of file gtest.h.

1879#define EXPECT_THROW(statement, expected_exception) \
1880 GTEST_TEST_THROW_(statement, expected_exception, GTEST_NONFATAL_FAILURE_)

◆ EXPECT_TRUE

#define EXPECT_TRUE ( condition)
Value:
GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \

Definition at line 1895 of file gtest.h.

1895#define EXPECT_TRUE(condition) \
1896 GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
1897 GTEST_NONFATAL_FAILURE_)

◆ FAIL

#define FAIL ( )
Value:
#define GTEST_FAIL()
Definition gtest.h:1853

Definition at line 1858 of file gtest.h.

◆ GTEST_ASSERT_EQ

#define GTEST_ASSERT_EQ ( val1,
val2 )
Value:
ASSERT_PRED_FORMAT2(::testing::internal:: \
EqHelper<GTEST_IS_NULL_LITERAL_(val1)>::Compare, \
val1, val2)

Definition at line 1969 of file gtest.h.

1969#define GTEST_ASSERT_EQ(val1, val2) \
1970 ASSERT_PRED_FORMAT2(::testing::internal:: \
1971 EqHelper<GTEST_IS_NULL_LITERAL_(val1)>::Compare, \
1972 val1, val2)

◆ GTEST_ASSERT_GE

#define GTEST_ASSERT_GE ( val1,
val2 )
Value:
ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)

Definition at line 1979 of file gtest.h.

1979#define GTEST_ASSERT_GE(val1, val2) \
1980 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)

◆ GTEST_ASSERT_GT

#define GTEST_ASSERT_GT ( val1,
val2 )
Value:
ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)

Definition at line 1981 of file gtest.h.

1981#define GTEST_ASSERT_GT(val1, val2) \
1982 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)

◆ GTEST_ASSERT_LE

#define GTEST_ASSERT_LE ( val1,
val2 )
Value:
ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)

Definition at line 1975 of file gtest.h.

1975#define GTEST_ASSERT_LE(val1, val2) \
1976 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)

◆ GTEST_ASSERT_LT

#define GTEST_ASSERT_LT ( val1,
val2 )
Value:
ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)

Definition at line 1977 of file gtest.h.

1977#define GTEST_ASSERT_LT(val1, val2) \
1978 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)

◆ GTEST_ASSERT_NE

#define GTEST_ASSERT_NE ( val1,
val2 )
Value:
ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)

Definition at line 1973 of file gtest.h.

1973#define GTEST_ASSERT_NE(val1, val2) \
1974 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)

◆ GTEST_FAIL

#define GTEST_FAIL ( )
Value:

Definition at line 1853 of file gtest.h.

◆ GTEST_IMPL_CMP_HELPER_

#define GTEST_IMPL_CMP_HELPER_ ( op_name,
op )
Value:
template <typename T1, typename T2>\
AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \
const T1& val1, const T2& val2) {\
if (val1 op val2) {\
return AssertionSuccess();\
} else {\
return CmpHelperOpFailure(expr1, expr2, val1, val2, #op);\
}\
}\
GTEST_API_ AssertionResult CmpHelper##op_name(\
const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2)
#define GTEST_API_
Definition gtest-port.h:984

Definition at line 1545 of file gtest.h.

1545#define GTEST_IMPL_CMP_HELPER_(op_name, op)\
1546template <typename T1, typename T2>\
1547AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \
1548 const T1& val1, const T2& val2) {\
1549 if (val1 op val2) {\
1550 return AssertionSuccess();\
1551 } else {\
1552 return CmpHelperOpFailure(expr1, expr2, val1, val2, #op);\
1553 }\
1554}\
1555GTEST_API_ AssertionResult CmpHelper##op_name(\
1556 const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2)

◆ GTEST_SUCCEED

#define GTEST_SUCCEED ( )
Value:
GTEST_SUCCESS_("Succeeded")
#define GTEST_SUCCESS_(message)

Definition at line 1862 of file gtest.h.

◆ GTEST_TEST

#define GTEST_TEST ( test_case_name,
test_name )
Value:
GTEST_TEST_(test_case_name, test_name, \
#define GTEST_TEST_(test_case_name, test_name, parent_class, parent_id)
GTEST_API_ TypeId GetTestTypeId()
Definition gtest.cc:637

Definition at line 2268 of file gtest.h.

2268#define GTEST_TEST(test_case_name, test_name)\
2269 GTEST_TEST_(test_case_name, test_name, \
2270 ::testing::Test, ::testing::internal::GetTestTypeId())

◆ SCOPED_TRACE

#define SCOPED_TRACE ( message)
Value:
::testing::ScopedTrace GTEST_CONCAT_TOKEN_(gtest_trace_, __LINE__)(\
__FILE__, __LINE__, (message))
#define GTEST_CONCAT_TOKEN_(foo, bar)

Definition at line 2202 of file gtest.h.

2202#define SCOPED_TRACE(message) \
2203 ::testing::ScopedTrace GTEST_CONCAT_TOKEN_(gtest_trace_, __LINE__)(\
2204 __FILE__, __LINE__, (message))

◆ SUCCEED

#define SUCCEED ( )
Value:
#define GTEST_SUCCEED()
Definition gtest.h:1862

Definition at line 1867 of file gtest.h.

◆ TEST

#define TEST ( test_case_name,
test_name )
Value:
GTEST_TEST(test_case_name, test_name)
#define GTEST_TEST(test_case_name, test_name)
Definition gtest.h:2268

Definition at line 2275 of file gtest.h.

◆ TEST_F

#define TEST_F ( test_fixture,
test_name )
Value:
GTEST_TEST_(test_fixture, test_name, test_fixture, \

Definition at line 2304 of file gtest.h.

2304#define TEST_F(test_fixture, test_name)\
2305 GTEST_TEST_(test_fixture, test_name, test_fixture, \
2306 ::testing::internal::GetTypeId<test_fixture>())

Function Documentation

◆ RUN_ALL_TESTS()

int RUN_ALL_TESTS ( )
inline

Definition at line 2328 of file gtest.h.

2328 {
2329 return ::testing::UnitTest::GetInstance()->Run();
2330}
Here is the caller graph for this function: