51 #ifndef GTEST_INCLUDE_GTEST_GTEST_H_ 52 #define GTEST_INCLUDE_GTEST_GTEST_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);
320 void AppendMessage(
const Message& a_message) {
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;
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();
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;
567 friend class internal::DefaultGlobalTestPartResultReporter;
568 friend class internal::ExecDeathTest;
569 friend class internal::TestResultAccessor;
570 friend class internal::UnitTestImpl;
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,
598 static bool ValidateTestProperty(
const std::string& xml_element,
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_;
627 TimeInMillis elapsed_time_;
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;
710 #endif // GTEST_HAS_DEATH_TEST 713 friend class internal::UnitTestImpl;
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();
763 bool matches_filter_;
792 TestCase(
const char* name,
const char* a_type_param,
800 const char*
name()
const {
return name_.c_str(); }
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;
853 friend class internal::UnitTestImpl;
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) {
899 static bool TestFailed(
const TestInfo* test_info) {
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) {
920 static bool ShouldRunTest(
const TestInfo* test_info) {
928 void UnshuffleTests();
937 std::vector<TestInfo*> test_info_list_;
941 std::vector<int> test_indices_;
949 TimeInMillis elapsed_time_;
985 struct Setup_should_be_spelled_SetUp {};
986 virtual Setup_should_be_spelled_SetUp* Setup() {
return NULL; }
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_;
1102 friend class internal::DefaultGlobalTestPartResultReporter;
1103 friend class internal::NoExecDeathTest;
1105 friend class internal::UnitTestImpl;
1127 bool EventForwardingEnabled()
const;
1128 void SuppressEventForwarding();
1131 internal::TestEventRepeater* repeater_;
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);
1287 internal::UnitTestImpl* impl() {
return impl_; }
1288 const internal::UnitTestImpl* impl()
const {
return impl_; }
1295 friend class internal::StreamingListenerTest;
1311 void PushGTestTrace(
const internal::TraceInfo& trace)
1315 void PopGTestTrace()
1316 GTEST_LOCK_EXCLUDED_(mutex_);
1320 mutable internal::Mutex 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;
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,
1674 const char* message);
1679 void operator=(
const Message& message)
const;
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> {
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_) 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_ GTEST_API_ AssertionResult DoubleLE(const char *expr1, const char *expr2, double val1, double val2)
Definition: gtest-internal.h:855
virtual void OnEnvironmentsSetUpEnd(const UnitTest &)
Definition: gtest.h:1050
void ReportFailureInUnknownLocation(TestPartResult::Type result_type, const std::string &message)
Environment * AddGlobalTestEnvironment(Environment *env)
Definition: gtest.h:1350
internal::SetUpTestCaseFunc SetUpTestCaseFunc
Definition: gtest.h:377
GTEST_API_ AssertionResult DoubleNearPredFormat(const char *expr1, const char *expr2, const char *abs_error_expr, double val1, double val2, double abs_error)
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)
Definition: gmock-actions.h:53
const char * test_case_name() const
Definition: gtest.h:651
TimeInMillis elapsed_time() const
Definition: gtest.h:841
bool Passed() const
Definition: gtest.h:539
virtual void OnTestIterationStart(const UnitTest &, int)
Definition: gtest.h:1047
GTEST_DECLARE_int32_(random_seed)
bool Passed() const
Definition: gtest.h:835
def Run(command)
Definition: gtest_break_on_failure_unittest.py:80
AssertionResult CmpHelperEQ(const char *lhs_expression, const char *rhs_expression, const T1 &lhs, const T2 &rhs)
Definition: gtest.h:1387
#define GTEST_DISABLE_MSC_WARNINGS_POP_()
Definition: gtest-port.h:318
const char * type_param() const
Definition: gtest.h:804
const char * failure_message() const
Definition: gtest.h:302
virtual void OnTestPartResult(const TestPartResult &)
Definition: gtest.h:1053
GTEST_API_ AssertionResult CmpHelperSTRNE(const char *s1_expression, const char *s2_expression, const char *s1, const char *s2)
const TestResult * result() const
Definition: gtest.h:705
GTEST_API_ AssertionResult IsSubstring(const char *needle_expr, const char *haystack_expr, const char *needle, const char *haystack)
virtual void OnEnvironmentsTearDownStart(const UnitTest &)
Definition: gtest.h:1056
::std::string string
Definition: gtest-port.h:1097
Definition: gtest-internal.h:262
virtual void OnTestCaseStart(const TestCase &)
Definition: gtest.h:1051
GTEST_API_ AssertionResult AssertionFailure()
Definition: gtest_unittest.cc:160
Definition: gtest-port.h:2213
void SetValue(const std::string &new_value)
Definition: gtest.h:506
const char * type_param() const
Definition: gtest.h:658
::std::wstring wstring
Definition: gtest-port.h:1103
GTEST_DECLARE_bool_(also_run_disabled_tests)
GTEST_API_ AssertionResult IsNotSubstring(const char *needle_expr, const char *haystack_expr, const char *needle, const char *haystack)
#define GTEST_API_
Definition: gtest-port.h:934
virtual void TearDown()
Definition: gtest.h:981
GTEST_API_ AssertionResult AssertionSuccess()
Definition: gtest-test-part.h:47
virtual ~TestEventListener()
Definition: gtest.h:993
std::string FormatForComparisonFailureMessage(const T1 &value, const T2 &)
Definition: gtest-printers.h:349
virtual void OnTestProgramStart(const UnitTest &)
Definition: gtest.h:1046
TypeWithSize< 8 >::Int TimeInMillis
Definition: gtest-port.h:2498
TestEventListener * default_result_printer() const
Definition: gtest.h:1084
#define GTEST_LOCK_EXCLUDED_(locks)
Definition: gtest-port.h:2534
AssertionResult & operator<<(::std::ostream &(*basic_manipulator)(::std::ostream &stream))
Definition: gtest.h:312
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)
TestEventListener * default_xml_generator() const
Definition: gtest.h:1095
GTEST_API_ std::string StringStreamToString(::std::stringstream *stream)
Definition: gtest_unittest.cc:184
virtual ~Environment()
Definition: gtest.h:975
AssertionResult & operator<<(const T &value)
Definition: gtest.h:305
Definition: gtest-internal.h:504
const void * TypeId
Definition: gtest-internal.h:429
AssertionResult CmpHelperFloatingPointEQ(const char *lhs_expression, const char *rhs_expression, RawType lhs_value, RawType rhs_value)
Definition: gtest.h:1631
GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char *s1_expression, const char *s2_expression, const char *s1, const char *s2)
TestCase
Definition: gmock_test_utils.py:101
bool should_run() const
Definition: gtest.h:694
virtual void OnTestStart(const TestInfo &)
Definition: gtest.h:1052
static void TearDownTestCase()
Definition: gtest.h:397
const char * name() const
Definition: gtest.h:800
bool should_run() const
Definition: gtest.h:811
GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char *s1_expression, const char *s2_expression, const char *s1, const char *s2)
#define GTEST_DISABLE_MSC_WARNINGS_PUSH_(warnings)
Definition: gtest-port.h:317
const char * message() const
Definition: gtest.h:297
virtual void OnEnvironmentsTearDownEnd(const UnitTest &)
Definition: gtest.h:1057
#define GTEST_CHECK_(condition)
Definition: gtest-port.h:1295
Definition: gtest-port.h:1084
const int kMaxStackTraceDepth
Definition: gtest.h:147
GTEST_API_ void InitGoogleTest(int *argc, char **argv)
GTEST_DECLARE_string_(death_test_style)
AssertionResult CmpHelperOpFailure(const char *expr1, const char *expr2, const T1 &val1, const T2 &val2, const char *op)
Definition: gtest.h:1486
static bool HasFailure()
Definition: gtest.h:407
virtual void OnTestIterationEnd(const UnitTest &, int)
Definition: gtest.h:1058
const char * key() const
Definition: gtest.h:496
void(* SetUpTestCaseFunc)()
Definition: gtest-internal.h:501
virtual void SetUp()
Definition: gtest.h:978
static AssertionResult Compare(const char *lhs_expression, const char *rhs_expression, Secret *, T *rhs)
Definition: gtest.h:1465
void(* TearDownTestCaseFunc)()
Definition: gtest-internal.h:502
const TestResult & ad_hoc_test_result() const
Definition: gtest.h:849
Definition: gtest-internal.h:156
bool Failed() const
Definition: gtest.h:838
long long BiggestInt
Definition: gtest-port.h:2241
GTEST_IMPL_CMP_HELPER_(NE, !=)
TestProperty(const std::string &a_key, const std::string &a_value)
Definition: gtest.h:491
virtual void OnTestCaseEnd(const TestCase &)
Definition: gtest.h:1055
const char * value_param() const
Definition: gtest.h:666
internal::TearDownTestCaseFunc TearDownTestCaseFunc
Definition: gtest.h:378
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)
Definition: gtest.h:1448
output
Definition: gmock_output_test.py:175
static void SetUpTestCase()
Definition: gtest.h:389
AssertionResult CmpHelperEQFailure(const char *lhs_expression, const char *rhs_expression, const T1 &lhs, const T2 &rhs)
Definition: gtest.h:1375
bool is_reportable() const
Definition: gtest.h:697
AssertionResult(const T &success, typename internal::EnableIf< !internal::ImplicitlyConvertible< T, AssertionResult >::value >::type *=NULL)
Definition: gtest.h:272
Definition: gtest-internal.h:946
type
Definition: upload.py:443
GTEST_API_ AssertionResult CmpHelperSTREQ(const char *s1_expression, const char *s2_expression, const char *s1, const char *s2)
GTEST_API_ AssertionResult FloatLE(const char *expr1, const char *expr2, float val1, float val2)
int line() const
Definition: gtest.h:676
static AssertionResult Compare(const char *lhs_expression, const char *rhs_expression, const T1 &lhs, const T2 &rhs)
Definition: gtest.h:1417
#define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)
Definition: gtest-port.h:874
int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_
Definition: gtest.h:2232
bool StaticAssertTypeEq()
Definition: gtest.h:2150
virtual void OnTestProgramEnd(const UnitTest &)
Definition: gtest.h:1060
virtual void OnTestEnd(const TestInfo &)
Definition: gtest.h:1054
Definition: gtest-port.h:2136
Definition: gtest-internal.h:464
const char * value() const
Definition: gtest.h:501
static UnitTest * GetInstance()
const char * name() const
Definition: gtest.h:654
tuple message
Definition: gtest_output_test.py:331
const char * file() const
Definition: gtest.h:673
static AssertionResult Compare(const char *lhs_expression, const char *rhs_expression, BiggestInt lhs, BiggestInt rhs)
Definition: gtest.h:1430
Definition: gtest-message.h:85
Definition: gtest-internal.h:752
static const std::string key
The database key to be used by the protocol given the METADATA object.
Definition: SharedAVSSettingProtocolTest.cpp:58
Type
Definition: gtest-test-part.h:51
class UnitTestImpl * GetUnitTestImpl()
#define GTEST_MUST_USE_RESULT_
Definition: gtest-port.h:886
std::string GetString() const
virtual void OnEnvironmentsSetUpStart(const UnitTest &)
Definition: gtest.h:1049
TimeInMillis elapsed_time() const
Definition: gtest.h:551