|
25 | 25 | } \
|
26 | 26 | namespace Suite ## Name
|
27 | 27 |
|
28 |
| -#define UNITTEST_IMPL_TEST(Name, List) \ |
| 28 | +#define UNITTEST_IMPL_TEST(Name, List) \ |
29 | 29 | class Test ## Name : public UnitTest::Test \
|
30 | 30 | { \
|
31 | 31 | public: \
|
32 | 32 | Test ## Name() : Test(#Name, UnitTestSuite::GetSuiteName(), __FILE__, __LINE__) {} \
|
33 | 33 | private: \
|
34 | 34 | virtual void RunImpl() const; \
|
35 |
| - } test ## Name ## Instance; \ |
| 35 | + } static test ## Name ## Instance; \ |
36 | 36 | \
|
37 |
| - UnitTest::ListAdder adder ## Name (List, &test ## Name ## Instance); \ |
| 37 | + static UnitTest::ListAdder adder ## Name (List, &test ## Name ## Instance); \ |
38 | 38 | \
|
39 | 39 | void Test ## Name::RunImpl() const
|
40 | 40 |
|
|
49 | 49 | explicit Fixture ## Name ## Helper(UnitTest::TestDetails const& details) : m_details(details) {} \
|
50 | 50 | void RunImpl(); \
|
51 | 51 | UnitTest::TestDetails const& m_details; \
|
| 52 | + virtual ~Fixture ## Name ## Helper(); \ |
52 | 53 | private: \
|
53 | 54 | Fixture ## Name ## Helper(Fixture ## Name ## Helper const&); \
|
54 | 55 | Fixture ## Name ## Helper& operator =(Fixture ## Name ## Helper const&); \
|
55 | 56 | }; \
|
| 57 | + Fixture ## Name ## Helper::~Fixture ## Name ## Helper(){} \ |
56 | 58 | \
|
57 | 59 | class Test ## Fixture ## Name : public UnitTest::Test \
|
58 | 60 | { \
|
59 | 61 | public: \
|
60 | 62 | Test ## Fixture ## Name() : Test(#Name, UnitTestSuite::GetSuiteName(), __FILE__, __LINE__) {} \
|
61 | 63 | private: \
|
62 | 64 | virtual void RunImpl() const; \
|
63 |
| - } test ## Fixture ## Name ## Instance; \ |
| 65 | + } static test ## Fixture ## Name ## Instance; \ |
64 | 66 | \
|
65 |
| - UnitTest::ListAdder adder ## Fixture ## Name (List, &test ## Fixture ## Name ## Instance); \ |
| 67 | + static UnitTest::ListAdder adder ## Fixture ## Name (List, &test ## Fixture ## Name ## Instance); \ |
66 | 68 | \
|
67 | 69 | void Test ## Fixture ## Name::RunImpl() const \
|
68 | 70 | { \
|
|
0 commit comments