54 #define GTEST_CHECK_INT_EQ_(expected, actual) \
56 const int expected_val = (expected);\
57 const int actual_val = (actual);\
58 if (::testing::internal::IsTrue(expected_val != actual_val)) {\
59 ::std::cout << "Value of: " #actual "\n"\
60 << " Actual: " << actual_val << "\n"\
61 << "Expected: " #expected "\n"\
62 << "Which is: " << expected_val << "\n";\
63 ::testing::internal::posix::Abort();\
65 } while (::testing::internal::AlwaysFalse())
71 int g_environment_set_up_count = 0;
72 int g_environment_tear_down_count = 0;
77 void SetUp()
override { g_environment_set_up_count++; }
78 void TearDown()
override { g_environment_tear_down_count++; }
83 int g_should_fail_count = 0;
85 TEST(FooTest, ShouldFail) {
86 g_should_fail_count++;
92 int g_should_pass_count = 0;
94 TEST(FooTest, ShouldPass) {
95 g_should_pass_count++;
101 int g_death_test_count = 0;
103 TEST(BarDeathTest, ThreadSafeAndFast) {
104 g_death_test_count++;
113 int g_param_test_count = 0;
115 const int kNumberOfParamTests = 10;
119 TEST_P(MyParamTest, ShouldPass) {
121 g_param_test_count++;
129 g_environment_set_up_count = 0;
130 g_environment_tear_down_count = 0;
131 g_should_fail_count = 0;
132 g_should_pass_count = 0;
133 g_death_test_count = 0;
134 g_param_test_count = 0;
148 void TestRepeatUnspecified() {
155 void TestRepeat(
int repeat) {
165 void TestRepeatWithEmptyFilter(
int repeat) {
176 void TestRepeatWithFilterForSuccessfulTests(
int repeat) {
192 void TestRepeatWithFilterForFailedTests(
int repeat) {
208 int main(
int argc,
char **argv) {
213 TestRepeatUnspecified();
218 TestRepeatWithEmptyFilter(2);
219 TestRepeatWithEmptyFilter(3);
221 TestRepeatWithFilterForSuccessfulTests(3);
223 TestRepeatWithFilterForFailedTests(4);
#define EXPECT_DEATH_IF_SUPPORTED(statement, regex)
Environment * AddGlobalTestEnvironment(Environment *env)
#define GTEST_CHECK_INT_EQ_(expected, actual)
#define TEST(test_suite_name, test_name)
internal::ParamGenerator< T > Range(T start, T end, IncrementT step)
GTEST_DECLARE_string_(death_test_style)
#define EXPECT_EQ(val1, val2)
#define TEST_P(test_suite_name, test_name)
int RUN_ALL_TESTS() GTEST_MUST_USE_RESULT_
GTEST_API_ void InitGoogleTest(int *argc, char **argv)
#define INSTANTIATE_TEST_SUITE_P(prefix, test_suite_name,...)
GTEST_DECLARE_int32_(repeat)
static ExpectedAnswer expected[4]