51#ifndef GTEST_INCLUDE_GTEST_GTEST_H_
52#define GTEST_INCLUDE_GTEST_GTEST_H_
89# pragma warning(disable:4805)
90# pragma warning(disable:4100)
159const int kMaxStackTraceDepth = 100;
164class DefaultGlobalTestPartResultReporter;
166class NoExecDeathTest;
167class FinalSuccessChecker;
169class StreamingListenerTest;
170class TestResultAccessor;
171class TestEventListenersAccessor;
172class TestEventRepeater;
173class UnitTestRecordPropertyTestHelper;
174class WindowsDeathTest;
175class FuchsiaDeathTest;
178 const std::string& message);
275#if defined(_MSC_VER) && _MSC_VER < 1910
286 template <
typename T>
292 : success_(success) {}
294#if defined(_MSC_VER) && _MSC_VER < 1910
305 operator bool()
const {
return success_; }
315 return message_.get() != NULL ? message_->c_str() :
"";
330 ::std::ostream& (*basic_manipulator)(::std::ostream& stream)) {
331 AppendMessage(
Message() << basic_manipulator);
337 void AppendMessage(
const Message& a_message) {
338 if (message_.get() == NULL)
339 message_.reset(new ::std::string);
340 message_->append(a_message.
GetString().c_str());
344 void swap(AssertionResult& other);
352 internal::scoped_ptr< ::std::string> message_;
426 static bool HasFatalFailure();
429 static bool HasNonfatalFailure();
433 static bool HasFailure() {
return HasFatalFailure() || HasNonfatalFailure(); }
448 static void RecordProperty(
const std::string& key,
const std::string&
value);
449 static void RecordProperty(
const std::string& key,
int value);
456 virtual void SetUp();
459 virtual void TearDown();
464 static bool HasSameFixtureClass();
472 virtual void TestBody() = 0;
479 void DeleteSelf_() {
delete this; }
481 const internal::scoped_ptr< GTEST_FLAG_SAVER_ > gtest_flag_saver_;
499 struct Setup_should_be_spelled_SetUp {};
500 virtual Setup_should_be_spelled_SetUp* Setup() {
return NULL; }
518 key_(a_key), value_(a_value) {
528 return value_.c_str();
559 int total_part_count()
const;
562 int test_property_count()
const;
565 bool Passed()
const {
return !Failed(); }
571 bool HasFatalFailure()
const;
574 bool HasNonfatalFailure()
const;
593 friend class internal::ExecDeathTest;
596 friend class internal::WindowsDeathTest;
597 friend class internal::FuchsiaDeathTest;
600 const std::vector<TestPartResult>& test_part_results()
const {
601 return test_part_results_;
605 const std::vector<TestProperty>& test_properties()
const {
606 return test_properties_;
610 void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; }
618 void RecordProperty(
const std::string& xml_element,
619 const TestProperty& test_property);
624 static bool ValidateTestProperty(
const std::string& xml_element,
625 const TestProperty& test_property);
628 void AddTestPartResult(
const TestPartResult& test_part_result);
631 int death_test_count()
const {
return death_test_count_; }
634 int increment_death_test_count() {
return ++death_test_count_; }
637 void ClearTestPartResults();
644 internal::Mutex test_properites_mutex_;
647 std::vector<TestPartResult> test_part_results_;
649 std::vector<TestProperty> test_properties_;
651 int death_test_count_;
680 const char*
name()
const {
return name_.c_str(); }
685 if (type_param_.get() != NULL)
686 return type_param_->c_str();
693 if (value_param_.get() != NULL)
694 return value_param_->c_str();
699 const char*
file()
const {
return location_.file.c_str(); }
702 int line()
const {
return location_.line; }
729 return matches_filter_ && !is_in_another_shard_;
736#if GTEST_HAS_DEATH_TEST
737 friend class internal::DefaultDeathTestFactory;
742 friend class internal::StreamingListenerTest;
743 friend TestInfo* internal::MakeAndRegisterTestInfo(
744 const char* test_case_name,
746 const char* type_param,
747 const char* value_param,
756 TestInfo(
const std::string& test_case_name,
757 const std::string&
name,
758 const char* a_type_param,
759 const char* a_value_param,
766 int increment_death_test_count() {
767 return result_.increment_death_test_count();
774 static void ClearTestResult(
TestInfo* test_info) {
775 test_info->result_.Clear();
779 const std::string test_case_name_;
780 const std::string name_;
783 const internal::scoped_ptr<const ::std::string> type_param_;
786 const internal::scoped_ptr<const ::std::string> value_param_;
787 internal::CodeLocation location_;
788 const internal::TypeId fixture_class_id_;
791 bool matches_filter_;
793 bool is_in_another_shard_;
794 internal::TestFactoryBase*
const factory_;
829 const char*
name()
const {
return name_.c_str(); }
834 if (type_param_.get() != NULL)
835 return type_param_->c_str();
843 int successful_test_count()
const;
846 int failed_test_count()
const;
849 int reportable_disabled_test_count()
const;
852 int disabled_test_count()
const;
855 int reportable_test_count()
const;
858 int test_to_run_count()
const;
861 int total_test_count()
const;
864 bool Passed()
const {
return !Failed(); }
867 bool Failed()
const {
return failed_test_count() > 0; }
874 const TestInfo* GetTestInfo(
int i)
const;
885 std::vector<TestInfo*>& test_info_list() {
return test_info_list_; }
888 const std::vector<TestInfo*>& test_info_list()
const {
889 return test_info_list_;
894 TestInfo* GetMutableTestInfo(
int i);
897 void set_should_run(
bool should) { should_run_ = should; }
901 void AddTestInfo(TestInfo * test_info);
907 static void ClearTestCaseResult(TestCase* test_case) {
908 test_case->ClearResult();
916 void RunSetUpTestCase() { (*set_up_tc_)(); }
920 void RunTearDownTestCase() { (*tear_down_tc_)(); }
923 static bool TestPassed(
const TestInfo* test_info) {
924 return test_info->should_run() && test_info->result()->Passed();
928 static bool TestFailed(
const TestInfo* test_info) {
929 return test_info->should_run() && test_info->result()->Failed();
934 static bool TestReportableDisabled(
const TestInfo* test_info) {
935 return test_info->is_reportable() && test_info->is_disabled_;
939 static bool TestDisabled(
const TestInfo* test_info) {
940 return test_info->is_disabled_;
944 static bool TestReportable(
const TestInfo* test_info) {
945 return test_info->is_reportable();
949 static bool ShouldRunTest(
const TestInfo* test_info) {
950 return test_info->should_run();
954 void ShuffleTests(internal::Random*
random);
957 void UnshuffleTests();
963 const internal::scoped_ptr<const ::std::string> type_param_;
966 std::vector<TestInfo*> test_info_list_;
970 std::vector<int> test_indices_;
972 Test::SetUpTestCaseFunc set_up_tc_;
974 Test::TearDownTestCaseFunc tear_down_tc_;
981 TestResult ad_hoc_test_result_;
1014 struct Setup_should_be_spelled_SetUp {};
1015 virtual Setup_should_be_spelled_SetUp* Setup() {
return NULL; }
1018#if GTEST_HAS_EXCEPTIONS
1022 :
public internal::GoogleTestFailureException {
1024 explicit AssertionException(
const TestPartResult& result)
1025 : GoogleTestFailureException(result) {}
1128 return default_result_printer_;
1139 return default_xml_generator_;
1146 friend class internal::NoExecDeathTest;
1170 bool EventForwardingEnabled()
const;
1171 void SuppressEventForwarding();
1211 const char* original_working_dir()
const;
1215 const TestCase* current_test_case()
const
1220 const TestInfo* current_test_info()
const
1224 int random_seed()
const;
1234 int successful_test_case_count()
const;
1237 int failed_test_case_count()
const;
1240 int total_test_case_count()
const;
1244 int test_case_to_run_count()
const;
1247 int successful_test_count()
const;
1250 int failed_test_count()
const;
1253 int reportable_disabled_test_count()
const;
1256 int disabled_test_count()
const;
1259 int reportable_test_count()
const;
1262 int total_test_count()
const;
1265 int test_to_run_count()
const;
1275 bool Passed()
const;
1279 bool Failed()
const;
1283 const TestCase* GetTestCase(
int i)
const;
1287 const TestResult& ad_hoc_test_result()
const;
1310 const char* file_name,
1312 const std::string& message,
1313 const std::string& os_stack_trace)
1321 void RecordProperty(
const std::string& key,
const std::string&
value);
1325 TestCase* GetMutableTestCase(
int i);
1336 friend class internal::StreamingListenerTest;
1340 friend void internal::ReportFailureInUnknownLocation(
1342 const std::string& message);
1356 void PopGTestTrace()
1392 return UnitTest::GetInstance()->AddEnvironment(env);
1415template <
typename T1,
typename T2>
1417 const char* rhs_expression,
1418 const T1& lhs,
const T2& rhs) {
1419 return EqFailure(lhs_expression,
1427template <
typename T1,
typename T2>
1429 const char* rhs_expression,
1433 return AssertionSuccess();
1443 const char* rhs_expression,
1451template <
bool lhs_is_null_literal>
1455 template <
typename T1,
typename T2>
1457 const char* rhs_expression,
1460 return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
1470 const char* rhs_expression,
1473 return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
1486 template <
typename T1,
typename T2>
1488 const char* lhs_expression,
1489 const char* rhs_expression,
1498 return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
1503 template <
typename T>
1505 const char* lhs_expression,
1506 const char* rhs_expression,
1516 return CmpHelperEQ(lhs_expression, rhs_expression,
1517 static_cast<T*
>(NULL), rhs);
1524template <
typename T1,
typename T2>
1526 const T1& val1,
const T2& val2,
1528 return AssertionFailure()
1529 <<
"Expected: (" << expr1 <<
") " <<
op <<
" (" << expr2
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();\
1552 return CmpHelperOpFailure(expr1, expr2, val1, val2, #op);\
1555GTEST_API_ AssertionResult CmpHelper##op_name(\
1556 const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2)
1571#undef GTEST_IMPL_CMP_HELPER_
1577 const char* s2_expression,
1585 const char* s2_expression,
1593 const char* s2_expression,
1601 const char* s2_expression,
1610 const char* s2_expression,
1618 const char* s2_expression,
1633 const char* needle_expr,
const char* haystack_expr,
1634 const char* needle,
const char* haystack);
1636 const char* needle_expr,
const char* haystack_expr,
1637 const wchar_t* needle,
const wchar_t* haystack);
1639 const char* needle_expr,
const char* haystack_expr,
1640 const char* needle,
const char* haystack);
1642 const char* needle_expr,
const char* haystack_expr,
1643 const wchar_t* needle,
const wchar_t* haystack);
1645 const char* needle_expr,
const char* haystack_expr,
1646 const ::std::string& needle, const ::std::string& haystack);
1648 const char* needle_expr,
const char* haystack_expr,
1649 const ::std::string& needle, const ::std::string& haystack);
1651#if GTEST_HAS_STD_WSTRING
1653 const char* needle_expr,
const char* haystack_expr,
1654 const ::std::wstring& needle, const ::std::wstring& haystack);
1656 const char* needle_expr,
const char* haystack_expr,
1657 const ::std::wstring& needle, const ::std::wstring& haystack);
1669template <
typename RawType>
1671 const char* rhs_expression,
1673 RawType rhs_value) {
1676 if (lhs.AlmostEquals(rhs)) {
1677 return AssertionSuccess();
1680 ::std::stringstream lhs_ss;
1681 lhs_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
1684 ::std::stringstream rhs_ss;
1685 rhs_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
1688 return EqFailure(lhs_expression,
1700 const char* abs_error_expr,
1713 const char* message);
1718 void operator=(
const Message& message)
const;
1725 struct AssertHelperData {
1727 const char* srcfile,
1730 :
type(t), file(srcfile), line(line_num), message(msg) { }
1733 const char*
const file;
1735 std::string
const message;
1741 AssertHelperData*
const data_;
1782template <
typename T>
1795 <<
"GetParam() can only be called inside a value-parameterized test "
1796 <<
"-- did you intend to write TEST_P instead of TEST_F?";
1803 static void SetParam(
const ParamType*
parameter) {
1808 static const ParamType* parameter_;
1814template <
typename T>
1820template <
typename T>
1844#define ADD_FAILURE() GTEST_NONFATAL_FAILURE_("Failed")
1848#define ADD_FAILURE_AT(file, line) \
1849 GTEST_MESSAGE_AT_(file, line, "Failed", \
1850 ::testing::TestPartResult::kNonFatalFailure)
1853#define GTEST_FAIL() GTEST_FATAL_FAILURE_("Failed")
1857#if !GTEST_DONT_DEFINE_FAIL
1858# define FAIL() GTEST_FAIL()
1862#define GTEST_SUCCEED() GTEST_SUCCESS_("Succeeded")
1866#if !GTEST_DONT_DEFINE_SUCCEED
1867# define SUCCEED() GTEST_SUCCEED()
1879#define EXPECT_THROW(statement, expected_exception) \
1880 GTEST_TEST_THROW_(statement, expected_exception, GTEST_NONFATAL_FAILURE_)
1881#define EXPECT_NO_THROW(statement) \
1882 GTEST_TEST_NO_THROW_(statement, GTEST_NONFATAL_FAILURE_)
1883#define EXPECT_ANY_THROW(statement) \
1884 GTEST_TEST_ANY_THROW_(statement, GTEST_NONFATAL_FAILURE_)
1885#define ASSERT_THROW(statement, expected_exception) \
1886 GTEST_TEST_THROW_(statement, expected_exception, GTEST_FATAL_FAILURE_)
1887#define ASSERT_NO_THROW(statement) \
1888 GTEST_TEST_NO_THROW_(statement, GTEST_FATAL_FAILURE_)
1889#define ASSERT_ANY_THROW(statement) \
1890 GTEST_TEST_ANY_THROW_(statement, GTEST_FATAL_FAILURE_)
1895#define EXPECT_TRUE(condition) \
1896 GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
1897 GTEST_NONFATAL_FAILURE_)
1898#define EXPECT_FALSE(condition) \
1899 GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
1900 GTEST_NONFATAL_FAILURE_)
1901#define ASSERT_TRUE(condition) \
1902 GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
1903 GTEST_FATAL_FAILURE_)
1904#define ASSERT_FALSE(condition) \
1905 GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
1906 GTEST_FATAL_FAILURE_)
1954#define EXPECT_EQ(val1, val2) \
1955 EXPECT_PRED_FORMAT2(::testing::internal:: \
1956 EqHelper<GTEST_IS_NULL_LITERAL_(val1)>::Compare, \
1958#define EXPECT_NE(val1, val2) \
1959 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)
1960#define EXPECT_LE(val1, val2) \
1961 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
1962#define EXPECT_LT(val1, val2) \
1963 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
1964#define EXPECT_GE(val1, val2) \
1965 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
1966#define EXPECT_GT(val1, val2) \
1967 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
1969#define GTEST_ASSERT_EQ(val1, val2) \
1970 ASSERT_PRED_FORMAT2(::testing::internal:: \
1971 EqHelper<GTEST_IS_NULL_LITERAL_(val1)>::Compare, \
1973#define GTEST_ASSERT_NE(val1, val2) \
1974 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)
1975#define GTEST_ASSERT_LE(val1, val2) \
1976 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
1977#define GTEST_ASSERT_LT(val1, val2) \
1978 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
1979#define GTEST_ASSERT_GE(val1, val2) \
1980 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
1981#define GTEST_ASSERT_GT(val1, val2) \
1982 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
1987#if !GTEST_DONT_DEFINE_ASSERT_EQ
1988# define ASSERT_EQ(val1, val2) GTEST_ASSERT_EQ(val1, val2)
1991#if !GTEST_DONT_DEFINE_ASSERT_NE
1992# define ASSERT_NE(val1, val2) GTEST_ASSERT_NE(val1, val2)
1995#if !GTEST_DONT_DEFINE_ASSERT_LE
1996# define ASSERT_LE(val1, val2) GTEST_ASSERT_LE(val1, val2)
1999#if !GTEST_DONT_DEFINE_ASSERT_LT
2000# define ASSERT_LT(val1, val2) GTEST_ASSERT_LT(val1, val2)
2003#if !GTEST_DONT_DEFINE_ASSERT_GE
2004# define ASSERT_GE(val1, val2) GTEST_ASSERT_GE(val1, val2)
2007#if !GTEST_DONT_DEFINE_ASSERT_GT
2008# define ASSERT_GT(val1, val2) GTEST_ASSERT_GT(val1, val2)
2027#define EXPECT_STREQ(s1, s2) \
2028 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, s1, s2)
2029#define EXPECT_STRNE(s1, s2) \
2030 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
2031#define EXPECT_STRCASEEQ(s1, s2) \
2032 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, s1, s2)
2033#define EXPECT_STRCASENE(s1, s2)\
2034 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
2036#define ASSERT_STREQ(s1, s2) \
2037 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, s1, s2)
2038#define ASSERT_STRNE(s1, s2) \
2039 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
2040#define ASSERT_STRCASEEQ(s1, s2) \
2041 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, s1, s2)
2042#define ASSERT_STRCASENE(s1, s2)\
2043 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
2059#define EXPECT_FLOAT_EQ(val1, val2)\
2060 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
2063#define EXPECT_DOUBLE_EQ(val1, val2)\
2064 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
2067#define ASSERT_FLOAT_EQ(val1, val2)\
2068 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
2071#define ASSERT_DOUBLE_EQ(val1, val2)\
2072 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
2075#define EXPECT_NEAR(val1, val2, abs_error)\
2076 EXPECT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
2077 val1, val2, abs_error)
2079#define ASSERT_NEAR(val1, val2, abs_error)\
2080 ASSERT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
2081 val1, val2, abs_error)
2090GTEST_API_ AssertionResult FloatLE(
const char* expr1,
const char* expr2,
2091 float val1,
float val2);
2092GTEST_API_ AssertionResult DoubleLE(
const char* expr1,
const char* expr2,
2093 double val1,
double val2);
2107# define EXPECT_HRESULT_SUCCEEDED(expr) \
2108 EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
2110# define ASSERT_HRESULT_SUCCEEDED(expr) \
2111 ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
2113# define EXPECT_HRESULT_FAILED(expr) \
2114 EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
2116# define ASSERT_HRESULT_FAILED(expr) \
2117 ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
2131#define ASSERT_NO_FATAL_FAILURE(statement) \
2132 GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_FATAL_FAILURE_)
2133#define EXPECT_NO_FATAL_FAILURE(statement) \
2134 GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_NONFATAL_FAILURE_)
2153 template <
typename T>
2155 PushTrace(file, line, (
Message() << message).GetString());
2160 PushTrace(file, line, message ? message :
"(null)");
2163#if GTEST_HAS_GLOBAL_STRING
2164 ScopedTrace(
const char* file,
int line, const ::string& message) {
2165 PushTrace(file, line, message);
2170 PushTrace(file, line, message);
2180 void PushTrace(
const char* file,
int line, std::string message);
2202#define SCOPED_TRACE(message) \
2203 ::testing::ScopedTrace GTEST_CONCAT_TOKEN_(gtest_trace_, __LINE__)(\
2204 __FILE__, __LINE__, (message))
2237template <
typename T1,
typename T2>
2238bool StaticAssertTypeEq() {
2268#define GTEST_TEST(test_case_name, test_name)\
2269 GTEST_TEST_(test_case_name, test_name, \
2270 ::testing::Test, ::testing::internal::GetTestTypeId())
2274#if !GTEST_DONT_DEFINE_TEST
2275# define TEST(test_case_name, test_name) GTEST_TEST(test_case_name, test_name)
2304#define TEST_F(test_fixture, test_name)\
2305 GTEST_TEST_(test_fixture, test_name, test_fixture, \
2306 ::testing::internal::GetTypeId<test_fixture>())
2313# pragma warning(pop)
2329 return ::testing::UnitTest::GetInstance()->Run();
void Test(const char *msg, const Func &f)
const char * message() const
AssertionResult(const T &success, typename internal::EnableIf< !internal::ImplicitlyConvertible< T, AssertionResult >::value >::type *=NULL)
AssertionResult & operator<<(const T &value)
const char * failure_message() const
AssertionResult & operator=(AssertionResult other)
AssertionResult & operator<<(::std::ostream &(*basic_manipulator)(::std::ostream &stream))
virtual void OnEnvironmentsTearDownStart(const UnitTest &)
virtual void OnTestProgramEnd(const UnitTest &)
virtual void OnEnvironmentsSetUpStart(const UnitTest &)
virtual void OnTestIterationEnd(const UnitTest &, int)
virtual void OnTestPartResult(const TestPartResult &)
virtual void OnTestCaseEnd(const TestCase &)
virtual void OnTestIterationStart(const UnitTest &, int)
virtual void OnTestStart(const TestInfo &)
virtual void OnTestProgramStart(const UnitTest &)
virtual void OnEnvironmentsSetUpEnd(const UnitTest &)
virtual void OnTestCaseStart(const TestCase &)
virtual void OnEnvironmentsTearDownEnd(const UnitTest &)
virtual void OnTestEnd(const TestInfo &)
std::string GetString() const
ScopedTrace(const char *file, int line, const std::string &message)
ScopedTrace(const char *file, int line, const T &message)
ScopedTrace(const char *file, int line, const char *message)
const char * type_param() const
const char * name() const
const TestResult & ad_hoc_test_result() const
TimeInMillis elapsed_time() const
virtual void OnTestPartResult(const TestPartResult &test_part_result)=0
virtual ~TestEventListener()
virtual void OnEnvironmentsTearDownStart(const UnitTest &unit_test)=0
virtual void OnTestIterationEnd(const UnitTest &unit_test, int iteration)=0
virtual void OnTestProgramStart(const UnitTest &unit_test)=0
virtual void OnTestIterationStart(const UnitTest &unit_test, int iteration)=0
virtual void OnEnvironmentsTearDownEnd(const UnitTest &unit_test)=0
virtual void OnEnvironmentsSetUpStart(const UnitTest &unit_test)=0
virtual void OnEnvironmentsSetUpEnd(const UnitTest &unit_test)=0
virtual void OnTestCaseStart(const TestCase &test_case)=0
virtual void OnTestStart(const TestInfo &test_info)=0
virtual void OnTestEnd(const TestInfo &test_info)=0
virtual void OnTestProgramEnd(const UnitTest &unit_test)=0
virtual void OnTestCaseEnd(const TestCase &test_case)=0
TestEventListener * default_result_printer() const
TestEventListener * default_xml_generator() const
internal::SetUpTestCaseFunc SetUpTestCaseFunc
static void SetUpTestCase()
internal::TearDownTestCaseFunc TearDownTestCaseFunc
static void TearDownTestCase()
const char * file() const
const char * value_param() const
bool is_reportable() const
bool is_in_another_shard() const
const char * type_param() const
const char * name() const
const TestResult * result() const
const char * test_case_name() const
const char * value() const
TestProperty(const std::string &a_key, const std::string &a_value)
void SetValue(const std::string &new_value)
TimeInMillis elapsed_time() const
virtual ~WithParamInterface()
const ParamType & GetParam() const
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)
static AssertionResult Compare(const char *lhs_expression, const char *rhs_expression, Secret *, T *rhs)
static AssertionResult Compare(const char *lhs_expression, const char *rhs_expression, BiggestInt lhs, BiggestInt rhs)
static AssertionResult Compare(const char *lhs_expression, const char *rhs_expression, const T1 &lhs, const T2 &rhs)
#define GTEST_ATTRIBUTE_UNUSED_
#define GTEST_DECLARE_bool_(name)
#define GTEST_LOCK_EXCLUDED_(locks)
#define GTEST_DISABLE_MSC_WARNINGS_PUSH_(warnings)
#define GTEST_MUST_USE_RESULT_
#define GTEST_DECLARE_string_(name)
#define GTEST_DECLARE_int32_(name)
#define GTEST_DISABLE_MSC_WARNINGS_POP_()
#define GTEST_CHECK_(condition)
#define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)
#define GTEST_IMPL_CMP_HELPER_(op_name, op)
int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_
AssertionResult CmpHelperEQFailure(const char *lhs_expression, const char *rhs_expression, const T1 &lhs, const T2 &rhs)
GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char *s1_expression, const char *s2_expression, const char *s1, const char *s2)
AssertionResult CmpHelperEQ(const char *lhs_expression, const char *rhs_expression, const T1 &lhs, const T2 &rhs)
TypeWithSize< 8 >::Int TimeInMillis
GTEST_API_ AssertionResult CmpHelperSTREQ(const char *s1_expression, const char *s2_expression, const char *s1, const char *s2)
GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char *s1_expression, const char *s2_expression, const char *s1, const char *s2)
void ReportFailureInUnknownLocation(TestPartResult::Type result_type, const std::string &message)
AssertionResult CmpHelperOpFailure(const char *expr1, const char *expr2, const T1 &val1, const T2 &val2, const char *op)
std::string FormatForComparisonFailureMessage(const T1 &value, const T2 &)
AssertionResult CmpHelperFloatingPointEQ(const char *lhs_expression, const char *rhs_expression, RawType lhs_value, RawType rhs_value)
class UnitTestImpl * GetUnitTestImpl()
GTEST_API_ std::string StringStreamToString(::std::stringstream *stream)
GTEST_API_ AssertionResult CmpHelperSTRNE(const char *s1_expression, const char *s2_expression, const char *s1, const char *s2)
Environment * AddGlobalTestEnvironment(Environment *env)
GTEST_API_ AssertionResult AssertionFailure()
internal::TimeInMillis TimeInMillis
GTEST_API_ AssertionResult AssertionSuccess()
GTEST_API_ void InitGoogleTest(int *argc, char **argv)
#define T(meth, val, expected)