-
Notifications
You must be signed in to change notification settings - Fork 176
Expand file tree
/
Copy pathTestLongMacros.cpp
More file actions
45 lines (39 loc) · 1011 Bytes
/
TestLongMacros.cpp
File metadata and controls
45 lines (39 loc) · 1011 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#define UNITTEST_DISABLE_SHORT_MACROS
#include "UnitTest++/UnitTestPP.h"
// This file is not intended to test every little thing, just a few basics to hopefully ensure
// the macros are working and the short macros are not defined.
UNITTEST_SUITE(LongMacros)
{
UNITTEST_TEST(LongCheckMacroWorks)
{
UNITTEST_CHECK(true);
}
class Fixture
{
public:
Fixture() : sanity_(true) {}
protected:
bool sanity_;
};
UNITTEST_TEST_FIXTURE(Fixture, LongFixtureMacroWorks)
{
UNITTEST_REQUIRE UNITTEST_CHECK(sanity_);
}
UNITTEST_TEST(ShortMacrosAreNotDefined)
{
#if defined(CHECK) || \
defined(CHECK_EQUAL) || \
defined(CHECK_CLOSE) || \
defined(CHECK_ARRAY_EQUAL) || \
defined(CHECK_ARRAY_CLOSE) || \
defined(CHECK_ARRAY2D_CLOSE) || \
defined(CHECK_THROW) || \
defined(CHECK_ASSERT) || \
defined(SUITE) || \
defined(TEST) || \
defined(TEST_FIXTURE) || \
defined(REQUIRE)
UNITTEST_CHECK(false);
#endif
}
}