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_;
373 friend class TestInfo;
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; }
991 class TestEventListener {
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);
1293 friend class internal::AssertHelper;
1294 friend class internal::ScopedTrace;
1295 friend class internal::StreamingListenerTest;
1296 friend class internal::UnitTestRecordPropertyTestHelper;
1315 void PopGTestTrace()
1374 template <
typename T1,
typename T2>
1376 const char* actual_expression,
1377 const T1& expected,
const T2& actual) {
1386 template <
typename T1,
typename T2>
1387 AssertionResult
CmpHelperEQ(
const char* expected_expression,
1388 const char* actual_expression,
1392 if (expected == actual) {
1405 const
char* actual_expression,
1413 template <
bool lhs_is_null_literal>
1417 template <
typename T1,
typename T2>
1419 const char* actual_expression,
1422 return CmpHelperEQ(expected_expression, actual_expression, expected,
1433 const char* actual_expression,
1436 return CmpHelperEQ(expected_expression, actual_expression, expected,
1444 class EqHelper<
true> {
1450 template <
typename T1,
typename T2>
1452 const char* expected_expression,
1453 const char* actual_expression,
1462 return CmpHelperEQ(expected_expression, actual_expression, expected,
1468 template <
typename T>
1470 const char* expected_expression,
1471 const char* actual_expression,
1481 return CmpHelperEQ(expected_expression, actual_expression,
1482 static_cast<T*
>(NULL), actual);
1489 template <
typename T1,
typename T2>
1491 const T1& val1,
const T2& val2,
1494 <<
"Expected: (" << expr1 <<
") " << op <<
" (" << expr2
1510 #define GTEST_IMPL_CMP_HELPER_(op_name, op)\
1511 template <typename T1, typename T2>\
1512 AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \
1513 const T1& val1, const T2& val2) {\
1514 if (val1 op val2) {\
1515 return AssertionSuccess();\
1517 return CmpHelperOpFailure(expr1, expr2, val1, val2, #op);\
1520 GTEST_API_ AssertionResult CmpHelper##op_name(\
1521 const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2)
1536 #undef GTEST_IMPL_CMP_HELPER_
1542 const char* actual_expression,
1543 const char* expected,
1544 const char* actual);
1550 const char* actual_expression,
1551 const char* expected,
1552 const char* actual);
1558 const char* s2_expression,
1566 const char* s2_expression,
1575 const char* actual_expression,
1576 const wchar_t* expected,
1577 const wchar_t* actual);
1583 const char* s2_expression,
1598 const char* needle_expr,
const char* haystack_expr,
1599 const char* needle,
const char* haystack);
1601 const char* needle_expr,
const char* haystack_expr,
1602 const wchar_t* needle,
const wchar_t* haystack);
1604 const char* needle_expr,
const char* haystack_expr,
1605 const char* needle,
const char* haystack);
1607 const char* needle_expr,
const char* haystack_expr,
1608 const wchar_t* needle,
const wchar_t* haystack);
1610 const char* needle_expr,
const char* haystack_expr,
1613 const char* needle_expr,
const char* haystack_expr,
1616 #if GTEST_HAS_STD_WSTRING
1618 const char* needle_expr,
const char* haystack_expr,
1621 const char* needle_expr,
const char* haystack_expr,
1634 template <
typename RawType>
1636 const char* actual_expression,
1639 const FloatingPoint<RawType> lhs(expected), rhs(actual);
1641 if (lhs.AlmostEquals(rhs)) {
1645 ::std::stringstream expected_ss;
1646 expected_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
1649 ::std::stringstream actual_ss;
1650 actual_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
1665 const char* abs_error_expr,
1690 struct AssertHelperData {
1692 const char* srcfile,
1695 : type(t), file(srcfile), line(line_num),
message(msg) { }
1698 const char*
const file;
1706 AssertHelperData*
const data_;
1713 #if GTEST_HAS_PARAM_TEST
1748 template <
typename T>
1749 class WithParamInterface {
1751 typedef T ParamType;
1752 virtual ~WithParamInterface() {}
1759 const ParamType& GetParam()
const {
1761 <<
"GetParam() can only be called inside a value-parameterized test "
1762 <<
"-- did you intend to write TEST_P instead of TEST_F?";
1769 static void SetParam(
const ParamType* parameter) {
1770 parameter_ = parameter;
1774 static const ParamType* parameter_;
1777 template <
class TestClass>
friend class internal::ParameterizedTestFactory;
1780 template <
typename T>
1781 const T* WithParamInterface<T>::parameter_ = NULL;
1786 template <
typename T>
1787 class TestWithParam :
public Test,
public WithParamInterface<T> {
1812 #define ADD_FAILURE() GTEST_NONFATAL_FAILURE_("Failed")
1816 #define ADD_FAILURE_AT(file, line) \
1817 GTEST_MESSAGE_AT_(file, line, "Failed", \
1818 ::testing::TestPartResult::kNonFatalFailure)
1821 #define GTEST_FAIL() GTEST_FATAL_FAILURE_("Failed")
1825 #if !GTEST_DONT_DEFINE_FAIL
1826 # define FAIL() GTEST_FAIL()
1830 #define GTEST_SUCCEED() GTEST_SUCCESS_("Succeeded")
1834 #if !GTEST_DONT_DEFINE_SUCCEED
1835 # define SUCCEED() GTEST_SUCCEED()
1847 #define EXPECT_THROW(statement, expected_exception) \
1848 GTEST_TEST_THROW_(statement, expected_exception, GTEST_NONFATAL_FAILURE_)
1849 #define EXPECT_NO_THROW(statement) \
1850 GTEST_TEST_NO_THROW_(statement, GTEST_NONFATAL_FAILURE_)
1851 #define EXPECT_ANY_THROW(statement) \
1852 GTEST_TEST_ANY_THROW_(statement, GTEST_NONFATAL_FAILURE_)
1853 #define ASSERT_THROW(statement, expected_exception) \
1854 GTEST_TEST_THROW_(statement, expected_exception, GTEST_FATAL_FAILURE_)
1855 #define ASSERT_NO_THROW(statement) \
1856 GTEST_TEST_NO_THROW_(statement, GTEST_FATAL_FAILURE_)
1857 #define ASSERT_ANY_THROW(statement) \
1858 GTEST_TEST_ANY_THROW_(statement, GTEST_FATAL_FAILURE_)
1863 #define EXPECT_TRUE(condition) \
1864 GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
1865 GTEST_NONFATAL_FAILURE_)
1866 #define EXPECT_FALSE(condition) \
1867 GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
1868 GTEST_NONFATAL_FAILURE_)
1869 #define ASSERT_TRUE(condition) \
1870 GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
1871 GTEST_FATAL_FAILURE_)
1872 #define ASSERT_FALSE(condition) \
1873 GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
1874 GTEST_FATAL_FAILURE_)
1878 #include "gtest/gtest_pred_impl.h"
1926 #define EXPECT_EQ(expected, actual) \
1927 EXPECT_PRED_FORMAT2(::testing::internal:: \
1928 EqHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, \
1930 #define EXPECT_NE(expected, actual) \
1931 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperNE, expected, actual)
1932 #define EXPECT_LE(val1, val2) \
1933 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
1934 #define EXPECT_LT(val1, val2) \
1935 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
1936 #define EXPECT_GE(val1, val2) \
1937 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
1938 #define EXPECT_GT(val1, val2) \
1939 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
1941 #define GTEST_ASSERT_EQ(expected, actual) \
1942 ASSERT_PRED_FORMAT2(::testing::internal:: \
1943 EqHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, \
1945 #define GTEST_ASSERT_NE(val1, val2) \
1946 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)
1947 #define GTEST_ASSERT_LE(val1, val2) \
1948 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
1949 #define GTEST_ASSERT_LT(val1, val2) \
1950 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
1951 #define GTEST_ASSERT_GE(val1, val2) \
1952 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
1953 #define GTEST_ASSERT_GT(val1, val2) \
1954 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
1959 #if !GTEST_DONT_DEFINE_ASSERT_EQ
1960 # define ASSERT_EQ(val1, val2) GTEST_ASSERT_EQ(val1, val2)
1963 #if !GTEST_DONT_DEFINE_ASSERT_NE
1964 # define ASSERT_NE(val1, val2) GTEST_ASSERT_NE(val1, val2)
1967 #if !GTEST_DONT_DEFINE_ASSERT_LE
1968 # define ASSERT_LE(val1, val2) GTEST_ASSERT_LE(val1, val2)
1971 #if !GTEST_DONT_DEFINE_ASSERT_LT
1972 # define ASSERT_LT(val1, val2) GTEST_ASSERT_LT(val1, val2)
1975 #if !GTEST_DONT_DEFINE_ASSERT_GE
1976 # define ASSERT_GE(val1, val2) GTEST_ASSERT_GE(val1, val2)
1979 #if !GTEST_DONT_DEFINE_ASSERT_GT
1980 # define ASSERT_GT(val1, val2) GTEST_ASSERT_GT(val1, val2)
1999 #define EXPECT_STREQ(expected, actual) \
2000 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, expected, actual)
2001 #define EXPECT_STRNE(s1, s2) \
2002 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
2003 #define EXPECT_STRCASEEQ(expected, actual) \
2004 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, expected, actual)
2005 #define EXPECT_STRCASENE(s1, s2)\
2006 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
2008 #define ASSERT_STREQ(expected, actual) \
2009 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, expected, actual)
2010 #define ASSERT_STRNE(s1, s2) \
2011 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
2012 #define ASSERT_STRCASEEQ(expected, actual) \
2013 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, expected, actual)
2014 #define ASSERT_STRCASENE(s1, s2)\
2015 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
2031 #define EXPECT_FLOAT_EQ(expected, actual)\
2032 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
2035 #define EXPECT_DOUBLE_EQ(expected, actual)\
2036 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
2039 #define ASSERT_FLOAT_EQ(expected, actual)\
2040 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
2043 #define ASSERT_DOUBLE_EQ(expected, actual)\
2044 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
2047 #define EXPECT_NEAR(val1, val2, abs_error)\
2048 EXPECT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
2049 val1, val2, abs_error)
2051 #define ASSERT_NEAR(val1, val2, abs_error)\
2052 ASSERT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
2053 val1, val2, abs_error)
2063 float val1,
float val2);
2065 double val1,
double val2);
2068 #if GTEST_OS_WINDOWS
2079 # define EXPECT_HRESULT_SUCCEEDED(expr) \
2080 EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
2082 # define ASSERT_HRESULT_SUCCEEDED(expr) \
2083 ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
2085 # define EXPECT_HRESULT_FAILED(expr) \
2086 EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
2088 # define ASSERT_HRESULT_FAILED(expr) \
2089 ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
2103 #define ASSERT_NO_FATAL_FAILURE(statement) \
2104 GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_FATAL_FAILURE_)
2105 #define EXPECT_NO_FATAL_FAILURE(statement) \
2106 GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_NONFATAL_FAILURE_)
2119 #define SCOPED_TRACE(message) \
2120 ::testing::internal::ScopedTrace GTEST_CONCAT_TOKEN_(gtest_trace_, __LINE__)(\
2121 __FILE__, __LINE__, ::testing::Message() << (message))
2153 template <
typename T1,
typename T2>
2155 (void)internal::StaticAssertTypeEqHelper<T1, T2>();
2184 #define GTEST_TEST(test_case_name, test_name)\
2185 GTEST_TEST_(test_case_name, test_name, \
2186 ::testing::Test, ::testing::internal::GetTestTypeId())
2190 #if !GTEST_DONT_DEFINE_TEST
2191 # define TEST(test_case_name, test_name) GTEST_TEST(test_case_name, test_name)
2220 #define TEST_F(test_fixture, test_name)\
2221 GTEST_TEST_(test_fixture, test_name, test_fixture, \
2222 ::testing::internal::GetTypeId<test_fixture>())
2237 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 *expected_expression, const char *actual_expression, const T1 &expected, const T2 &actual, typename EnableIf<!is_pointer< T2 >::value >::type *=0)
static AssertionResult Compare(const char *expected_expression, const char *actual_expression, Secret *, T *actual)
static AssertionResult Compare(const char *expected_expression, const char *actual_expression, BiggestInt expected, BiggestInt actual)
static AssertionResult Compare(const char *expected_expression, const char *actual_expression, const T1 &expected, const T2 &actual)
std::string message("Message requiring signing")
expect< void > success() noexcept
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
#define GTEST_IMPL_CMP_HELPER_(op_name, op)
uint64_t random(const uint64_t max_value)