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>
288 operator bool()
const {
return success_; }
298 return message_.get() != NULL ? message_->c_str() :
"";
313 ::std::ostream& (*basic_manipulator)(::std::ostream& stream)) {
314 AppendMessage(
Message() << basic_manipulator);
320 void AppendMessage(
const Message& a_message) {
321 if (message_.get() == NULL)
323 message_->append(a_message.
GetString().c_str());
327 void swap(AssertionResult& other);
335 internal::scoped_ptr< ::std::string> message_;
407 static bool HasFailure() {
return HasFatalFailure() || HasNonfatalFailure(); }
438 static bool HasSameFixtureClass();
446 virtual void TestBody() = 0;
453 void DeleteSelf_() {
delete this; }
473 struct Setup_should_be_spelled_SetUp {};
474 virtual Setup_should_be_spelled_SetUp* Setup() {
return NULL; }
492 key_(a_key), value_(a_value) {
502 return value_.c_str();
539 bool Passed()
const {
return !Failed(); }
568 friend class internal::ExecDeathTest;
571 friend class internal::WindowsDeathTest;
574 const std::vector<TestPartResult>& test_part_results()
const {
575 return test_part_results_;
579 const std::vector<TestProperty>& test_properties()
const {
580 return test_properties_;
584 void set_elapsed_time(
TimeInMillis elapsed) { elapsed_time_ = elapsed; }
592 void RecordProperty(
const std::string& xml_element,
593 const TestProperty& test_property);
598 static bool ValidateTestProperty(
const std::string& xml_element,
599 const TestProperty& test_property);
602 void AddTestPartResult(
const TestPartResult& test_part_result);
605 int death_test_count()
const {
return death_test_count_; }
608 int increment_death_test_count() {
return ++death_test_count_; }
611 void ClearTestPartResults();
621 std::vector<TestPartResult> test_part_results_;
623 std::vector<TestProperty> test_properties_;
625 int death_test_count_;
654 const char*
name()
const {
return name_.c_str(); }
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;
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,
738 int increment_death_test_count() {
739 return result_.increment_death_test_count();
746 static void ClearTestResult(
TestInfo* test_info) {
747 test_info->result_.Clear();
755 const internal::scoped_ptr<const ::std::string> type_param_;
758 const internal::scoped_ptr<const ::std::string> value_param_;
759 internal::CodeLocation location_;
763 bool matches_filter_;
765 internal::TestFactoryBase*
const factory_;
800 const char*
name()
const {
return name_.c_str(); }
805 if (type_param_.get() != NULL)
806 return type_param_->c_str();
835 bool Passed()
const {
return !Failed(); }
838 bool Failed()
const {
return failed_test_count() > 0; }
856 std::vector<TestInfo*>& test_info_list() {
return test_info_list_; }
859 const std::vector<TestInfo*>& test_info_list()
const {
860 return test_info_list_;
865 TestInfo* GetMutableTestInfo(
int i);
868 void set_should_run(
bool should) { should_run_ = should; }
872 void AddTestInfo(TestInfo * test_info);
878 static void ClearTestCaseResult(TestCase* test_case) {
879 test_case->ClearResult();
887 void RunSetUpTestCase() { (*set_up_tc_)(); }
891 void RunTearDownTestCase() { (*tear_down_tc_)(); }
894 static bool TestPassed(
const TestInfo* test_info) {
895 return test_info->should_run() && test_info->result()->Passed();
899 static bool TestFailed(
const TestInfo* test_info) {
900 return test_info->should_run() && test_info->result()->Failed();
905 static bool TestReportableDisabled(
const TestInfo* test_info) {
906 return test_info->is_reportable() && test_info->is_disabled_;
910 static bool TestDisabled(
const TestInfo* test_info) {
911 return test_info->is_disabled_;
915 static bool TestReportable(
const TestInfo* test_info) {
916 return test_info->is_reportable();
920 static bool ShouldRunTest(
const TestInfo* test_info) {
921 return test_info->should_run();
925 void ShuffleTests(internal::Random*
random);
928 void UnshuffleTests();
934 const internal::scoped_ptr<const ::std::string> type_param_;
937 std::vector<TestInfo*> test_info_list_;
941 std::vector<int> test_indices_;
952 TestResult ad_hoc_test_result_;
985 struct Setup_should_be_spelled_SetUp {};
986 virtual Setup_should_be_spelled_SetUp* Setup() {
return NULL; }
1085 return default_result_printer_;
1096 return default_xml_generator_;
1103 friend class internal::NoExecDeathTest;
1104 friend class internal::TestEventListenersAccessor;
1127 bool EventForwardingEnabled()
const;
1128 void SuppressEventForwarding();
1131 internal::TestEventRepeater* repeater_;
1168 const
char* original_working_dir() const;
1181 int random_seed() const;
1183 #if GTEST_HAS_PARAM_TEST
1188 internal::ParameterizedTestCaseRegistry& parameterized_test_registry()
1269 const char* file_name,
1284 TestCase* GetMutableTestCase(
int i);
1295 friend class internal::StreamingListenerTest;
1296 friend class internal::UnitTestRecordPropertyTestHelper;
1315 void PopGTestTrace()
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,
1630 template <
typename RawType>
1632 const char* rhs_expression,
1634 RawType rhs_value) {
1637 if (lhs.AlmostEquals(rhs)) {
1641 ::std::stringstream lhs_ss;
1642 lhs_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
1645 ::std::stringstream rhs_ss;
1646 rhs_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
1661 const char* abs_error_expr,
1686 struct AssertHelperData {
1688 const char* srcfile,
1691 : type(t), file(srcfile), line(line_num),
message(msg) { }
1694 const char*
const file;
1702 AssertHelperData*
const data_;
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> {
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))
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();
AssertionResult(const AssertionResult &other)
AssertionResult & operator<<(const T &value)
const char * message() const
AssertionResult & operator<<(::std::ostream &(*basic_manipulator)(::std::ostream &stream))
AssertionResult operator!() const
const char * failure_message() const
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
const TestInfo * GetTestInfo(int i) const
const char * name() const
int test_to_run_count() const
const TestResult & ad_hoc_test_result() const
int failed_test_count() const
TestCase(const char *name, const char *a_type_param, Test::SetUpTestCaseFunc set_up_tc, Test::TearDownTestCaseFunc tear_down_tc)
int disabled_test_count() const
const char * type_param() const
int successful_test_count() const
int total_test_count() const
TimeInMillis elapsed_time() const
int reportable_disabled_test_count() const
int reportable_test_count() 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
void Append(TestEventListener *listener)
TestEventListener * Release(TestEventListener *listener)
TestEventListener * default_result_printer() const
TestEventListener * default_xml_generator() const
static bool HasNonfatalFailure()
static bool HasFatalFailure()
static void SetUpTestCase()
internal::SetUpTestCaseFunc SetUpTestCaseFunc
internal::TearDownTestCaseFunc TearDownTestCaseFunc
static void RecordProperty(const std::string &key, const std::string &value)
static void TearDownTestCase()
static void RecordProperty(const std::string &key, int value)
const char * test_case_name() const
bool is_reportable() const
const char * type_param() const
const char * file() const
const char * value_param() const
const char * name() const
const TestResult * result() const
TestProperty(const std::string &a_key, const std::string &a_value)
void SetValue(const std::string &new_value)
const char * value() const
bool HasFatalFailure() const
const TestProperty & GetTestProperty(int i) const
bool HasNonfatalFailure() const
int total_part_count() const
TimeInMillis elapsed_time() const
const TestPartResult & GetTestPartResult(int i) const
int test_property_count() const
TestEventListeners & listeners()
int reportable_disabled_test_count() const
int Run() GTEST_MUST_USE_RESULT_
TimeInMillis elapsed_time() const
int reportable_test_count() const
int test_to_run_count() const
int successful_test_count() const
int total_test_case_count() const
int test_case_to_run_count() const
TimeInMillis start_timestamp() const
int failed_test_case_count() const
int successful_test_case_count() const
int failed_test_count() const
int disabled_test_count() const
const TestCase * GetTestCase(int i) const
static UnitTest * GetInstance()
int total_test_count() const
const TestResult & ad_hoc_test_result() const
void operator=(const Message &message) const
AssertHelper(TestPartResult::Type type, const char *file, int line, const char *message)
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)
std::string message("Message requiring signing")
expect< void > success() noexcept
#define GTEST_IMPL_CMP_HELPER_(op_name, op)
int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_
#define GTEST_LOCK_EXCLUDED_(locks)
#define GTEST_DISABLE_MSC_WARNINGS_PUSH_(warnings)
#define GTEST_MUST_USE_RESULT_
#define GTEST_DISABLE_MSC_WARNINGS_POP_()
#define GTEST_CHECK_(condition)
#define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)
base::threading::internal::Mutex Mutex
GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char *s1_expression, const char *s2_expression, const char *s1, const char *s2)
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)
AssertionResult CmpHelperEQFailure(const char *lhs_expression, const char *rhs_expression, const T1 &lhs, const T2 &rhs)
GTEST_API_ AssertionResult CmpHelperEQ(const char *lhs_expression, const char *rhs_expression, BiggestInt lhs, BiggestInt rhs)
TypeWithSize< 8 >::Int TimeInMillis
GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char *s1_expression, const char *s2_expression, const char *s1, const char *s2)
GTEST_API_ AssertionResult CmpHelperSTRNE(const char *s1_expression, const char *s2_expression, const wchar_t *s1, const wchar_t *s2)
GTEST_API_ std::string StringStreamToString(::std::stringstream *stream)
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()
void(* TearDownTestCaseFunc)()
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)
GTEST_API_ AssertionResult CmpHelperSTREQ(const char *s1_expression, const char *s2_expression, const wchar_t *s1, const wchar_t *s2)
void(* SetUpTestCaseFunc)()
GTEST_API_ AssertionResult DoubleNearPredFormat(const char *expr1, const char *expr2, const char *abs_error_expr, double val1, double val2, double abs_error)
Environment * AddGlobalTestEnvironment(Environment *env)
GTEST_DECLARE_string_(death_test_style)
GTEST_DECLARE_bool_(also_run_disabled_tests)
GTEST_API_ AssertionResult IsSubstring(const char *needle_expr, const char *haystack_expr, const char *needle, const char *haystack)
bool StaticAssertTypeEq()
GTEST_API_ AssertionResult FloatLE(const char *expr1, const char *expr2, float val1, float val2)
GTEST_API_ AssertionResult AssertionSuccess()
GTEST_API_ AssertionResult DoubleLE(const char *expr1, const char *expr2, double val1, double val2)
GTEST_API_ AssertionResult AssertionFailure()
internal::TimeInMillis TimeInMillis
GTEST_API_ AssertionResult IsNotSubstring(const char *needle_expr, const char *haystack_expr, const char *needle, const char *haystack)
const int kMaxStackTraceDepth
GTEST_DECLARE_int32_(random_seed)
GTEST_API_ void InitGoogleTest(int *argc, char **argv)
const GenericPointer< typename T::ValueType > T2 value
uint64_t random(const uint64_t max_value)