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;
265 operator bool()
const {
return success_; }
275 return message_.get() != NULL ? message_->c_str() :
"";
283 AppendMessage(
Message() << value);
290 ::std::ostream& (*basic_manipulator)(::std::ostream& stream)) {
291 AppendMessage(
Message() << basic_manipulator);
297 void AppendMessage(
const Message& a_message) {
298 if (message_.get() == NULL)
300 message_->append(a_message.
GetString().c_str());
309 internal::scoped_ptr< ::std::string> message_;
376 static bool HasFatalFailure();
379 static bool HasNonfatalFailure();
383 static bool HasFailure() {
return HasFatalFailure() || HasNonfatalFailure(); }
399 static void RecordProperty(
const std::string& key,
int value);
406 virtual void SetUp();
409 virtual void TearDown();
414 static bool HasSameFixtureClass();
422 virtual void TestBody() = 0;
429 void DeleteSelf_() {
delete this; }
432 const internal::GTestFlagSaver*
const gtest_flag_saver_;
450 struct Setup_should_be_spelled_SetUp {};
451 virtual Setup_should_be_spelled_SetUp* Setup() {
return NULL; }
469 key_(a_key), value_(a_value) {
479 return value_.c_str();
510 int total_part_count()
const;
513 int test_property_count()
const;
516 bool Passed()
const {
return !Failed(); }
522 bool HasFatalFailure()
const;
525 bool HasNonfatalFailure()
const;
545 friend class internal::ExecDeathTest;
548 friend class internal::WindowsDeathTest;
551 const std::vector<TestPartResult>& test_part_results()
const {
552 return test_part_results_;
556 const std::vector<TestProperty>& test_properties()
const {
557 return test_properties_;
561 void set_elapsed_time(TimeInMillis elapsed) { elapsed_time_ = elapsed; }
569 void RecordProperty(
const std::string& xml_element,
570 const TestProperty& test_property);
575 static bool ValidateTestProperty(
const std::string& xml_element,
576 const TestProperty& test_property);
579 void AddTestPartResult(
const TestPartResult& test_part_result);
582 int death_test_count()
const {
return death_test_count_; }
585 int increment_death_test_count() {
return ++death_test_count_; }
588 void ClearTestPartResults();
595 internal::Mutex test_properites_mutex_;
598 std::vector<TestPartResult> test_part_results_;
600 std::vector<TestProperty> test_properties_;
602 int death_test_count_;
604 TimeInMillis elapsed_time_;
636 if (type_param_.get() != NULL)
637 return type_param_->c_str();
644 if (value_param_.get() != NULL)
645 return value_param_->c_str();
672 return matches_filter_;
679 #if GTEST_HAS_DEATH_TEST
680 friend class internal::DefaultDeathTestFactory;
681 #endif // GTEST_HAS_DEATH_TEST
685 friend class internal::StreamingListenerTest;
687 const char* test_case_name,
689 const char* type_param,
690 const char* value_param,
700 const char* a_type_param,
701 const char* a_value_param,
707 int increment_death_test_count() {
708 return result_.increment_death_test_count();
715 static void ClearTestResult(
TestInfo* test_info) {
716 test_info->result_.Clear();
724 const internal::scoped_ptr<const ::std::string> type_param_;
727 const internal::scoped_ptr<const ::std::string> value_param_;
731 bool matches_filter_;
733 internal::TestFactoryBase*
const factory_;
760 TestCase(
const char* name,
const char* a_type_param,
773 if (type_param_.get() != NULL)
774 return type_param_->c_str();
782 int successful_test_count()
const;
785 int failed_test_count()
const;
788 int reportable_disabled_test_count()
const;
791 int disabled_test_count()
const;
794 int reportable_test_count()
const;
797 int test_to_run_count()
const;
800 int total_test_count()
const;
803 bool Passed()
const {
return !Failed(); }
806 bool Failed()
const {
return failed_test_count() > 0; }
813 const TestInfo* GetTestInfo(
int i)
const;
824 std::vector<TestInfo*>& test_info_list() {
return test_info_list_; }
827 const std::vector<TestInfo*>& test_info_list()
const {
828 return test_info_list_;
833 TestInfo* GetMutableTestInfo(
int i);
836 void set_should_run(
bool should) { should_run_ = should; }
840 void AddTestInfo(TestInfo * test_info);
846 static void ClearTestCaseResult(TestCase* test_case) {
847 test_case->ClearResult();
855 void RunSetUpTestCase() { (*set_up_tc_)(); }
859 void RunTearDownTestCase() { (*tear_down_tc_)(); }
862 static bool TestPassed(
const TestInfo* test_info) {
863 return test_info->should_run() && test_info->result()->Passed();
867 static bool TestFailed(
const TestInfo* test_info) {
868 return test_info->should_run() && test_info->result()->Failed();
873 static bool TestReportableDisabled(
const TestInfo* test_info) {
874 return test_info->is_reportable() && test_info->is_disabled_;
878 static bool TestDisabled(
const TestInfo* test_info) {
879 return test_info->is_disabled_;
883 static bool TestReportable(
const TestInfo* test_info) {
884 return test_info->is_reportable();
888 static bool ShouldRunTest(
const TestInfo* test_info) {
889 return test_info->should_run();
893 void ShuffleTests(internal::Random* random);
896 void UnshuffleTests();
902 const internal::scoped_ptr<const ::std::string> type_param_;
905 std::vector<TestInfo*> test_info_list_;
909 std::vector<int> test_indices_;
917 TimeInMillis elapsed_time_;
920 TestResult ad_hoc_test_result_;
953 struct Setup_should_be_spelled_SetUp {};
954 virtual Setup_should_be_spelled_SetUp* Setup() {
return NULL; }
1053 return default_result_printer_;
1064 return default_xml_generator_;
1071 friend class internal::NoExecDeathTest;
1072 friend class internal::TestEventListenersAccessor;
1095 bool EventForwardingEnabled()
const;
1096 void SuppressEventForwarding();
1099 internal::TestEventRepeater* repeater_;
1136 const char* original_working_dir()
const;
1140 const TestCase* current_test_case()
const
1145 const TestInfo* current_test_info()
const
1149 int random_seed()
const;
1151 #if GTEST_HAS_PARAM_TEST
1156 internal::ParameterizedTestCaseRegistry& parameterized_test_registry()
1158 #endif // GTEST_HAS_PARAM_TEST
1161 int successful_test_case_count()
const;
1164 int failed_test_case_count()
const;
1167 int total_test_case_count()
const;
1171 int test_case_to_run_count()
const;
1174 int successful_test_count()
const;
1177 int failed_test_count()
const;
1180 int reportable_disabled_test_count()
const;
1183 int disabled_test_count()
const;
1186 int reportable_test_count()
const;
1189 int total_test_count()
const;
1192 int test_to_run_count()
const;
1196 TimeInMillis start_timestamp()
const;
1199 TimeInMillis elapsed_time()
const;
1202 bool Passed()
const;
1206 bool Failed()
const;
1210 const TestCase* GetTestCase(
int i)
const;
1214 const TestResult& ad_hoc_test_result()
const;
1237 const char* file_name,
1252 TestCase* GetMutableTestCase(
int i);
1263 friend class internal::StreamingListenerTest;
1264 friend class internal::UnitTestRecordPropertyTestHelper;
1283 void PopGTestTrace()
1284 GTEST_LOCK_EXCLUDED_(mutex_);
1288 mutable internal::Mutex mutex_;
1294 internal::UnitTestImpl* impl_;
1337 namespace internal {
1354 template <
typename ToPr
int,
typename OtherOperand>
1363 template <
typename ToPr
int,
size_t N,
typename OtherOperand>
1374 #define GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(CharType) \
1375 template <typename OtherOperand> \
1376 class FormatForComparison<CharType*, OtherOperand> { \
1378 static ::std::string Format(CharType* value) { \
1379 return ::testing::PrintToString(static_cast<const void*>(value)); \
1388 #undef GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_
1393 #define GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(CharType, OtherStringType) \
1395 class FormatForComparison<CharType*, OtherStringType> { \
1397 static ::std::string Format(CharType* value) { \
1398 return ::testing::PrintToString(value); \
1405 #if GTEST_HAS_GLOBAL_STRING
1410 #if GTEST_HAS_GLOBAL_WSTRING
1415 #if GTEST_HAS_STD_WSTRING
1420 #undef GTEST_IMPL_FORMAT_C_STRING_AS_STRING_
1430 template <
typename T1,
typename T2>
1432 const T1& value,
const T2& ) {
1437 template <
typename T1,
typename T2>
1439 const char* actual_expression,
1443 # pragma warning(push) // Saves the current warning state.
1444 # pragma warning(disable:4389) // Temporarily disables warning on
1448 if (expected == actual) {
1453 # pragma warning(pop) // Restores the warning state.
1467 const char* actual_expression,
1475 template <
bool lhs_is_null_literal>
1479 template <
typename T1,
typename T2>
1481 const char* actual_expression,
1484 return CmpHelperEQ(expected_expression, actual_expression, expected,
1495 const char* actual_expression,
1498 return CmpHelperEQ(expected_expression, actual_expression, expected,
1512 template <
typename T1,
typename T2>
1514 const char* expected_expression,
1515 const char* actual_expression,
1524 return CmpHelperEQ(expected_expression, actual_expression, expected,
1530 template <
typename T>
1532 const char* expected_expression,
1533 const char* actual_expression,
1543 return CmpHelperEQ(expected_expression, actual_expression,
1544 static_cast<T*>(NULL), actual);
1558 #define GTEST_IMPL_CMP_HELPER_(op_name, op)\
1559 template <typename T1, typename T2>\
1560 AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \
1561 const T1& val1, const T2& val2) {\
1562 if (val1 op val2) {\
1563 return AssertionSuccess();\
1565 return AssertionFailure() \
1566 << "Expected: (" << expr1 << ") " #op " (" << expr2\
1567 << "), actual: " << FormatForComparisonFailureMessage(val1, val2)\
1568 << " vs " << FormatForComparisonFailureMessage(val2, val1);\
1571 GTEST_API_ AssertionResult CmpHelper##op_name(\
1572 const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2)
1587 #undef GTEST_IMPL_CMP_HELPER_
1593 const char* actual_expression,
1594 const char* expected,
1595 const char* actual);
1601 const char* actual_expression,
1602 const char* expected,
1603 const char* actual);
1609 const char* s2_expression,
1617 const char* s2_expression,
1626 const char* actual_expression,
1627 const wchar_t* expected,
1628 const wchar_t* actual);
1634 const char* s2_expression,
1649 const char* needle_expr,
const char* haystack_expr,
1650 const char* needle,
const char* haystack);
1652 const char* needle_expr,
const char* haystack_expr,
1653 const wchar_t* needle,
const wchar_t* haystack);
1655 const char* needle_expr,
const char* haystack_expr,
1656 const char* needle,
const char* haystack);
1658 const char* needle_expr,
const char* haystack_expr,
1659 const wchar_t* needle,
const wchar_t* haystack);
1661 const char* needle_expr,
const char* haystack_expr,
1664 const char* needle_expr,
const char* haystack_expr,
1667 #if GTEST_HAS_STD_WSTRING
1669 const char* needle_expr,
const char* haystack_expr,
1672 const char* needle_expr,
const char* haystack_expr,
1674 #endif // GTEST_HAS_STD_WSTRING
1676 namespace internal {
1685 template <
typename RawType>
1687 const char* actual_expression,
1692 if (lhs.AlmostEquals(rhs)) {
1696 ::std::stringstream expected_ss;
1697 expected_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
1700 ::std::stringstream actual_ss;
1701 actual_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
1716 const char* abs_error_expr,
1729 const char* message);
1734 void operator=(
const Message& message)
const;
1741 struct AssertHelperData {
1743 const char* srcfile,
1746 : type(t), file(srcfile), line(line_num), message(msg) { }
1749 const char*
const file;
1757 AssertHelperData*
const data_;
1764 #if GTEST_HAS_PARAM_TEST
1799 template <
typename T>
1800 class WithParamInterface {
1802 typedef T ParamType;
1803 virtual ~WithParamInterface() {}
1810 const ParamType& GetParam()
const {
1812 <<
"GetParam() can only be called inside a value-parameterized test "
1813 <<
"-- did you intend to write TEST_P instead of TEST_F?";
1820 static void SetParam(
const ParamType* parameter) {
1821 parameter_ = parameter;
1825 static const ParamType* parameter_;
1828 template <
class TestClass>
friend class internal::ParameterizedTestFactory;
1831 template <
typename T>
1832 const T* WithParamInterface<T>::parameter_ = NULL;
1837 template <
typename T>
1838 class TestWithParam :
public Test,
public WithParamInterface<T> {
1841 #endif // GTEST_HAS_PARAM_TEST
1863 #define ADD_FAILURE() GTEST_NONFATAL_FAILURE_("Failed")
1867 #define ADD_FAILURE_AT(file, line) \
1868 GTEST_MESSAGE_AT_(file, line, "Failed", \
1869 ::testing::TestPartResult::kNonFatalFailure)
1872 #define GTEST_FAIL() GTEST_FATAL_FAILURE_("Failed")
1876 #if !GTEST_DONT_DEFINE_FAIL
1877 # define FAIL() GTEST_FAIL()
1881 #define GTEST_SUCCEED() GTEST_SUCCESS_("Succeeded")
1885 #if !GTEST_DONT_DEFINE_SUCCEED
1886 # define SUCCEED() GTEST_SUCCEED()
1898 #define EXPECT_THROW(statement, expected_exception) \
1899 GTEST_TEST_THROW_(statement, expected_exception, GTEST_NONFATAL_FAILURE_)
1900 #define EXPECT_NO_THROW(statement) \
1901 GTEST_TEST_NO_THROW_(statement, GTEST_NONFATAL_FAILURE_)
1902 #define EXPECT_ANY_THROW(statement) \
1903 GTEST_TEST_ANY_THROW_(statement, GTEST_NONFATAL_FAILURE_)
1904 #define ASSERT_THROW(statement, expected_exception) \
1905 GTEST_TEST_THROW_(statement, expected_exception, GTEST_FATAL_FAILURE_)
1906 #define ASSERT_NO_THROW(statement) \
1907 GTEST_TEST_NO_THROW_(statement, GTEST_FATAL_FAILURE_)
1908 #define ASSERT_ANY_THROW(statement) \
1909 GTEST_TEST_ANY_THROW_(statement, GTEST_FATAL_FAILURE_)
1914 #define EXPECT_TRUE(condition) \
1915 GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
1916 GTEST_NONFATAL_FAILURE_)
1917 #define EXPECT_FALSE(condition) \
1918 GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
1919 GTEST_NONFATAL_FAILURE_)
1920 #define ASSERT_TRUE(condition) \
1921 GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \
1922 GTEST_FATAL_FAILURE_)
1923 #define ASSERT_FALSE(condition) \
1924 GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \
1925 GTEST_FATAL_FAILURE_)
1977 #define EXPECT_EQ(expected, actual) \
1978 EXPECT_PRED_FORMAT2(::testing::internal:: \
1979 EqHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, \
1981 #define EXPECT_NE(expected, actual) \
1982 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperNE, expected, actual)
1983 #define EXPECT_LE(val1, val2) \
1984 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
1985 #define EXPECT_LT(val1, val2) \
1986 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
1987 #define EXPECT_GE(val1, val2) \
1988 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
1989 #define EXPECT_GT(val1, val2) \
1990 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
1992 #define GTEST_ASSERT_EQ(expected, actual) \
1993 ASSERT_PRED_FORMAT2(::testing::internal:: \
1994 EqHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, \
1996 #define GTEST_ASSERT_NE(val1, val2) \
1997 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2)
1998 #define GTEST_ASSERT_LE(val1, val2) \
1999 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2)
2000 #define GTEST_ASSERT_LT(val1, val2) \
2001 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2)
2002 #define GTEST_ASSERT_GE(val1, val2) \
2003 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2)
2004 #define GTEST_ASSERT_GT(val1, val2) \
2005 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2)
2010 #if !GTEST_DONT_DEFINE_ASSERT_EQ
2011 # define ASSERT_EQ(val1, val2) GTEST_ASSERT_EQ(val1, val2)
2014 #if !GTEST_DONT_DEFINE_ASSERT_NE
2015 # define ASSERT_NE(val1, val2) GTEST_ASSERT_NE(val1, val2)
2018 #if !GTEST_DONT_DEFINE_ASSERT_LE
2019 # define ASSERT_LE(val1, val2) GTEST_ASSERT_LE(val1, val2)
2022 #if !GTEST_DONT_DEFINE_ASSERT_LT
2023 # define ASSERT_LT(val1, val2) GTEST_ASSERT_LT(val1, val2)
2026 #if !GTEST_DONT_DEFINE_ASSERT_GE
2027 # define ASSERT_GE(val1, val2) GTEST_ASSERT_GE(val1, val2)
2030 #if !GTEST_DONT_DEFINE_ASSERT_GT
2031 # define ASSERT_GT(val1, val2) GTEST_ASSERT_GT(val1, val2)
2050 #define EXPECT_STREQ(expected, actual) \
2051 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, expected, actual)
2052 #define EXPECT_STRNE(s1, s2) \
2053 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
2054 #define EXPECT_STRCASEEQ(expected, actual) \
2055 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, expected, actual)
2056 #define EXPECT_STRCASENE(s1, s2)\
2057 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
2059 #define ASSERT_STREQ(expected, actual) \
2060 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, expected, actual)
2061 #define ASSERT_STRNE(s1, s2) \
2062 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2)
2063 #define ASSERT_STRCASEEQ(expected, actual) \
2064 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, expected, actual)
2065 #define ASSERT_STRCASENE(s1, s2)\
2066 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2)
2082 #define EXPECT_FLOAT_EQ(expected, actual)\
2083 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
2086 #define EXPECT_DOUBLE_EQ(expected, actual)\
2087 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
2090 #define ASSERT_FLOAT_EQ(expected, actual)\
2091 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \
2094 #define ASSERT_DOUBLE_EQ(expected, actual)\
2095 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \
2098 #define EXPECT_NEAR(val1, val2, abs_error)\
2099 EXPECT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
2100 val1, val2, abs_error)
2102 #define ASSERT_NEAR(val1, val2, abs_error)\
2103 ASSERT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \
2104 val1, val2, abs_error)
2114 float val1,
float val2);
2116 double val1,
double val2);
2119 #if GTEST_OS_WINDOWS
2130 # define EXPECT_HRESULT_SUCCEEDED(expr) \
2131 EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
2133 # define ASSERT_HRESULT_SUCCEEDED(expr) \
2134 ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr))
2136 # define EXPECT_HRESULT_FAILED(expr) \
2137 EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
2139 # define ASSERT_HRESULT_FAILED(expr) \
2140 ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr))
2142 #endif // GTEST_OS_WINDOWS
2154 #define ASSERT_NO_FATAL_FAILURE(statement) \
2155 GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_FATAL_FAILURE_)
2156 #define EXPECT_NO_FATAL_FAILURE(statement) \
2157 GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_NONFATAL_FAILURE_)
2170 #define SCOPED_TRACE(message) \
2171 ::testing::internal::ScopedTrace GTEST_CONCAT_TOKEN_(gtest_trace_, __LINE__)(\
2172 __FILE__, __LINE__, ::testing::Message() << (message))
2204 template <
typename T1,
typename T2>
2235 #define GTEST_TEST(test_case_name, test_name)\
2236 GTEST_TEST_(test_case_name, test_name, \
2237 ::testing::Test, ::testing::internal::GetTestTypeId())
2241 #if !GTEST_DONT_DEFINE_TEST
2242 # define TEST(test_case_name, test_name) GTEST_TEST(test_case_name, test_name)
2271 #define TEST_F(test_fixture, test_name)\
2272 GTEST_TEST_(test_fixture, test_name, test_fixture, \
2273 ::testing::internal::GetTypeId<test_fixture>())
2288 return ::testing::UnitTest::GetInstance()->Run();
2291 #endif // GTEST_INCLUDE_GTEST_GTEST_H_
class UnitTestImpl * GetUnitTestImpl()
Definition: gtest-internal-inl.h:936
internal::SetUpTestCaseFunc SetUpTestCaseFunc
Definition: gtest.h:353
const char * type_param() const
Definition: gtest.h:772
void ReportFailureInUnknownLocation(TestPartResult::Type result_type, const std::string &message)
Definition: gtest.cc:1926
Environment * AddGlobalTestEnvironment(Environment *env)
Definition: gtest.h:1318
virtual void SetUp()
Definition: gtest.h:946
virtual void OnTestProgramStart(const UnitTest &)
Definition: gtest.h:1014
virtual void OnEnvironmentsSetUpEnd(const UnitTest &)
Definition: gtest.h:1018
static AssertionResult Compare(const char *expected_expression, const char *actual_expression, Secret *, T *actual)
Definition: gtest.h:1531
Definition: gtest-death-test.h:43
void(* TearDownTestCaseFunc)()
Definition: gtest-internal.h:472
static void SetUpTestCase()
Definition: gtest.h:365
GTEST_API_ AssertionResult CmpHelperSTREQ(const char *expected_expression, const char *actual_expression, const wchar_t *expected, const wchar_t *actual)
Definition: gtest.cc:1546
GTEST_API_ AssertionResult AssertionFailure()
Definition: gtest.cc:973
virtual void OnEnvironmentsTearDownStart(const UnitTest &unit_test)=0
GTEST_DECLARE_int32_(random_seed)
bool Passed() const
Definition: gtest.h:803
virtual ~TestEventListener()
Definition: gtest.h:961
static AssertionResult Compare(const char *expected_expression, const char *actual_expression, BiggestInt expected, BiggestInt actual)
Definition: gtest.h:1494
::std::string PrintToString(const T &value)
Definition: gtest-printers.h:847
AssertionResult CmpHelperFloatingPointEQ(const char *expected_expression, const char *actual_expression, RawType expected, RawType actual)
Definition: gtest.h:1686
virtual void OnTestCaseEnd(const TestCase &)
Definition: gtest.h:1023
Definition: gtest-internal-inl.h:474
GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char *s1_expression, const char *s2_expression, const char *s1, const char *s2)
Definition: gtest.cc:1210
bool should_run() const
Definition: gtest.h:779
::std::string string
Definition: gtest-port.h:872
const char * key() const
Definition: gtest.h:473
static bool HasFailure()
Definition: gtest.h:383
Definition: gtest-port.h:1621
void(* SetUpTestCaseFunc)()
Definition: gtest-internal.h:471
virtual void OnTestIterationStart(const UnitTest &unit_test, int iteration)=0
::std::wstring wstring
Definition: gtest-port.h:878
virtual void OnEnvironmentsSetUpStart(const UnitTest &unit_test)=0
virtual void OnTestCaseEnd(const TestCase &test_case)=0
GTEST_DECLARE_bool_(also_run_disabled_tests)
TestEventListener * default_xml_generator() const
Definition: gtest.h:1063
GTEST_API_ AssertionResult DoubleNearPredFormat(const char *expr1, const char *expr2, const char *abs_error_expr, double val1, double val2, double abs_error)
Definition: gtest.cc:1039
virtual void OnTestPartResult(const TestPartResult &)
Definition: gtest.h:1021
virtual void OnTestStart(const TestInfo &test_info)=0
internal::TearDownTestCaseFunc TearDownTestCaseFunc
Definition: gtest.h:354
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)
Definition: gtest.h:1513
#define GTEST_API_
Definition: gtest-port.h:768
GTEST_API_ TestInfo * MakeAndRegisterTestInfo(const char *test_case_name, const char *name, const char *type_param, const char *value_param, TypeId fixture_class_id, SetUpTestCaseFunc set_up_tc, TearDownTestCaseFunc tear_down_tc, TestFactoryBase *factory)
Definition: gtest.cc:2216
std::string FormatForComparisonFailureMessage(const T1 &value, const T2 &)
Definition: gtest.h:1431
TypeWithSize< 8 >::Int TimeInMillis
Definition: gtest-port.h:1904
#define GTEST_LOCK_EXCLUDED_(locks)
Definition: gtest-port.h:1928
#define GTEST_IMPL_FORMAT_C_STRING_AS_STRING_(CharType, OtherStringType)
Definition: gtest.h:1393
Definition: gtest-message.h:85
virtual void OnEnvironmentsTearDownEnd(const UnitTest &)
Definition: gtest.h:1025
Definition: gtest-internal.h:434
#define GTEST_DISALLOW_ASSIGN_(type)
Definition: gtest-port.h:721
const char * failure_message() const
Definition: gtest.h:279
Type
Definition: gtest-test-part.h:51
void SetValue(const std::string &new_value)
Definition: gtest.h:483
internal::TimeInMillis TimeInMillis
Definition: gtest.h:457
const void * TypeId
Definition: gtest-internal.h:399
GTEST_API_ AssertionResult CmpHelperEQ(const char *expected_expression, const char *actual_expression, BiggestInt expected, BiggestInt actual)
Definition: gtest.cc:1114
#define GTEST_IMPL_CMP_HELPER_(op_name, op)
Definition: gtest.h:1558
bool is_reportable() const
Definition: gtest.h:668
const char * name() const
Definition: gtest.h:631
virtual void OnTestIterationEnd(const UnitTest &unit_test, int iteration)=0
virtual void OnTestProgramEnd(const UnitTest &unit_test)=0
Definition: gtest-internal.h:875
const char * message() const
Definition: gtest.h:274
GTEST_API_ AssertionResult AssertionSuccess()
Definition: gtest.cc:968
bool Passed() const
Definition: gtest.h:516
const T1 &f1 return GTEST_2_TUPLE_() T(f0, f1)
GTEST_API_ AssertionResult CmpHelperSTRNE(const char *s1_expression, const char *s2_expression, const wchar_t *s1, const wchar_t *s2)
Definition: gtest.cc:1562
#define GTEST_CHECK_(condition)
Definition: gtest-port.h:1060
AssertionResult & operator<<(const T &value)
Definition: gtest.h:282
const int kMaxStackTraceDepth
Definition: gtest.h:147
#define GTEST_IMPL_FORMAT_C_STRING_AS_POINTER_(CharType)
Definition: gtest.h:1374
GTEST_DECLARE_string_(death_test_style)
Definition: gtest-test-part.h:47
const double N
Definition: navstokes_cosines.cc:94
Definition: gtest-port.h:864
virtual void OnTestIterationStart(const UnitTest &, int)
Definition: gtest.h:1015
long long BiggestInt
Definition: gtest-port.h:1649
const char * value_param() const
Definition: gtest.h:643
std::string GetString() const
Definition: gtest.cc:946
GTEST_API_ AssertionResult IsSubstring(const char *needle_expr, const char *haystack_expr, const char *needle, const char *haystack)
Definition: gtest.cc:1283
GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char *expected_expression, const char *actual_expression, const char *expected, const char *actual)
Definition: gtest.cc:1180
const char * test_case_name() const
Definition: gtest.h:628
virtual void OnEnvironmentsTearDownEnd(const UnitTest &unit_test)=0
std::string name_
Definition: gtest.cc:2277
const TestResult & ad_hoc_test_result() const
Definition: gtest.h:817
Definition: gtest-internal.h:232
virtual void OnEnvironmentsTearDownStart(const UnitTest &)
Definition: gtest.h:1024
virtual ~Environment()
Definition: gtest.h:943
Definition: gtest-internal.h:156
AssertionResult & operator<<(::std::ostream &(*basic_manipulator)(::std::ostream &stream))
Definition: gtest.h:289
Definition: gtest-internal-inl.h:466
virtual void OnTestCaseStart(const TestCase &)
Definition: gtest.h:1019
virtual void OnTestProgramEnd(const UnitTest &)
Definition: gtest.h:1028
Definition: gtest-internal-inl.h:508
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)
Definition: gtest.cc:1000
Definition: gtest-internal-inl.h:1049
TestProperty(const std::string &a_key, const std::string &a_value)
Definition: gtest.h:468
virtual void OnTestIterationEnd(const UnitTest &, int)
Definition: gtest.h:1026
virtual void OnTestCaseStart(const TestCase &test_case)=0
virtual void OnTestPartResult(const TestPartResult &test_part_result)=0
bool Failed() const
Definition: gtest.h:806
#define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)
Definition: gtest-port.h:726
virtual void OnEnvironmentsSetUpEnd(const UnitTest &unit_test)=0
GTEST_API_ std::string StringStreamToString(::std::stringstream *stream)
Definition: gtest.cc:1659
int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_
Definition: gtest.h:2287
bool StaticAssertTypeEq()
Definition: gtest.h:2205
virtual void OnEnvironmentsSetUpStart(const UnitTest &)
Definition: gtest.h:1017
virtual void OnTestEnd(const TestInfo &test_info)=0
virtual void OnTestProgramStart(const UnitTest &unit_test)=0
GTEST_API_ AssertionResult DoubleLE(const char *expr1, const char *expr2, double val1, double val2)
Definition: gtest.cc:1105
GTEST_API_ void InitGoogleTest(int *argc, char **argv)
Definition: gtest.cc:5005
const char * name() const
Definition: gtest.h:768
TimeInMillis elapsed_time() const
Definition: gtest.h:809
const TestResult * result() const
Definition: gtest.h:676
GTEST_API_ AssertionResult IsNotSubstring(const char *needle_expr, const char *haystack_expr, const char *needle, const char *haystack)
Definition: gtest.cc:1295
static UnitTest * GetInstance()
Definition: gtest.cc:3641
TestEventListener * default_result_printer() const
Definition: gtest.h:1052
const char * type_param() const
Definition: gtest.h:635
bool should_run() const
Definition: gtest.h:665
virtual void OnTestStart(const TestInfo &)
Definition: gtest.h:1020
const char * value() const
Definition: gtest.h:478
AssertionResult(bool success)
Definition: gtest.h:262
static AssertionResult Compare(const char *expected_expression, const char *actual_expression, const T1 &expected, const T2 &actual)
Definition: gtest.h:1480
virtual void OnTestEnd(const TestInfo &)
Definition: gtest.h:1022
static void TearDownTestCase()
Definition: gtest.h:373
#define GTEST_MUST_USE_RESULT_
Definition: gtest-port.h:738
virtual void TearDown()
Definition: gtest.h:949
GTEST_API_ AssertionResult FloatLE(const char *expr1, const char *expr2, float val1, float val2)
Definition: gtest.cc:1098
TimeInMillis elapsed_time() const
Definition: gtest.h:528