Skip to content

Commit 74ca0c3

Browse files
committed
Merge and uncrustify.
1 parent 89ff259 commit 74ca0c3

8 files changed

+885
-907
lines changed

UnitTest++/CheckMacros.h

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@
4141
if (!UnitTest::Check(value)) \
4242
UnitTest::CurrentTest::Results()->OnTestFailure(UnitTest::TestDetails(*UnitTest::CurrentTest::Details(), __LINE__), #value); \
4343
}) \
44-
UT_CATCH (UnitTest::AssertException, , \
45-
{ \
46-
UT_THROW(); \
47-
}) \
44+
UT_CATCH (UnitTest::AssertException, , \
45+
{ \
46+
UT_THROW(); \
47+
}) \
4848
UT_CATCH (std::exception, e, \
4949
{ \
5050
UnitTest::MemoryOutStream message; \
@@ -64,11 +64,11 @@
6464
UT_TRY \
6565
({ \
6666
UnitTest::CheckEqual(*UnitTest::CurrentTest::Results(), expected, actual, UnitTest::TestDetails(*UnitTest::CurrentTest::Details(), __LINE__)); \
67-
}) \
68-
UT_CATCH (UnitTest::AssertException, , \
69-
{ \
70-
UT_THROW(); \
71-
}) \
67+
}) \
68+
UT_CATCH (UnitTest::AssertException, , \
69+
{ \
70+
UT_THROW(); \
71+
}) \
7272
UT_CATCH (std::exception, e, \
7373
{ \
7474
UnitTest::MemoryOutStream message; \
@@ -89,10 +89,10 @@
8989
({ \
9090
UnitTest::CheckClose(*UnitTest::CurrentTest::Results(), expected, actual, tolerance, UnitTest::TestDetails(*UnitTest::CurrentTest::Details(), __LINE__)); \
9191
}) \
92-
UT_CATCH (UnitTest::AssertException, , \
93-
{ \
94-
UT_THROW(); \
95-
}) \
92+
UT_CATCH (UnitTest::AssertException, , \
93+
{ \
94+
UT_THROW(); \
95+
}) \
9696
UT_CATCH (std::exception, e, \
9797
{ \
9898
UnitTest::MemoryOutStream message; \
@@ -112,11 +112,11 @@
112112
UT_TRY \
113113
({ \
114114
UnitTest::CheckArrayEqual(*UnitTest::CurrentTest::Results(), expected, actual, count, UnitTest::TestDetails(*UnitTest::CurrentTest::Details(), __LINE__)); \
115-
}) \
116-
UT_CATCH (UnitTest::AssertException, , \
117-
{ \
118-
UT_THROW(); \
119-
}) \
115+
}) \
116+
UT_CATCH (UnitTest::AssertException, , \
117+
{ \
118+
UT_THROW(); \
119+
}) \
120120
UT_CATCH (std::exception, e, \
121121
{ \
122122
UnitTest::MemoryOutStream message; \
@@ -137,10 +137,10 @@
137137
({ \
138138
UnitTest::CheckArrayClose(*UnitTest::CurrentTest::Results(), expected, actual, count, tolerance, UnitTest::TestDetails(*UnitTest::CurrentTest::Details(), __LINE__)); \
139139
}) \
140-
UT_CATCH (UnitTest::AssertException, , \
141-
{ \
142-
UT_THROW(); \
143-
}) \
140+
UT_CATCH (UnitTest::AssertException, , \
141+
{ \
142+
UT_THROW(); \
143+
}) \
144144
UT_CATCH (std::exception, e, \
145145
{ \
146146
UnitTest::MemoryOutStream message; \
@@ -160,11 +160,11 @@
160160
UT_TRY \
161161
({ \
162162
UnitTest::CheckArray2DClose(*UnitTest::CurrentTest::Results(), expected, actual, rows, columns, tolerance, UnitTest::TestDetails(*UnitTest::CurrentTest::Details(), __LINE__)); \
163-
}) \
164-
UT_CATCH (UnitTest::AssertException, , \
165-
{ \
166-
UT_THROW(); \
167-
}) \
163+
}) \
164+
UT_CATCH (UnitTest::AssertException, , \
165+
{ \
166+
UT_THROW(); \
167+
}) \
168168
UT_CATCH (std::exception, e, \
169169
{ \
170170
UnitTest::MemoryOutStream message; \

UnitTest++/RequireMacros.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
#endif
99

1010
#ifndef UNITTEST_NO_EXCEPTIONS
11-
#define REQUIRE for(UnitTest::RequiredCheckTestReporter decoratedReporter(UnitTest::CurrentTest::Results()); decoratedReporter.next(); )
11+
#define REQUIRE for(UnitTest::RequiredCheckTestReporter decoratedReporter(UnitTest::CurrentTest::Results()); decoratedReporter.next(); )
1212
#endif
1313

1414
#ifdef UNITTEST_NO_EXCEPTIONS
15-
#define REQUIRE
15+
#define REQUIRE
1616
#endif
1717

1818
#endif

UnitTest++/RequiredCheckTestReporter.cpp

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,25 @@
55

66
namespace UnitTest {
77

8-
RequiredCheckTestReporter::RequiredCheckTestReporter(TestResults* results)
9-
: m_results(results)
10-
, m_throwingReporter(0)
11-
, m_continue(0)
12-
{
13-
if(m_results)
14-
{
15-
m_throwingReporter.setDecorated(m_results->m_testReporter);
16-
m_results->m_testReporter = &m_throwingReporter;
17-
}
18-
}
8+
RequiredCheckTestReporter::RequiredCheckTestReporter(TestResults* results)
9+
: m_results(results)
10+
, m_throwingReporter(0)
11+
, m_continue(0)
12+
{
13+
if(m_results)
14+
{
15+
m_throwingReporter.setDecorated(m_results->m_testReporter);
16+
m_results->m_testReporter = &m_throwingReporter;
17+
}
18+
}
1919

20-
RequiredCheckTestReporter::~RequiredCheckTestReporter()
21-
{
22-
if(m_results) m_results->m_testReporter = m_throwingReporter.getDecorated();
23-
}
20+
RequiredCheckTestReporter::~RequiredCheckTestReporter()
21+
{
22+
if(m_results) m_results->m_testReporter = m_throwingReporter.getDecorated();
23+
}
2424

25-
bool RequiredCheckTestReporter::next()
26-
{
27-
return m_continue++ == 0;
28-
}
25+
bool RequiredCheckTestReporter::next()
26+
{
27+
return m_continue++ == 0;
28+
}
2929
}

UnitTest++/RequiredCheckTestReporter.h

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,23 @@
66

77
namespace UnitTest {
88

9-
class TestResults;
10-
11-
// This RAII class decorates the current TestReporter with
12-
// a version that throws after reporting a failure.
13-
class UNITTEST_LINKAGE RequiredCheckTestReporter
14-
{
15-
public:
16-
explicit RequiredCheckTestReporter(TestResults* results);
17-
~RequiredCheckTestReporter();
18-
19-
bool next();
20-
21-
private:
22-
TestResults* m_results;
23-
ThrowingTestReporter m_throwingReporter;
24-
int m_continue;
25-
};
9+
class TestResults;
10+
11+
// This RAII class decorates the current TestReporter with
12+
// a version that throws after reporting a failure.
13+
class UNITTEST_LINKAGE RequiredCheckTestReporter
14+
{
15+
public:
16+
explicit RequiredCheckTestReporter(TestResults* results);
17+
~RequiredCheckTestReporter();
18+
19+
bool next();
20+
21+
private:
22+
TestResults* m_results;
23+
ThrowingTestReporter m_throwingReporter;
24+
int m_continue;
25+
};
2626
}
2727

2828
#endif

UnitTest++/TestResults.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
namespace UnitTest {
77

8-
class RequiredCheckTestReporter;
8+
class RequiredCheckTestReporter;
99
class TestReporter;
1010
class TestDetails;
1111

@@ -23,9 +23,9 @@ class RequiredCheckTestReporter;
2323
int GetFailureCount() const;
2424

2525
private:
26-
friend class RequiredCheckTestReporter;
26+
friend class RequiredCheckTestReporter;
2727

28-
private:
28+
private:
2929
TestReporter* m_testReporter;
3030
int m_totalTestCount;
3131
int m_failedTestCount;

UnitTest++/ThrowingTestReporter.cpp

Lines changed: 42 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -3,49 +3,47 @@
33

44
namespace UnitTest {
55

6-
ThrowingTestReporter::ThrowingTestReporter(TestReporter* decoratedReporter)
7-
: m_decoratedReporter(decoratedReporter)
8-
{
9-
}
10-
11-
//virtual
12-
ThrowingTestReporter::~ThrowingTestReporter()
13-
{
14-
}
15-
16-
//virtual
17-
void ThrowingTestReporter::ReportTestStart(TestDetails const& test)
18-
{
19-
if(m_decoratedReporter) m_decoratedReporter->ReportTestStart(test);
20-
}
21-
22-
//virtual
23-
void ThrowingTestReporter::ReportFailure(TestDetails const& test, char const* failure)
24-
{
25-
if(m_decoratedReporter) m_decoratedReporter->ReportFailure(test, failure);
26-
throw AssertException();
27-
}
28-
29-
//virtual
30-
void ThrowingTestReporter::ReportTestFinish(TestDetails const& test, float secondsElapsed)
31-
{
32-
if(m_decoratedReporter) m_decoratedReporter->ReportTestFinish(test, secondsElapsed);
33-
}
34-
35-
//virtual
36-
void ThrowingTestReporter::ReportSummary(int totalTestCount, int failedTestCount, int failureCount, float secondsElapsed)
37-
{
38-
if(m_decoratedReporter) m_decoratedReporter->ReportSummary(totalTestCount, failedTestCount, failureCount, secondsElapsed);
39-
}
40-
41-
TestReporter* ThrowingTestReporter::getDecorated() const
42-
{
43-
return m_decoratedReporter;
44-
}
45-
46-
void ThrowingTestReporter::setDecorated(TestReporter* reporter)
47-
{
48-
m_decoratedReporter = reporter;
49-
}
6+
ThrowingTestReporter::ThrowingTestReporter(TestReporter* decoratedReporter)
7+
: m_decoratedReporter(decoratedReporter)
8+
{}
9+
10+
//virtual
11+
ThrowingTestReporter::~ThrowingTestReporter()
12+
{}
13+
14+
//virtual
15+
void ThrowingTestReporter::ReportTestStart(TestDetails const& test)
16+
{
17+
if(m_decoratedReporter) m_decoratedReporter->ReportTestStart(test);
18+
}
19+
20+
//virtual
21+
void ThrowingTestReporter::ReportFailure(TestDetails const& test, char const* failure)
22+
{
23+
if(m_decoratedReporter) m_decoratedReporter->ReportFailure(test, failure);
24+
throw AssertException();
25+
}
26+
27+
//virtual
28+
void ThrowingTestReporter::ReportTestFinish(TestDetails const& test, float secondsElapsed)
29+
{
30+
if(m_decoratedReporter) m_decoratedReporter->ReportTestFinish(test, secondsElapsed);
31+
}
32+
33+
//virtual
34+
void ThrowingTestReporter::ReportSummary(int totalTestCount, int failedTestCount, int failureCount, float secondsElapsed)
35+
{
36+
if(m_decoratedReporter) m_decoratedReporter->ReportSummary(totalTestCount, failedTestCount, failureCount, secondsElapsed);
37+
}
38+
39+
TestReporter* ThrowingTestReporter::getDecorated() const
40+
{
41+
return m_decoratedReporter;
42+
}
43+
44+
void ThrowingTestReporter::setDecorated(TestReporter* reporter)
45+
{
46+
m_decoratedReporter = reporter;
47+
}
5048

5149
}

UnitTest++/ThrowingTestReporter.h

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,25 @@
55

66
namespace UnitTest {
77

8-
// A TestReporter that throws when ReportFailure is called. Otherwise it
9-
// forwards the calls to a decorated TestReporter
10-
class ThrowingTestReporter : public TestReporter
11-
{
12-
public:
13-
explicit ThrowingTestReporter(TestReporter* reporter);
8+
// A TestReporter that throws when ReportFailure is called. Otherwise it
9+
// forwards the calls to a decorated TestReporter
10+
class ThrowingTestReporter : public TestReporter
11+
{
12+
public:
13+
explicit ThrowingTestReporter(TestReporter* reporter);
1414

15-
virtual ~ThrowingTestReporter();
16-
virtual void ReportTestStart(TestDetails const& test);
17-
virtual void ReportFailure(TestDetails const& test, char const* failure);
18-
virtual void ReportTestFinish(TestDetails const& test, float secondsElapsed);
19-
virtual void ReportSummary(int totalTestCount, int failedTestCount, int failureCount, float secondsElapsed);
15+
virtual ~ThrowingTestReporter();
16+
virtual void ReportTestStart(TestDetails const& test);
17+
virtual void ReportFailure(TestDetails const& test, char const* failure);
18+
virtual void ReportTestFinish(TestDetails const& test, float secondsElapsed);
19+
virtual void ReportSummary(int totalTestCount, int failedTestCount, int failureCount, float secondsElapsed);
2020

21-
TestReporter* getDecorated() const;
22-
void setDecorated(TestReporter* reporter);
21+
TestReporter* getDecorated() const;
22+
void setDecorated(TestReporter* reporter);
2323

24-
private:
25-
TestReporter* m_decoratedReporter;
26-
};
24+
private:
25+
TestReporter* m_decoratedReporter;
26+
};
2727
}
2828

2929
#endif

0 commit comments

Comments
 (0)