51 #ifndef GTEST_INCLUDE_GTEST_GTEST_H_ 52 #define GTEST_INCLUDE_GTEST_GTEST_H_ 151 class DefaultGlobalTestPartResultReporter;
153 class NoExecDeathTest;
154 class FinalSuccessChecker;
155 class GTestFlagSaver;
156 class TestResultAccessor;
157 class TestEventListenersAccessor;
158 class TestEventRepeater;
159 class WindowsDeathTest;
171 template <
typename T>
173 return (
Message() << streamable).GetString();
274 operator bool()
const {
return success_; }
284 return message_.get() != NULL ? message_->c_str() :
"";
292 AppendMessage(
Message() << value);
299 ::std::ostream& (*basic_manipulator)(::std::ostream& stream)) {
300 AppendMessage(
Message() << basic_manipulator);
307 if (message_.get() == NULL)
385 static bool HasFatalFailure();
388 static bool HasNonfatalFailure();
392 static bool HasFailure() {
return HasFatalFailure() || HasNonfatalFailure(); }
406 static void RecordProperty(
const char* key,
const char* value);
407 static void RecordProperty(
const char* key,
int value);
414 virtual void SetUp();
417 virtual void TearDown();
422 static bool HasSameFixtureClass();
430 virtual void TestBody() = 0;
477 key_(a_key), value_(a_value) {
487 return value_.c_str();
518 int total_part_count()
const;
521 int test_property_count()
const;
524 bool Passed()
const {
return !Failed(); }
530 bool HasFatalFailure()
const;
533 bool HasNonfatalFailure()
const;
552 friend class internal::ExecDeathTest;
555 friend class internal::WindowsDeathTest;
559 return test_part_results_;
564 return test_properties_;
580 static bool ValidateTestProperty(
const TestProperty& test_property);
592 void ClearTestPartResults();
640 if (type_param_.get() != NULL)
641 return type_param_->c_str();
648 if (value_param_.get() != NULL)
649 return value_param_->c_str();
676 #if GTEST_HAS_DEATH_TEST 677 friend class internal::DefaultDeathTestFactory;
678 #endif // GTEST_HAS_DEATH_TEST 683 const char* test_case_name,
const char* name,
684 const char* type_param,
685 const char* value_param,
693 TestInfo(
const char* test_case_name,
const char* name,
694 const char* a_type_param,
695 const char* a_value_param,
702 return result_.increment_death_test_count();
754 TestCase(
const char* name,
const char* a_type_param,
767 if (type_param_.get() != NULL)
768 return type_param_->c_str();
776 int successful_test_count()
const;
779 int failed_test_count()
const;
782 int disabled_test_count()
const;
785 int test_to_run_count()
const;
788 int total_test_count()
const;
791 bool Passed()
const {
return !Failed(); }
794 bool Failed()
const {
return failed_test_count() > 0; }
801 const TestInfo* GetTestInfo(
int i)
const;
812 return test_info_list_;
817 TestInfo* GetMutableTestInfo(
int i);
824 void AddTestInfo(
TestInfo * test_info);
869 void UnshuffleTests();
934 virtual void OnTestProgramStart(
const UnitTest& unit_test) = 0;
939 virtual void OnTestIterationStart(
const UnitTest& unit_test,
943 virtual void OnEnvironmentsSetUpStart(
const UnitTest& unit_test) = 0;
946 virtual void OnEnvironmentsSetUpEnd(
const UnitTest& unit_test) = 0;
949 virtual void OnTestCaseStart(
const TestCase& test_case) = 0;
952 virtual void OnTestStart(
const TestInfo& test_info) = 0;
955 virtual void OnTestPartResult(
const TestPartResult& test_part_result) = 0;
958 virtual void OnTestEnd(
const TestInfo& test_info) = 0;
961 virtual void OnTestCaseEnd(
const TestCase& test_case) = 0;
964 virtual void OnEnvironmentsTearDownStart(
const UnitTest& unit_test) = 0;
967 virtual void OnEnvironmentsTearDownEnd(
const UnitTest& unit_test) = 0;
970 virtual void OnTestIterationEnd(
const UnitTest& unit_test,
974 virtual void OnTestProgramEnd(
const UnitTest& unit_test) = 0;
1023 return default_result_printer_;
1034 return default_xml_generator_;
1041 friend class internal::NoExecDeathTest;
1042 friend class internal::TestEventListenersAccessor;
1065 bool EventForwardingEnabled()
const;
1066 void SuppressEventForwarding();
1106 const char* original_working_dir()
const;
1110 const TestCase* current_test_case()
const;
1114 const TestInfo* current_test_info()
const;
1117 int random_seed()
const;
1119 #if GTEST_HAS_PARAM_TEST 1124 internal::ParameterizedTestCaseRegistry& parameterized_test_registry();
1125 #endif // GTEST_HAS_PARAM_TEST 1128 int successful_test_case_count()
const;
1131 int failed_test_case_count()
const;
1134 int total_test_case_count()
const;
1138 int test_case_to_run_count()
const;
1141 int successful_test_count()
const;
1144 int failed_test_count()
const;
1147 int disabled_test_count()
const;
1150 int total_test_count()
const;
1153 int test_to_run_count()
const;
1156 TimeInMillis elapsed_time()
const;
1159 bool Passed()
const;
1163 bool Failed()
const;
1167 const TestCase* GetTestCase(
int i)
const;
1190 const char* file_name,
1197 void RecordPropertyForCurrentTest(
const char* key,
const char* value);
1201 TestCase* GetMutableTestCase(
int i);
1229 void PopGTestTrace();
1282 namespace internal {
1296 template <
typename T1,
typename T2>
1305 template <
typename T1,
typename T2>
1307 const char* actual_expression,
1311 # pragma warning(push) // Saves the current warning state. 1312 # pragma warning(disable:4389) // Temporarily disables warning on 1316 if (expected == actual) {
1321 # pragma warning(pop) // Restores the warning state. 1335 const char* actual_expression,
1343 template <
bool lhs_is_null_literal>
1347 template <
typename T1,
typename T2>
1349 const char* actual_expression,
1352 return CmpHelperEQ(expected_expression, actual_expression, expected,
1363 const char* actual_expression,
1366 return CmpHelperEQ(expected_expression, actual_expression, expected,
1380 template <
typename T1,
typename T2>
1382 const char* expected_expression,
1383 const char* actual_expression,
1392 return CmpHelperEQ(expected_expression, actual_expression, expected,
1398 template <
typename T>
1400 const char* expected_expression,
1401 const char* actual_expression,
1411 return CmpHelperEQ(expected_expression, actual_expression,
1412 static_cast<T*>(NULL), actual);
1426 #define GTEST_IMPL_CMP_HELPER_(op_name, op)\ 1427 template <typename T1, typename T2>\ 1428 AssertionResult CmpHelper##op_name(const char* expr1, const char* expr2, \ 1429 const T1& val1, const T2& val2) {\ 1430 if (val1 op val2) {\ 1431 return AssertionSuccess();\ 1433 return AssertionFailure() \ 1434 << "Expected: (" << expr1 << ") " #op " (" << expr2\ 1435 << "), actual: " << FormatForComparisonFailureMessage(val1, val2)\ 1436 << " vs " << FormatForComparisonFailureMessage(val2, val1);\ 1439 GTEST_API_ AssertionResult CmpHelper##op_name(\ 1440 const char* expr1, const char* expr2, BiggestInt val1, BiggestInt val2) 1455 #undef GTEST_IMPL_CMP_HELPER_ 1461 const char* actual_expression,
1462 const char* expected,
1463 const char* actual);
1469 const char* actual_expression,
1470 const char* expected,
1471 const char* actual);
1477 const char* s2_expression,
1485 const char* s2_expression,
1494 const char* actual_expression,
1495 const wchar_t* expected,
1496 const wchar_t* actual);
1502 const char* s2_expression,
1517 const char* needle_expr,
const char* haystack_expr,
1518 const char* needle,
const char* haystack);
1520 const char* needle_expr,
const char* haystack_expr,
1521 const wchar_t* needle,
const wchar_t* haystack);
1523 const char* needle_expr,
const char* haystack_expr,
1524 const char* needle,
const char* haystack);
1526 const char* needle_expr,
const char* haystack_expr,
1527 const wchar_t* needle,
const wchar_t* haystack);
1529 const char* needle_expr,
const char* haystack_expr,
1532 const char* needle_expr,
const char* haystack_expr,
1535 #if GTEST_HAS_STD_WSTRING 1537 const char* needle_expr,
const char* haystack_expr,
1540 const char* needle_expr,
const char* haystack_expr,
1542 #endif // GTEST_HAS_STD_WSTRING 1544 namespace internal {
1553 template <
typename RawType>
1555 const char* actual_expression,
1560 if (lhs.AlmostEquals(rhs)) {
1564 ::std::stringstream expected_ss;
1565 expected_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
1568 ::std::stringstream actual_ss;
1569 actual_ss << std::setprecision(std::numeric_limits<RawType>::digits10 + 2)
1584 const char* abs_error_expr,
1602 void operator=(
const Message& message)
const;
1611 const char* srcfile,
1614 : type(t), file(srcfile), line(line_num), message(msg) { }
1632 #if GTEST_HAS_PARAM_TEST 1667 template <
typename T>
1668 class WithParamInterface {
1670 typedef T ParamType;
1671 virtual ~WithParamInterface() {}
1678 const ParamType& GetParam()
const {
return *parameter_; }
1683 static void SetParam(
const ParamType* parameter) {
1684 parameter_ = parameter;
1688 static const ParamType* parameter_;
1691 template <
class TestClass>
friend class internal::ParameterizedTestFactory;
1694 template <
typename T>
1695 const T* WithParamInterface<T>::parameter_ = NULL;
1700 template <
typename T>
1701 class TestWithParam :
public Test,
public WithParamInterface<T> {
1704 #endif // GTEST_HAS_PARAM_TEST 1732 #define ADD_FAILURE() GTEST_NONFATAL_FAILURE_("Failed") 1736 #define ADD_FAILURE_AT(file, line) \ 1737 GTEST_MESSAGE_AT_(file, line, "Failed", \ 1738 ::testing::TestPartResult::kNonFatalFailure) 1741 #define GTEST_FAIL() GTEST_FATAL_FAILURE_("Failed") 1745 #if !GTEST_DONT_DEFINE_FAIL 1746 # define FAIL() GTEST_FAIL() 1750 #define GTEST_SUCCEED() GTEST_SUCCESS_("Succeeded") 1754 #if !GTEST_DONT_DEFINE_SUCCEED 1755 # define SUCCEED() GTEST_SUCCEED() 1767 #define EXPECT_THROW(statement, expected_exception) \ 1768 GTEST_TEST_THROW_(statement, expected_exception, GTEST_NONFATAL_FAILURE_) 1769 #define EXPECT_NO_THROW(statement) \ 1770 GTEST_TEST_NO_THROW_(statement, GTEST_NONFATAL_FAILURE_) 1771 #define EXPECT_ANY_THROW(statement) \ 1772 GTEST_TEST_ANY_THROW_(statement, GTEST_NONFATAL_FAILURE_) 1773 #define ASSERT_THROW(statement, expected_exception) \ 1774 GTEST_TEST_THROW_(statement, expected_exception, GTEST_FATAL_FAILURE_) 1775 #define ASSERT_NO_THROW(statement) \ 1776 GTEST_TEST_NO_THROW_(statement, GTEST_FATAL_FAILURE_) 1777 #define ASSERT_ANY_THROW(statement) \ 1778 GTEST_TEST_ANY_THROW_(statement, GTEST_FATAL_FAILURE_) 1783 #define EXPECT_TRUE(condition) \ 1784 GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \ 1785 GTEST_NONFATAL_FAILURE_) 1786 #define EXPECT_FALSE(condition) \ 1787 GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \ 1788 GTEST_NONFATAL_FAILURE_) 1789 #define ASSERT_TRUE(condition) \ 1790 GTEST_TEST_BOOLEAN_(condition, #condition, false, true, \ 1791 GTEST_FATAL_FAILURE_) 1792 #define ASSERT_FALSE(condition) \ 1793 GTEST_TEST_BOOLEAN_(!(condition), #condition, true, false, \ 1794 GTEST_FATAL_FAILURE_) 1846 #define EXPECT_EQ(expected, actual) \ 1847 EXPECT_PRED_FORMAT2(::testing::internal:: \ 1848 EqHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, \ 1850 #define EXPECT_NE(expected, actual) \ 1851 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperNE, expected, actual) 1852 #define EXPECT_LE(val1, val2) \ 1853 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2) 1854 #define EXPECT_LT(val1, val2) \ 1855 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2) 1856 #define EXPECT_GE(val1, val2) \ 1857 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2) 1858 #define EXPECT_GT(val1, val2) \ 1859 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2) 1861 #define GTEST_ASSERT_EQ(expected, actual) \ 1862 ASSERT_PRED_FORMAT2(::testing::internal:: \ 1863 EqHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, \ 1865 #define GTEST_ASSERT_NE(val1, val2) \ 1866 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperNE, val1, val2) 1867 #define GTEST_ASSERT_LE(val1, val2) \ 1868 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLE, val1, val2) 1869 #define GTEST_ASSERT_LT(val1, val2) \ 1870 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperLT, val1, val2) 1871 #define GTEST_ASSERT_GE(val1, val2) \ 1872 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGE, val1, val2) 1873 #define GTEST_ASSERT_GT(val1, val2) \ 1874 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperGT, val1, val2) 1879 #if !GTEST_DONT_DEFINE_ASSERT_EQ 1880 # define ASSERT_EQ(val1, val2) GTEST_ASSERT_EQ(val1, val2) 1883 #if !GTEST_DONT_DEFINE_ASSERT_NE 1884 # define ASSERT_NE(val1, val2) GTEST_ASSERT_NE(val1, val2) 1887 #if !GTEST_DONT_DEFINE_ASSERT_LE 1888 # define ASSERT_LE(val1, val2) GTEST_ASSERT_LE(val1, val2) 1891 #if !GTEST_DONT_DEFINE_ASSERT_LT 1892 # define ASSERT_LT(val1, val2) GTEST_ASSERT_LT(val1, val2) 1895 #if !GTEST_DONT_DEFINE_ASSERT_GE 1896 # define ASSERT_GE(val1, val2) GTEST_ASSERT_GE(val1, val2) 1899 #if !GTEST_DONT_DEFINE_ASSERT_GT 1900 # define ASSERT_GT(val1, val2) GTEST_ASSERT_GT(val1, val2) 1919 #define EXPECT_STREQ(expected, actual) \ 1920 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, expected, actual) 1921 #define EXPECT_STRNE(s1, s2) \ 1922 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2) 1923 #define EXPECT_STRCASEEQ(expected, actual) \ 1924 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, expected, actual) 1925 #define EXPECT_STRCASENE(s1, s2)\ 1926 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2) 1928 #define ASSERT_STREQ(expected, actual) \ 1929 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTREQ, expected, actual) 1930 #define ASSERT_STRNE(s1, s2) \ 1931 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRNE, s1, s2) 1932 #define ASSERT_STRCASEEQ(expected, actual) \ 1933 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASEEQ, expected, actual) 1934 #define ASSERT_STRCASENE(s1, s2)\ 1935 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperSTRCASENE, s1, s2) 1951 #define EXPECT_FLOAT_EQ(expected, actual)\ 1952 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \ 1955 #define EXPECT_DOUBLE_EQ(expected, actual)\ 1956 EXPECT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \ 1959 #define ASSERT_FLOAT_EQ(expected, actual)\ 1960 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<float>, \ 1963 #define ASSERT_DOUBLE_EQ(expected, actual)\ 1964 ASSERT_PRED_FORMAT2(::testing::internal::CmpHelperFloatingPointEQ<double>, \ 1967 #define EXPECT_NEAR(val1, val2, abs_error)\ 1968 EXPECT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \ 1969 val1, val2, abs_error) 1971 #define ASSERT_NEAR(val1, val2, abs_error)\ 1972 ASSERT_PRED_FORMAT3(::testing::internal::DoubleNearPredFormat, \ 1973 val1, val2, abs_error) 1983 float val1,
float val2);
1985 double val1,
double val2);
1988 #if GTEST_OS_WINDOWS 1999 # define EXPECT_HRESULT_SUCCEEDED(expr) \ 2000 EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) 2002 # define ASSERT_HRESULT_SUCCEEDED(expr) \ 2003 ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTSuccess, (expr)) 2005 # define EXPECT_HRESULT_FAILED(expr) \ 2006 EXPECT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr)) 2008 # define ASSERT_HRESULT_FAILED(expr) \ 2009 ASSERT_PRED_FORMAT1(::testing::internal::IsHRESULTFailure, (expr)) 2011 #endif // GTEST_OS_WINDOWS 2023 #define ASSERT_NO_FATAL_FAILURE(statement) \ 2024 GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_FATAL_FAILURE_) 2025 #define EXPECT_NO_FATAL_FAILURE(statement) \ 2026 GTEST_TEST_NO_FATAL_FAILURE_(statement, GTEST_NONFATAL_FAILURE_) 2039 #define SCOPED_TRACE(message) \ 2040 ::testing::internal::ScopedTrace GTEST_CONCAT_TOKEN_(gtest_trace_, __LINE__)(\ 2041 __FILE__, __LINE__, ::testing::Message() << (message)) 2073 template <
typename T1,
typename T2>
2104 #define GTEST_TEST(test_case_name, test_name)\ 2105 GTEST_TEST_(test_case_name, test_name, \ 2106 ::testing::Test, ::testing::internal::GetTestTypeId()) 2110 #if !GTEST_DONT_DEFINE_TEST 2111 # define TEST(test_case_name, test_name) GTEST_TEST(test_case_name, test_name) 2140 #define TEST_F(test_fixture, test_name)\ 2141 GTEST_TEST_(test_fixture, test_name, test_fixture, \ 2142 ::testing::internal::GetTypeId<test_fixture>()) 2150 #define RUN_ALL_TESTS()\ 2151 (::testing::UnitTest::GetInstance()->Run()) 2155 #endif // GTEST_INCLUDE_GTEST_GTEST_H_ bool Failed() const
Definition: gtest.h:794
void set_should_run(bool should)
Definition: gtest.h:820
const internal::scoped_ptr< const ::std::string > type_param_
Definition: gtest.h:875
const char *const file
Definition: gtest.h:1617
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:1381
class UnitTestImpl * GetUnitTestImpl()
Definition: gtest-internal-inl.h:905
static bool TestDisabled(const TestInfo *test_info)
Definition: gtest.h:856
virtual void OnEnvironmentsSetUpEnd(const UnitTest &)
Definition: gtest.h:988
Definition: gtest-internal-inl.h:497
String FormatForComparisonFailureMessage(const T1 &value, const T2 &)
Definition: gtest.h:1297
static UnitTest * GetInstance()
Definition: gtest.cc:3633
Environment * AddGlobalTestEnvironment(Environment *env)
Definition: gtest.h:1263
internal::SetUpTestCaseFunc SetUpTestCaseFunc
Definition: gtest.h:362
internal::String key_
Definition: gtest.h:497
Definition: gmock-actions.h:49
internal::Mutex test_properites_mutex_
Definition: gtest.h:599
std::vector< TestPartResult > test_part_results_
Definition: gtest.h:602
GTEST_API_ AssertionResult AssertionFailure()
Definition: gtest.cc:971
internal::String value_
Definition: gtest.h:499
int death_test_count() const
Definition: gtest.h:586
virtual void OnTestIterationStart(const UnitTest &, int)
Definition: gtest.h:985
GTEST_DECLARE_int32_(random_seed)
int const line
Definition: gtest.h:1618
AssertHelperData *const data_
Definition: gtest.h:1625
virtual Setup_should_be_spelled_SetUp * Setup()
Definition: gtest.h:924
::std::string PrintToString(const T &value)
Definition: gtest-printers.h:788
AssertionResult(bool success)
Definition: gtest.h:271
AssertionResult CmpHelperFloatingPointEQ(const char *expected_expression, const char *actual_expression, RawType expected, RawType actual)
Definition: gtest.h:1554
const char * name() const
Definition: gtest.h:635
virtual void OnTestPartResult(const TestPartResult &)
Definition: gtest.h:991
const internal::scoped_ptr< const ::std::string > type_param_
Definition: gtest.h:718
virtual void OnEnvironmentsTearDownStart(const UnitTest &)
Definition: gtest.h:994
GTEST_API_ AssertionResult CmpHelperSTRCASENE(const char *s1_expression, const char *s2_expression, const char *s1, const char *s2)
Definition: gtest.cc:1207
void RunTearDownTestCase()
Definition: gtest.h:843
::std::string string
Definition: gtest-port.h:756
Definition: gtest-internal.h:317
bool matches_filter_
Definition: gtest.h:725
internal::scoped_ptr< ::std::string > message_
Definition: gtest.h:318
virtual void OnTestCaseStart(const TestCase &)
Definition: gtest.h:989
GTEST_API_ String StringStreamToString(::std::stringstream *stream)
Definition: gtest.cc:1735
Definition: gtest-port.h:1473
TestEventListener * default_xml_generator() const
Definition: gtest.h:1033
AssertHelperData(TestPartResult::Type t, const char *srcfile, int line_num, const char *msg)
Definition: gtest.h:1610
const TestResult * result() const
Definition: gtest.h:672
::std::wstring wstring
Definition: gtest-port.h:762
Definition: gtest-internal-inl.h:1018
GTEST_DECLARE_bool_(also_run_disabled_tests)
TestProperty(const char *a_key, const char *a_value)
Definition: gtest.h:476
internal::UnitTestImpl * impl()
Definition: gtest.h:1204
static bool TestPassed(const TestInfo *test_info)
Definition: gtest.h:846
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:1036
Definition: gtest-internal-inl.h:463
#define GTEST_API_
Definition: gtest-port.h:662
void ReportFailureInUnknownLocation(TestPartResult::Type result_type, const String &message)
Definition: gtest.cc:1932
virtual void TearDown()
Definition: gtest.h:919
const char * type_param() const
Definition: gtest.h:766
static void ClearTestCaseResult(TestCase *test_case)
Definition: gtest.h:830
TimeInMillis elapsed_time_
Definition: gtest.h:890
Definition: gtest-test-part.h:47
Output level, used for messages directed to the user (e.g. "Press any key to continue") ...
Definition: OutputDefinitions.h:89
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:2229
std::vector< TestInfo * > & test_info_list()
Definition: gtest.h:808
virtual ~TestEventListener()
Definition: gtest.h:931
virtual void OnTestProgramStart(const UnitTest &)
Definition: gtest.h:984
void Clear()
Definition: gtest.cc:1845
TypeWithSize< 8 >::Int TimeInMillis
Definition: gtest-port.h:1736
Definition: gtest-internal-inl.h:150
bool success_
Definition: gtest.h:313
void SetValue(const char *new_value)
Definition: gtest.h:491
const char * c_str() const
Definition: gtest-string.h:275
AssertionResult & operator<<(::std::ostream &(*basic_manipulator)(::std::ostream &stream))
Definition: gtest.h:298
const char * value_param() const
Definition: gtest.h:647
const char * failure_message() const
Definition: gtest.h:288
bool should_run_
Definition: gtest.h:888
bool should_run() const
Definition: gtest.h:669
#define GTEST_DISALLOW_ASSIGN_(type)
Definition: gtest-port.h:615
internal::Mutex mutex_
Definition: gtest.h:1233
virtual ~Environment()
Definition: gtest.h:913
AssertionResult & operator<<(const T &value)
Definition: gtest.h:291
Test::TearDownTestCaseFunc tear_down_tc_
Definition: gtest.h:886
typedef void(ENET_CALLBACK *ENetPacketFreeCallback)(struct _ENetPacket *)
internal::String name_
Definition: gtest.h:872
bool should_run() const
Definition: gtest.h:773
internal::TestEventRepeater * repeater_
Definition: gtest.h:1069
internal::String GetString() const
Definition: gtest-message.h:190
const void * TypeId
Definition: gtest-internal.h:474
std::vector< int > test_indices_
Definition: gtest.h:882
virtual void OnTestStart(const TestInfo &)
Definition: gtest.h:990
const std::vector< TestInfo * > & test_info_list() const
Definition: gtest.h:811
TestResult result_
Definition: gtest.h:732
GTEST_IMPL_CMP_HELPER_(NE,!=)
std::vector< TestInfo * > test_info_list_
Definition: gtest.h:878
internal::TestFactoryBase *const factory_
Definition: gtest.h:727
void AppendMessage(const Message &a_message)
Definition: gtest.h:306
static void TearDownTestCase()
Definition: gtest.h:382
GTEST_API_ AssertionResult AssertionSuccess()
Definition: gtest.cc:966
virtual void OnEnvironmentsTearDownEnd(const UnitTest &)
Definition: gtest.h:995
static AssertionResult Compare(const char *expected_expression, const char *actual_expression, Secret *, T *actual)
Definition: gtest.h:1399
Definition: gtest-port.h:748
const int kMaxStackTraceDepth
Definition: gtest.h:146
int increment_death_test_count()
Definition: gtest.h:589
static bool ShouldRunTest(const TestInfo *test_info)
Definition: gtest.h:861
const std::vector< TestProperty > & test_properties() const
Definition: gtest.h:563
GTEST_DECLARE_string_(death_test_style)
void ClearResult()
Definition: gtest.cc:2458
Environment * AddEnvironment(Environment *env)
Definition: gtest.cc:3734
static bool HasFailure()
Definition: gtest.h:392
virtual void OnTestIterationEnd(const UnitTest &, int)
Definition: gtest.h:996
const char * type_param() const
Definition: gtest.h:639
void(* SetUpTestCaseFunc)()
Definition: gtest-internal.h:546
Definition: gtest-string.h:81
std::vector< TestProperty > test_properties_
Definition: gtest.h:604
virtual void SetUp()
Definition: gtest.h:916
TimeInMillis elapsed_time_
Definition: gtest.h:608
void(* TearDownTestCaseFunc)()
Definition: gtest-internal.h:547
const char * value() const
Definition: gtest.h:486
Definition: gtest-internal.h:170
bool is_disabled_
Definition: gtest.h:724
const char * key() const
Definition: gtest.h:481
long long BiggestInt
Definition: gtest-port.h:1501
virtual Setup_should_be_spelled_SetUp * Setup()
Definition: gtest.h:459
GTEST_API_ AssertionResult IsSubstring(const char *needle_expr, const char *haystack_expr, const char *needle, const char *haystack)
Definition: gtest.cc:1280
TestEventListener * default_result_printer_
Definition: gtest.h:1071
void DeleteSelf_()
Definition: gtest.h:437
String const message
Definition: gtest.h:1619
GTEST_API_ AssertionResult CmpHelperSTRCASEEQ(const char *expected_expression, const char *actual_expression, const char *expected, const char *actual)
Definition: gtest.cc:1177
Definition: InputPrereqs.h:78
const char * name() const
Definition: gtest.h:762
Definition: gtest.cc:2897
const std::string name_
Definition: gtest.h:715
const internal::TypeId fixture_class_id_
Definition: gtest.h:722
static bool TestFailed(const TestInfo *test_info)
Definition: gtest.h:851
const std::string test_case_name_
Definition: gtest.h:714
GTEST_API_ AssertionResult CmpHelperSTRNE(const char *s1_expression, const char *s2_expression, const char *s1, const char *s2)
Definition: gtest.cc:1193
virtual void OnTestCaseEnd(const TestCase &)
Definition: gtest.h:993
const internal::UnitTestImpl * impl() const
Definition: gtest.h:1205
internal::TearDownTestCaseFunc TearDownTestCaseFunc
Definition: gtest.h:363
int increment_death_test_count()
Definition: gtest.h:701
static void SetUpTestCase()
Definition: gtest.h:374
static AssertionResult Compare(const char *expected_expression, const char *actual_expression, const T1 &expected, const T2 &actual)
Definition: gtest.h:1348
TimeInMillis elapsed_time() const
Definition: gtest.h:797
static AssertionResult Compare(const char *expected_expression, const char *actual_expression, BiggestInt expected, BiggestInt actual)
Definition: gtest.h:1362
GTEST_API_ AssertionResult EqFailure(const char *expected_expression, const char *actual_expression, const String &expected_value, const String &actual_value, bool ignoring_case)
Definition: gtest.cc:998
Definition: gtest-internal.h:943
AssertionResult CmpHelperEQ(const char *expected_expression, const char *actual_expression, const T1 &expected, const T2 &actual)
Definition: gtest.h:1306
bool Passed() const
Definition: gtest.h:524
TestPartResult::Type const type
Definition: gtest.h:1616
static void ClearTestResult(TestInfo *test_info)
Definition: gtest.h:709
TestEventListener * default_xml_generator_
Definition: gtest.h:1073
#define GTEST_DISALLOW_COPY_AND_ASSIGN_(type)
Definition: gtest-port.h:620
bool StaticAssertTypeEq()
Definition: gtest.h:2074
GTEST_API_ AssertionResult DoubleLE(const char *expr1, const char *expr2, double val1, double val2)
Definition: gtest.cc:1102
virtual void OnTestProgramEnd(const UnitTest &)
Definition: gtest.h:998
GTEST_API_ void InitGoogleTest(int *argc, char **argv)
Definition: gtest.cc:4888
const internal::GTestFlagSaver *const gtest_flag_saver_
Definition: gtest.h:440
const char * message() const
Definition: gtest.h:283
GTEST_API_ AssertionResult IsNotSubstring(const char *needle_expr, const char *haystack_expr, const char *needle, const char *haystack)
Definition: gtest.cc:1292
Test::SetUpTestCaseFunc set_up_tc_
Definition: gtest.h:884
virtual void OnTestEnd(const TestInfo &)
Definition: gtest.h:992
bool Failed() const
Definition: gtest.cc:1853
GTEST_API_ AssertionResult CmpHelperSTREQ(const char *expected_expression, const char *actual_expression, const char *expected, const char *actual)
Definition: gtest.cc:1161
Definition: gtest-port.h:1399
Definition: gtest-internal.h:509
int death_test_count_
Definition: gtest.h:606
internal::String name_
Definition: gtest.cc:2289
TestEventListener * default_result_printer() const
Definition: gtest.h:1022
void RunSetUpTestCase()
Definition: gtest.h:839
bool Passed() const
Definition: gtest.h:791
bool should_run_
Definition: gtest.h:723
const std::vector< TestPartResult > & test_part_results() const
Definition: gtest.h:558
void set_elapsed_time(TimeInMillis elapsed)
Definition: gtest.h:568
Definition: gtest-message.h:82
Definition: gtest-internal.h:750
Type
Definition: gtest-test-part.h:51
const internal::scoped_ptr< const ::std::string > value_param_
Definition: gtest.h:721
#define GTEST_MUST_USE_RESULT_
Definition: gtest-port.h:632
const char * test_case_name() const
Definition: gtest.h:632
String StreamableToString(const T &streamable)
Definition: gtest.h:172
virtual void OnEnvironmentsSetUpStart(const UnitTest &)
Definition: gtest.h:987
internal::UnitTestImpl * impl_
Definition: gtest.h:1239
Definition: gtest-internal-inl.h:455
GTEST_API_ AssertionResult FloatLE(const char *expr1, const char *expr2, float val1, float val2)
Definition: gtest.cc:1095
TimeInMillis elapsed_time() const
Definition: gtest.h:536