diff options
author | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2015-06-20 00:22:50 -0400 |
---|---|---|
committer | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2015-06-20 10:56:02 -0400 |
commit | 9c2ed42daa8fbbef4a919c21ec564e2db55e8d60 (patch) | |
tree | 3814f79c10d7b490948d8cb7b112ac1dd41ceff1 /src/mongo/unittest/death_test.h | |
parent | 01965cf52bce6976637ecb8f4a622aeb05ab256a (diff) | |
download | mongo-9c2ed42daa8fbbef4a919c21ec564e2db55e8d60.tar.gz |
SERVER-18579: Clang-Format - reformat code, no comment reflow
Diffstat (limited to 'src/mongo/unittest/death_test.h')
-rw-r--r-- | src/mongo/unittest/death_test.h | 62 |
1 files changed, 34 insertions, 28 deletions
diff --git a/src/mongo/unittest/death_test.h b/src/mongo/unittest/death_test.h index 5aff0c39cd4..587d96aca7a 100644 --- a/src/mongo/unittest/death_test.h +++ b/src/mongo/unittest/death_test.h @@ -45,18 +45,20 @@ * in your death test, start them in the test body, or use DEATH_TEST_F and start them * in the setUp() method of the fixture. */ -#define DEATH_TEST(CASE_NAME, TEST_NAME, MATCH_EXPR) \ - class _TEST_TYPE_NAME(CASE_NAME, TEST_NAME) : public ::mongo::unittest::Test { \ - private: \ - virtual void _doTest(); \ - \ - static const RegistrationAgent<::mongo::unittest::DeathTest< \ - _TEST_TYPE_NAME(CASE_NAME, TEST_NAME)>> _agent; \ - }; \ - const ::mongo::unittest::Test::RegistrationAgent< \ - ::mongo::unittest::DeathTest<_TEST_TYPE_NAME(CASE_NAME, TEST_NAME)>> \ - _TEST_TYPE_NAME(CASE_NAME, TEST_NAME)::_agent(#CASE_NAME, #TEST_NAME); \ - std::string getDeathTestPattern(_TEST_TYPE_NAME(CASE_NAME, TEST_NAME)*) { return MATCH_EXPR; } \ +#define DEATH_TEST(CASE_NAME, TEST_NAME, MATCH_EXPR) \ + class _TEST_TYPE_NAME(CASE_NAME, TEST_NAME) : public ::mongo::unittest::Test { \ + private: \ + virtual void _doTest(); \ + \ + static const RegistrationAgent< \ + ::mongo::unittest::DeathTest<_TEST_TYPE_NAME(CASE_NAME, TEST_NAME)>> _agent; \ + }; \ + const ::mongo::unittest::Test::RegistrationAgent<::mongo::unittest::DeathTest<_TEST_TYPE_NAME( \ + CASE_NAME, TEST_NAME)>> _TEST_TYPE_NAME(CASE_NAME, TEST_NAME)::_agent(#CASE_NAME, \ + #TEST_NAME); \ + std::string getDeathTestPattern(_TEST_TYPE_NAME(CASE_NAME, TEST_NAME)*) { \ + return MATCH_EXPR; \ + } \ void _TEST_TYPE_NAME(CASE_NAME, TEST_NAME)::_doTest() /** @@ -65,27 +67,28 @@ * * See description of DEATH_TEST for more details on death tests. */ -#define DEATH_TEST_F(FIXTURE_NAME, TEST_NAME, MATCH_EXPR) \ - class _TEST_TYPE_NAME(FIXTURE_NAME, TEST_NAME) : public FIXTURE_NAME { \ - private: \ - virtual void _doTest(); \ - \ - static const RegistrationAgent<::mongo::unittest::DeathTest< \ - _TEST_TYPE_NAME(FIXTURE_NAME, TEST_NAME)>> _agent; \ - }; \ - const ::mongo::unittest::Test::RegistrationAgent< \ - ::mongo::unittest::DeathTest<_TEST_TYPE_NAME(FIXTURE_NAME, TEST_NAME)>> \ - _TEST_TYPE_NAME(FIXTURE_NAME, TEST_NAME)::_agent(#FIXTURE_NAME, #TEST_NAME); \ - std::string getDeathTestPattern(_TEST_TYPE_NAME(FIXTURE_NAME, TEST_NAME)*) { \ - return MATCH_EXPR; \ - } \ - void _TEST_TYPE_NAME(FIXTURE_NAME, TEST_NAME)::_doTest() +#define DEATH_TEST_F(FIXTURE_NAME, TEST_NAME, MATCH_EXPR) \ + class _TEST_TYPE_NAME(FIXTURE_NAME, TEST_NAME) : public FIXTURE_NAME { \ + private: \ + virtual void _doTest(); \ + \ + static const RegistrationAgent< \ + ::mongo::unittest::DeathTest<_TEST_TYPE_NAME(FIXTURE_NAME, TEST_NAME)>> _agent; \ + }; \ + const ::mongo::unittest::Test::RegistrationAgent<::mongo::unittest::DeathTest<_TEST_TYPE_NAME( \ + FIXTURE_NAME, TEST_NAME)>> _TEST_TYPE_NAME(FIXTURE_NAME, TEST_NAME)::_agent(#FIXTURE_NAME, \ + #TEST_NAME); \ + std::string getDeathTestPattern(_TEST_TYPE_NAME(FIXTURE_NAME, TEST_NAME)*) { \ + return MATCH_EXPR; \ + } \ + void _TEST_TYPE_NAME(FIXTURE_NAME, TEST_NAME)::_doTest() namespace mongo { namespace unittest { class DeathTestImpl : public Test { MONGO_DISALLOW_COPYING(DeathTestImpl); + protected: DeathTestImpl(std::unique_ptr<Test> test); @@ -101,8 +104,11 @@ public: static const std::string pattern; DeathTest() : DeathTestImpl(stdx::make_unique<T>()) {} + private: - std::string getPattern() override { return getDeathTestPattern(static_cast<T*>(nullptr)); } + std::string getPattern() override { + return getDeathTestPattern(static_cast<T*>(nullptr)); + } }; } // namespace unittest |