51 #ifndef GTEST_INCLUDE_GTEST_GTEST_H_ 52 #define GTEST_INCLUDE_GTEST_GTEST_H_ 58 #include "gtest/internal/gtest-internal.h" 59 #include "gtest/internal/gtest-string.h" 60 #include "gtest/gtest-death-test.h" 61 #include "gtest/gtest-message.h" 62 #include "gtest/gtest-param-test.h" 63 #include "gtest/gtest-printers.h" 64 #include "gtest/gtest_prod.h" 65 #include "gtest/gtest-test-part.h" 66 #include "gtest/gtest-typed-test.h" 152 class DefaultGlobalTestPartResultReporter;
154 class NoExecDeathTest;
155 class FinalSuccessChecker;
156 class GTestFlagSaver;
157 class StreamingListenerTest;
158 class TestResultAccessor;
159 class TestEventListenersAccessor;
160 class TestEventRepeater;
161 class UnitTestRecordPropertyTestHelper;
162 class WindowsDeathTest;
271 template <
typename T>
277 : success_(success) {}
288 operator bool()
const {
return success_; }
298 return message_.get() != NULL ? message_->c_str() :
"";
306 AppendMessage(
Message() << value);
313 ::std::ostream& (*basic_manipulator)(::std::ostream&
stream)) {
314 AppendMessage(
Message() << basic_manipulator);
321 if (message_.get() == NULL)
323 message_->append(a_message.
GetString().c_str());
400 static bool HasFatalFailure();
403 static bool HasNonfatalFailure();
407 static bool HasFailure() {
return HasFatalFailure() || HasNonfatalFailure(); }
423 static void RecordProperty(
const std::string& key,
int value);
430 virtual void SetUp();
433 virtual void TearDown();
438 static bool HasSameFixtureClass();
446 virtual void TestBody() = 0;
492 key_(a_key), value_(a_value) {
502 return value_.c_str();
533 int total_part_count()
const;
536 int test_property_count()
const;
539 bool Passed()
const {
return !Failed(); }
545 bool HasFatalFailure()
const;
548 bool HasNonfatalFailure()
const;
568 friend class internal::ExecDeathTest;
571 friend class internal::WindowsDeathTest;
575 return test_part_results_;
580 return test_properties_;
592 void RecordProperty(
const std::string& xml_element,
598 static bool ValidateTestProperty(
const std::string& xml_element,
611 void ClearTestPartResults();
659 if (type_param_.get() != NULL)
660 return type_param_->c_str();
667 if (value_param_.get() != NULL)
668 return value_param_->c_str();
673 const char*
file()
const {
return location_.file.c_str(); }
676 int line()
const {
return location_.line; }
701 return matches_filter_;
708 #if GTEST_HAS_DEATH_TEST 709 friend class internal::DefaultDeathTestFactory;
710 #endif // GTEST_HAS_DEATH_TEST 714 friend class internal::StreamingListenerTest;
716 const char* test_case_name,
718 const char* type_param,
719 const char* value_param,
730 const char* a_type_param,
731 const char* a_value_param,
739 return result_.increment_death_test_count();
805 if (type_param_.get() != NULL)
806 return type_param_->c_str();
814 int successful_test_count()
const;
817 int failed_test_count()
const;
820 int reportable_disabled_test_count()
const;
823 int disabled_test_count()
const;
826 int reportable_test_count()
const;
829 int test_to_run_count()
const;
832 int total_test_count()
const;
835 bool Passed()
const {
return !Failed(); }
838 bool Failed()
const {
return failed_test_count() > 0; }
845 const TestInfo* GetTestInfo(
int i)
const;
860 return test_info_list_;
865 TestInfo* GetMutableTestInfo(
int i);
872 void AddTestInfo(
TestInfo * test_info);
928 void UnshuffleTests();
996 virtual void OnTestProgramStart(
const UnitTest& unit_test) = 0;
1001 virtual void OnTestIterationStart(
const UnitTest& unit_test,
1005 virtual void OnEnvironmentsSetUpStart(
const UnitTest& unit_test) = 0;
1008 virtual void OnEnvironmentsSetUpEnd(
const UnitTest& unit_test) = 0;
1011 virtual void OnTestCaseStart(
const TestCase& test_case) = 0;
1014 virtual void OnTestStart(
const TestInfo& test_info) = 0;
1017 virtual void OnTestPartResult(
const TestPartResult& test_part_result) = 0;
1020 virtual void OnTestEnd(
const TestInfo& test_info) = 0;
1023 virtual void OnTestCaseEnd(
const TestCase& test_case) = 0;
1026 virtual void OnEnvironmentsTearDownStart(
const UnitTest& unit_test) = 0;
1029 virtual void OnEnvironmentsTearDownEnd(
const UnitTest& unit_test) = 0;
1032 virtual void OnTestIterationEnd(
const UnitTest& unit_test,
1036 virtual void OnTestProgramEnd(
const UnitTest& unit_test) = 0;
1085 return default_result_printer_;
1096 return default_xml_generator_;
1103 friend class internal::NoExecDeathTest;
1127 bool EventForwardingEnabled()
const;
1128 void SuppressEventForwarding();
1168 const char* original_working_dir()
const;
1172 const TestCase* current_test_case()
const 1177 const TestInfo* current_test_info()
const 1181 int random_seed()
const;
1183 #if GTEST_HAS_PARAM_TEST 1188 internal::ParameterizedTestCaseRegistry& parameterized_test_registry()
1190 #endif // GTEST_HAS_PARAM_TEST 1193 int successful_test_case_count()
const;
1196 int failed_test_case_count()
const;
1199 int total_test_case_count()
const;
1203 int test_case_to_run_count()
const;
1206 int successful_test_count()
const;
1209 int failed_test_count()
const;
1212 int reportable_disabled_test_count()
const;
1215 int disabled_test_count()
const;
1218 int reportable_test_count()
const;
1221 int total_test_count()
const;
1224 int test_to_run_count()
const;
1228 TimeInMillis start_timestamp()
const;
1231 TimeInMillis elapsed_time()
const;
1234 bool Passed()
const;
1238 bool Failed()
const;
1242 const TestCase* GetTestCase(
int i)
const;
1246 const TestResult& ad_hoc_test_result()
const;
1269 const char* file_name,
1284 TestCase* GetMutableTestCase(
int i);
1295 friend class internal::StreamingListenerTest;
1315 void PopGTestTrace()
1316 GTEST_LOCK_EXCLUDED_(
mutex_);
1326 internal::UnitTestImpl* impl_;
1369 namespace internal {
1374 template <
typename T1,
typename T2>
1376 const char* rhs_expression,
1377 const T1& lhs,
const T2&
rhs) {
1386 template <
typename T1,
typename T2>
1388 const char* rhs_expression,
1404 const char* rhs_expression,
1412 template <
bool lhs_is_null_literal>
1416 template <
typename T1,
typename T2>
1418 const char* rhs_expression,
1421 return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
1431 const char* rhs_expression,
1434 return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
1447 template <
typename T1,
typename T2>
1449 const char* lhs_expression,
1450 const char* rhs_expression,
1459 return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
1464 template <
typename T>
1466 const char* lhs_expression,
1467 const char* rhs_expression,
1477 return CmpHelperEQ(lhs_expression, rhs_expression,
1478 static_cast<T*>(NULL), rhs);
1485 template <
typename T1,
typename T2>
1487 const T1& val1,
const T2& val2,
1490 <<
"Expected: (" << expr1 <<
") " << op <<
" (" << expr2
1506 #define GTEST_IMPL_CMP_HELPER_(op_name, op)\ 1507 template <typename T1, typename T2>\ 1508 AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \ 1509 const T1& val1, const T2& val2) {\ 1510 if (val1 op val2) {\ 1511 return AssertionSuccess();\ 1513 return CmpHelperOpFailure(expr1, expr2, val1, val2, #op);\ 1516 GTEST_API_ AssertionResult CmpHelper##op_name(\ 1517 const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2) 1532 #undef GTEST_IMPL_CMP_HELPER_ 1538 const char* s2_expression,
1546 const char* s2_expression,
1554 const char* s2_expression,
1562 const char* s2_expression,
1571 const char* s2_expression,
1579 const char* s2_expression,
1594 const char* needle_expr,
const char* haystack_expr,
1595 const char*
needle,
const char* haystack);
1597 const char* needle_expr,
const char* haystack_expr,
1598 const wchar_t*
needle,
const wchar_t* haystack);
1600 const char* needle_expr,
const char* haystack_expr,
1601 const char*
needle,
const char* haystack);
1603 const char* needle_expr,
const char* haystack_expr,
1604 const wchar_t*
needle,
const wchar_t* haystack);
1606 const char* needle_expr,
const char* haystack_expr,
1609 const char* needle_expr,
const char* haystack_expr,
1612 #if GTEST_HAS_STD_WSTRING 1614 const char* needle_expr,
const char* haystack_expr,
1617 const char* needle_expr,
const char* haystack_expr,
1619 #endif // GTEST_HAS_STD_WSTRING 1621 namespace internal {
1630 template <
typename RawType>
1632 const char* rhs_expression,
1634 RawType rhs_value) {
1637 if (lhs.AlmostEquals(rhs)) {
1641 ::std::stringstream lhs_ss;
1645 ::std::stringstream rhs_ss;
1661 const char* abs_error_expr,
1674 const char* message);
1679 void operator=(
const Message& message)
const;
1688 const char* srcfile,
1691 : type(t), file(srcfile), line(line_num), message(msg) { }
1709 #if GTEST_HAS_PARAM_TEST 1744 template <
typename T>
1745 class WithParamInterface {
1747 typedef T ParamType;
1748 virtual ~WithParamInterface() {}
1755 const ParamType& GetParam()
const {
1757 <<
"GetParam() can only be called inside a value-parameterized test " 1758 <<
"-- did you intend to write TEST_P instead of TEST_F?";
1765 static void SetParam(
const ParamType* parameter) {
1766 parameter_ = parameter;
1770 static const ParamType* parameter_;
1773 template <
class TestClass>
friend class internal::ParameterizedTestFactory;
1776 template <
typename T>
1777 const T* WithParamInterface<T>::parameter_ = NULL;
1782 template <
typename T>
1783 class TestWithParam :
public Test,
public WithParamInterface<T> {
1786 #endif // GTEST_HAS_PARAM_TEST 1808 #define ADD_FAILURE() GTEST_NONFATAL_FAILURE_("Failed") 1812 #define ADD_FAILURE_AT(file, line) \ 1813 GTEST_MESSAGE_AT_(file, line, "Failed", \ 1814 ::testing::TestPartResult::kNonFatalFailure) 1817 #define GTEST_FAIL() GTEST_FATAL_FAILURE_("Failed") 1821 #if !GTEST_DONT_DEFINE_FAIL 1822 # define FAIL() GTEST_FAIL() 1826 #define GTEST_SUCCEED() GTEST_SUCCESS_("Succeeded") 1830 #if !GTEST_DONT_DEFINE_SUCCEED 1831 # define SUCCEED() GTEST_SUCCEED() 1843 #define EXPECT_THROW(statement, expected_exception) \ 1844 GTEST_TEST_THROW_(statement, expected_exception, GTEST_NONFATAL_FAILURE_) 1845 #define EXPECT_NO_THROW(statement) \ 1846 GTEST_TEST_NO_THROW_(statement, GTEST_NONFATAL_FAILURE_) 1847 #define EXPECT_ANY_THROW(statement) \ 1848 GTEST_TEST_ANY_THROW_(statement, GTEST_NONFATAL_FAILURE_) 1849 #define ASSERT_THROW(statement, expected_exception) \ 1850 GTEST_TEST_THROW_(statement, expected_exception, GTEST_FATAL_FAILURE_) 1851 #define ASSERT_NO_THROW(statement) \ 1852 GTEST_TEST_NO_THROW_(statement, GTEST_FATAL_FAILURE_) 1853 #define ASSERT_ANY_THROW(statement) \ 1854 GTEST_TEST_ANY_THROW_(statement, GTEST_FATAL_FAILURE_) 1859 #define EXPECT_TRUE(condition) \ 1860 GTEST_TEST_BOOLEAN_((condition), #condition, false, true, \ 1861 GTEST_NONFATAL_FAILURE_) 1862 #define EXPECT_FALSE(condition) \ 1863 GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \ 1864 GTEST_NONFATAL_FAILURE_) 1865 #define ASSERT_TRUE(condition) \ 1866 GTEST_TEST_BOOLEAN_((condition), #condition, false, true, \ 1867 GTEST_FATAL_FAILURE_) 1868 #define ASSERT_FALSE(condition) \ 1869 GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \ 1870 GTEST_FATAL_FAILURE_) 1874 #include "gtest/gtest_pred_impl.h" 1922 #define EXPECT_EQ(val1, val2) \ 1923 EXPECT_PRED_FORMAT2(::testing::internal:: \ 1924 EqHelper<GTEST_IS_NULL_LITERAL_(val1)>::Compare, \ 1926 #define EXPECT_NE(val1, val2) \ 1927 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2) 1928 #define EXPECT_LE(val1, val2) \ 1929 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2) 1930 #define EXPECT_LT(val1, val2) \ 1931 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2) 1932 #define EXPECT_GE(val1, val2) \ 1933 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2) 1934 #define EXPECT_GT(val1, val2) \ 1935 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2) 1937 #define GTEST_ASSERT_EQ(val1, val2) \ 1938 ASSERT_PRED_FORMAT2(::testing::internal:: \ 1939 EqHelper<GTEST_IS_NULL_LITERAL_(val1)>::Compare, \ 1941 #define GTEST_ASSERT_NE(val1, val2) \ 1942 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2) 1943 #define GTEST_ASSERT_LE(val1, val2) \ 1944 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2) 1945 #define GTEST_ASSERT_LT(val1, val2) \ 1946 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2) 1947 #define GTEST_ASSERT_GE(val1, val2) \ 1948 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2) 1949 #define GTEST_ASSERT_GT(val1, val2) \ 1950 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2) 1955 #if !GTEST_DONT_DEFINE_ASSERT_EQ 1956 # define ASSERT_EQ(val1, val2) GTEST_ASSERT_EQ(val1, val2) 1959 #if !GTEST_DONT_DEFINE_ASSERT_NE 1960 # define ASSERT_NE(val1, val2) GTEST_ASSERT_NE(val1, val2) 1963 #if !GTEST_DONT_DEFINE_ASSERT_LE 1964 # define ASSERT_LE(val1, val2) GTEST_ASSERT_LE(val1, val2) 1967 #if !GTEST_DONT_DEFINE_ASSERT_LT 1968 # define ASSERT_LT(val1, val2) GTEST_ASSERT_LT(val1, val2) 1971 #if !GTEST_DONT_DEFINE_ASSERT_GE 1972 # define ASSERT_GE(val1, val2) GTEST_ASSERT_GE(val1, val2) 1975 #if !GTEST_DONT_DEFINE_ASSERT_GT 1976 # define ASSERT_GT(val1, val2) GTEST_ASSERT_GT(val1, val2) 1995 #define EXPECT_STREQ(s1, s2) \ 1996 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, s1, s2) 1997 #define EXPECT_STRNE(s1, s2) \ 1998 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2) 1999 #define EXPECT_STRCASEEQ(s1, s2) \ 2000 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, s1, s2) 2001 #define EXPECT_STRCASENE(s1, s2)\ 2002 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2) 2004 #define ASSERT_STREQ(s1, s2) \ 2005 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, s1, s2) 2006 #define ASSERT_STRNE(s1, s2) \ 2007 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2) 2008 #define ASSERT_STRCASEEQ(s1, s2) \ 2009 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, s1, s2) 2010 #define ASSERT_STRCASENE(s1, s2)\ 2011 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2) 2027 #define EXPECT_FLOAT_EQ(val1, val2)\ 2028 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \ 2031 #define EXPECT_DOUBLE_EQ(val1, val2)\ 2032 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \ 2035 #define ASSERT_FLOAT_EQ(val1, val2)\ 2036 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \ 2039 #define ASSERT_DOUBLE_EQ(val1, val2)\ 2040 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \ 2043 #define EXPECT_NEAR(val1, val2, abs_error)\ 2044 EXPECT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \ 2045 val1, val2, abs_error) 2047 #define ASSERT_NEAR(val1, val2, abs_error)\ 2048 ASSERT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \ 2049 val1, val2, abs_error) 2059 float val1,
float val2);
2061 double val1,
double val2);
2064 #if GTEST_OS_WINDOWS 2075 # define EXPECT_HRESULT_SUCCEEDED(expr) \ 2076 EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) 2078 # define ASSERT_HRESULT_SUCCEEDED(expr) \ 2079 ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) 2081 # define EXPECT_HRESULT_FAILED(expr) \ 2082 EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr)) 2084 # define ASSERT_HRESULT_FAILED(expr) \ 2085 ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr)) 2087 #endif // GTEST_OS_WINDOWS 2099 #define ASSERT_NO_FATAL_FAILURE(statement) \ 2100 GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_FATAL_FAILURE_) 2101 #define EXPECT_NO_FATAL_FAILURE(statement) \ 2102 GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_NONFATAL_FAILURE_) 2115 #define SCOPED_TRACE(message) \ 2116 ::testing::internal::ScopedTrace GTEST_CONCAT_TOKEN_(gtest_trace_, __LINE__)(\ 2117 __FILE__, __LINE__, ::testing::Message() << (message)) 2149 template <
typename T1,
typename T2>
2180 #define GTEST_TEST(test_case_name, test_name)\ 2181 GTEST_TEST_(test_case_name, test_name, \ 2182 ::testing::Test, ::testing::internal::GetTestTypeId()) 2186 #if !GTEST_DONT_DEFINE_TEST 2187 # define TEST(test_case_name, test_name) GTEST_TEST(test_case_name, test_name) 2216 #define TEST_F(test_fixture, test_name)\ 2217 GTEST_TEST_(test_fixture, test_name, test_fixture, \ 2218 ::testing::internal::GetTypeId<test_fixture>()) 2233 return ::testing::UnitTest::GetInstance()->Run();
2236 #endif // GTEST_INCLUDE_GTEST_GTEST_H_ const char * file() const
TransportDirection operator!(TransportDirection dir)
class UnitTestImpl * GetUnitTestImpl()
internal::SetUpTestCaseFunc SetUpTestCaseFunc
const char * type_param() const
void ReportFailureInUnknownLocation(TestPartResult::Type result_type, const std::string &message)
virtual void OnTestProgramStart(const UnitTest &)
Integral2 random(Integral1 low, Integral2 up)
virtual void OnEnvironmentsSetUpEnd(const UnitTest &)
int death_test_count() const
void(* TearDownTestCaseFunc)()
static void SetUpTestCase()
GTEST_API_ AssertionResult AssertionFailure()
PUSHMI_INLINE_VAR constexpr detail::filter_fn filter
static AssertionResult Compare(const char *lhs_expression, const char *rhs_expression, const T1 &lhs, const T2 &rhs)
const std::vector< TestProperty > & test_properties() const
GTEST_DECLARE_int32_(random_seed)
Environment * AddGlobalTestEnvironment(Environment *env)
virtual ~TestEventListener()
AssertionResult CmpHelperEQ(const char *lhs_expression, const char *rhs_expression, const T1 &lhs, const T2 &rhs)
GTEST_API_ TestInfo * MakeAndRegisterTestInfo(const char *test_case_name, const char *name, const char *type_param, const char *value_param, CodeLocation code_location, TypeId fixture_class_id, SetUpTestCaseFunc set_up_tc, TearDownTestCaseFunc tear_down_tc, TestFactoryBase *factory)
static bool TestFailed(const TestInfo *test_info)
int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_
GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char *s1_expression, const char *s2_expression, const char *s1, const char *s2)
static bool TestReportableDisabled(const TestInfo *test_info)
const internal::UnitTestImpl * impl() const
static void ClearTestResult(TestInfo *test_info)
GTEST_API_ AssertionResult CmpHelperSTREQ(const char *s1_expression, const char *s2_expression, const char *s1, const char *s2)
internal::Mutex test_properites_mutex_
virtual void OnTestCaseEnd(const TestCase &)
const std::vector< TestPartResult > & test_part_results() const
int increment_death_test_count()
GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char *s1_expression, const char *s2_expression, const char *s1, const char *s2)
TimeInMillis elapsed_time_
TestPartResult::Type const type
uint32_t digits10(uint64_t v)
void(* SetUpTestCaseFunc)()
void Run(size_t iterations, ValueT kMin, ValueT kMax, Op &&op)
std::vector< TestInfo * > test_info_list_
GTEST_DECLARE_bool_(also_run_disabled_tests)
void set_elapsed_time(TimeInMillis elapsed)
TestEventListener * default_xml_generator() const
GTEST_API_ AssertionResult DoubleNearPredFormat(const char *expr1, const char *expr2, const char *abs_error_expr, double val1, double val2, double abs_error)
virtual void OnTestPartResult(const TestPartResult &)
std::vector< TestInfo * > & test_info_list()
internal::TearDownTestCaseFunc TearDownTestCaseFunc
static AssertionResult Compare(const char *lhs_expression, const char *rhs_expression, Secret *, T *rhs)
std::string FormatForComparisonFailureMessage(const T1 &value, const T2 &)
#define GTEST_DISABLE_MSC_WARNINGS_PUSH_(warnings)
virtual void OnEnvironmentsTearDownEnd(const UnitTest &)
#define GTEST_IMPL_CMP_HELPER_(op_name, op)
const char * failure_message() const
#define GTEST_MUST_USE_RESULT_
void AppendMessage(const Message &a_message)
void SetValue(const std::string &new_value)
FOLLY_PUSH_WARNING RHS rhs
int increment_death_test_count()
const internal::TypeId fixture_class_id_
AssertionResult CmpHelperFloatingPointEQ(const char *lhs_expression, const char *rhs_expression, RawType lhs_value, RawType rhs_value)
const internal::scoped_ptr< const ::std::string > type_param_
AssertionResult(const T &success, typename internal::EnableIf< !internal::ImplicitlyConvertible< T, AssertionResult >::value >::type *=NULL)
TestResult ad_hoc_test_result_
virtual Setup_should_be_spelled_SetUp * Setup()
const std::vector< TestInfo * > & test_info_list() const
bool is_reportable() const
const char * name() const
std::vector< int > test_indices_
const char * message() const
GTEST_API_ AssertionResult AssertionSuccess()
std::string const message
AssertionResult & operator<<(const T &value)
std::vector< TestProperty > test_properties_
const int kMaxStackTraceDepth
static bool TestPassed(const TestInfo *test_info)
GTEST_DECLARE_string_(death_test_style)
#define GTEST_CHECK_(condition)
AssertionResult CmpHelperOpFailure(const char *expr1, const char *expr2, const T1 &val1, const T2 &val2, const char *op)
TestEventListener * default_result_printer_
void repeat(F const &func)
Test::SetUpTestCaseFunc set_up_tc_
virtual Setup_should_be_spelled_SetUp * Setup()
virtual void OnTestIterationStart(const UnitTest &, int)
const char * value_param() const
std::string GetString() const
GTEST_API_ AssertionResult IsSubstring(const char *needle_expr, const char *haystack_expr, const char *needle, const char *haystack)
TestEventListener * default_xml_generator_
const internal::scoped_ptr< const ::std::string > type_param_
static const char *const value
internal::TestFactoryBase *const factory_
AssertHelperData(TestPartResult::Type t, const char *srcfile, int line_num, const char *msg)
const char * test_case_name() const
internal::scoped_ptr< ::std::string > message_
GTEST_API_ AssertionResult CmpHelperSTRNE(const char *s1_expression, const char *s2_expression, const char *s1, const char *s2)
const TestResult & ad_hoc_test_result() const
virtual void OnEnvironmentsTearDownStart(const UnitTest &)
AssertHelperData *const data_
Environment * AddEnvironment(Environment *env)
AssertionResult & operator<<(::std::ostream &(*basic_manipulator)(::std::ostream &stream))
Test::TearDownTestCaseFunc tear_down_tc_
std::vector< TestPartResult > test_part_results_
internal::UnitTestImpl * impl()
virtual void OnTestCaseStart(const TestCase &)
virtual void OnTestProgramEnd(const UnitTest &)
static void ClearTestCaseResult(TestCase *test_case)
internal::TestEventRepeater * repeater_
AssertionResult CmpHelperEQFailure(const char *lhs_expression, const char *rhs_expression, const T1 &lhs, const T2 &rhs)
static bool TestDisabled(const TestInfo *test_info)
GTEST_API_ AssertionResult EqFailure(const char *expected_expression, const char *actual_expression, const std::string &expected_value, const std::string &actual_value, bool ignoring_case)
TestProperty(const std::string &a_key, const std::string &a_value)
static bool TestReportable(const TestInfo *test_info)
virtual void OnTestIterationEnd(const UnitTest &, int)
static AssertionResult Compare(const char *lhs_expression, const char *rhs_expression, const T1 &lhs, const T2 &rhs, typename EnableIf<!is_pointer< T2 >::value >::type *=0)
void RunTearDownTestCase()
#define GTEST_DISABLE_MSC_WARNINGS_POP_()
TimeInMillis elapsed_time_
#define GTEST_LOCK_EXCLUDED_(locks)
GTEST_API_ std::string StringStreamToString(::std::stringstream *stream)
bool StaticAssertTypeEq()
virtual void OnEnvironmentsSetUpStart(const UnitTest &)
GTEST_API_ AssertionResult DoubleLE(const char *expr1, const char *expr2, double val1, double val2)
void set_should_run(bool should)
GTEST_API_ void InitGoogleTest(int *argc, char **argv)
const char * name() const
TimeInMillis elapsed_time() const
const TestResult * result() const
GTEST_API_ AssertionResult IsNotSubstring(const char *needle_expr, const char *haystack_expr, const char *needle, const char *haystack)
static UnitTest * GetInstance()
static AssertionResult Compare(const char *lhs_expression, const char *rhs_expression, BiggestInt lhs, BiggestInt rhs)
const internal::scoped_ptr< const ::std::string > value_param_
void swap(SwapTrackingAlloc< T > &, SwapTrackingAlloc< T > &)
TestEventListener * default_result_printer() const
#define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)
const char * type_param() const
TypeWithSize< 8 >::Int TimeInMillis
virtual void OnTestStart(const TestInfo &)
const internal::scoped_ptr< GTEST_FLAG_SAVER_ > gtest_flag_saver_
const char * value() const
static bool ShouldRunTest(const TestInfo *test_info)
virtual void OnTestEnd(const TestInfo &)
static void TearDownTestCase()
internal::CodeLocation location_
GTEST_API_ AssertionResult FloatLE(const char *expr1, const char *expr2, float val1, float val2)
const std::string test_case_name_
TimeInMillis elapsed_time() const