Skip to content

Commit ad1c0e4

Browse files
committed
Fixed formatting
1 parent 8192800 commit ad1c0e4

35 files changed

+1055
-1137
lines changed

.settings/org.eclipse.cdt.core.prefs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#Tue Dec 29 09:23:19 SGT 2009
1+
#Mon Jun 07 17:30:05 SGT 2010
22
eclipse.preferences.version=1
33
org.eclipse.cdt.core.formatter.alignment_for_arguments_in_method_invocation=16
44
org.eclipse.cdt.core.formatter.alignment_for_base_clause_in_type_declaration=80
@@ -67,6 +67,7 @@ org.eclipse.cdt.core.formatter.insert_space_after_opening_brace_in_array_initial
6767
org.eclipse.cdt.core.formatter.insert_space_after_opening_bracket=do not insert
6868
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
6969
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
70+
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_exception_specification=do not insert
7071
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
7172
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
7273
org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
@@ -87,6 +88,7 @@ org.eclipse.cdt.core.formatter.insert_space_before_closing_brace_in_array_initia
8788
org.eclipse.cdt.core.formatter.insert_space_before_closing_bracket=do not insert
8889
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
8990
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
91+
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_exception_specification=do not insert
9092
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
9193
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
9294
org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
@@ -119,6 +121,7 @@ org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_switch=inser
119121
org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
120122
org.eclipse.cdt.core.formatter.insert_space_before_opening_bracket=do not insert
121123
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
124+
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_exception_specification=insert
122125
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_for=insert
123126
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_if=insert
124127
org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
@@ -134,13 +137,14 @@ org.eclipse.cdt.core.formatter.insert_space_before_semicolon_in_for=do not inser
134137
org.eclipse.cdt.core.formatter.insert_space_before_unary_operator=do not insert
135138
org.eclipse.cdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
136139
org.eclipse.cdt.core.formatter.insert_space_between_empty_brackets=do not insert
140+
org.eclipse.cdt.core.formatter.insert_space_between_empty_parens_in_exception_specification=do not insert
137141
org.eclipse.cdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
138142
org.eclipse.cdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
139143
org.eclipse.cdt.core.formatter.keep_else_statement_on_same_line=true
140144
org.eclipse.cdt.core.formatter.keep_empty_array_initializer_on_one_line=false
141145
org.eclipse.cdt.core.formatter.keep_imple_if_on_one_line=false
142146
org.eclipse.cdt.core.formatter.keep_then_statement_on_same_line=true
143-
org.eclipse.cdt.core.formatter.lineSplit=80
147+
org.eclipse.cdt.core.formatter.lineSplit=200
144148
org.eclipse.cdt.core.formatter.number_of_empty_lines_to_preserve=1
145149
org.eclipse.cdt.core.formatter.put_empty_statement_on_new_line=true
146150
org.eclipse.cdt.core.formatter.tabulation.char=tab

src/CppUTest/CommandLineArguments.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@
3030
#include "CppUTest/PlatformSpecificFunctions.h"
3131

3232
CommandLineArguments::CommandLineArguments(int ac, const char** av) :
33-
ac_(ac), av_(av), verbose_(false), repeat_(1), groupFilter_(
34-
""), nameFilter_(""), outputType_(OUTPUT_ECLIPSE)
33+
ac_(ac), av_(av), verbose_(false), repeat_(1), groupFilter_(""), nameFilter_(""), outputType_(OUTPUT_ECLIPSE)
3534
{
3635
}
3736

@@ -48,10 +47,8 @@ bool CommandLineArguments::parse(TestPlugin* plugin)
4847
else if (argument.startsWith("-r")) SetRepeatCount(ac_, av_, i);
4948
else if (argument.startsWith("-g")) SetGroupFilter(ac_, av_, i);
5049
else if (argument.startsWith("-n")) SetNameFilter(ac_, av_, i);
51-
else if (argument.startsWith("-o")) correctParameters = SetOutputType(
52-
ac_, av_, i);
53-
else if (argument.startsWith("-p")) correctParameters
54-
= plugin->parseArguments(ac_, av_, i);
50+
else if (argument.startsWith("-o")) correctParameters = SetOutputType(ac_, av_, i);
51+
else if (argument.startsWith("-p")) correctParameters = plugin->parseArguments(ac_, av_, i);
5552
else correctParameters = false;
5653

5754
if (correctParameters == false) {
@@ -101,8 +98,7 @@ void CommandLineArguments::SetRepeatCount(int ac, const char** av, int& i)
10198

10299
}
103100

104-
SimpleString CommandLineArguments::getParameterField(int ac, const char** av,
105-
int& i)
101+
SimpleString CommandLineArguments::getParameterField(int ac, const char** av, int& i)
106102
{
107103
SimpleString parameter(av[i]);
108104
if (parameter.size() > 2) return av[i] + 2;

src/CppUTest/CommandLineTestRunner.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@
3131
#include "CppUTest/JUnitTestOutput.h"
3232
#include "CppUTest/TestRegistry.h"
3333

34-
CommandLineTestRunner::CommandLineTestRunner(int ac, const char** av,
35-
TestOutput* output) :
34+
CommandLineTestRunner::CommandLineTestRunner(int ac, const char** av, TestOutput* output) :
3635
output_(output), jUnitOutput_(new JUnitTestOutput)
3736
{
3837
arguments_ = new CommandLineArguments(ac, av);
@@ -55,7 +54,6 @@ int CommandLineTestRunner::RunAllTests(int ac, const char** av)
5554
ConsoleTestOutput output;
5655

5756
MemoryLeakWarningPlugin memLeakWarn(DEF_PLUGIN_MEM_LEAK);
58-
//memLeakWarn.disable();
5957
TestRegistry::getCurrentRegistry()->installPlugin(&memLeakWarn);
6058

6159
{

src/CppUTest/Failure.cpp

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -29,28 +29,23 @@
2929
#include "CppUTest/Failure.h"
3030
#include "CppUTest/TestOutput.h"
3131

32-
Failure::Failure(Utest* test, const char* fileName, int lineNumber,
33-
const SimpleString& theMessage) :
34-
testName_(test->getFormattedName()), fileName_(fileName), lineNumber_(
35-
lineNumber), message_(theMessage)
32+
Failure::Failure(Utest* test, const char* fileName, int lineNumber, const SimpleString& theMessage) :
33+
testName_(test->getFormattedName()), fileName_(fileName), lineNumber_(lineNumber), message_(theMessage)
3634
{
3735
}
3836

3937
Failure::Failure(Utest* test, const SimpleString& theMessage) :
40-
testName_(test->getFormattedName()), fileName_(test->getFile()), lineNumber_(
41-
test->getLineNumber()), message_(theMessage)
38+
testName_(test->getFormattedName()), fileName_(test->getFile()), lineNumber_(test->getLineNumber()), message_(theMessage)
4239
{
4340
}
4441

4542
Failure::Failure(Utest* test, const char* fileName, int lineNum) :
46-
testName_(test->getFormattedName()), fileName_(fileName),
47-
lineNumber_(lineNum), message_("no message")
43+
testName_(test->getFormattedName()), fileName_(fileName), lineNumber_(lineNum), message_("no message")
4844
{
4945
}
5046

5147
Failure::Failure(const Failure& f) :
52-
testName_(f.testName_), fileName_(f.fileName_), lineNumber_(f.lineNumber_),
53-
message_(f.message_)
48+
testName_(f.testName_), fileName_(f.fileName_), lineNumber_(f.lineNumber_), message_(f.message_)
5449
{
5550
}
5651

@@ -78,24 +73,18 @@ SimpleString Failure::getMessage() const
7873
return message_;
7974
}
8075

81-
EqualsFailure::EqualsFailure(Utest* test, const char* fileName,
82-
int lineNumber, const SimpleString& expected,
83-
const SimpleString& actual) :
76+
EqualsFailure::EqualsFailure(Utest* test, const char* fileName, int lineNumber, const SimpleString& expected, const SimpleString& actual) :
8477
Failure(test, fileName, lineNumber)
8578
{
8679

8780
const char* format = "expected <%s>\n\tbut was <%s>";
88-
message_ = StringFromFormat(format, expected.asCharString(),
89-
actual.asCharString());
81+
message_ = StringFromFormat(format, expected.asCharString(), actual.asCharString());
9082
}
9183

92-
ContainsFailure::ContainsFailure(Utest* test, const char* fileName,
93-
int lineNumber, const SimpleString& expected,
94-
const SimpleString& actual) :
84+
ContainsFailure::ContainsFailure(Utest* test, const char* fileName, int lineNumber, const SimpleString& expected, const SimpleString& actual) :
9585
Failure(test, fileName, lineNumber)
9686
{
9787

9888
const char* format = "actual <%s>\n\tdid not contain <%s>";
99-
message_ = StringFromFormat(format, actual.asCharString(),
100-
expected.asCharString());
89+
message_ = StringFromFormat(format, actual.asCharString(), expected.asCharString());
10190
}

src/CppUTest/MemoryLeakAllocator.cpp

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232
static char* checkedMalloc(size_t size)
3333
{
3434
char* mem = (char*) PlatformSpecificMalloc(size);
35-
if (mem == 0)FAIL("malloc returned nul pointer");
35+
if (mem == 0)
36+
FAIL("malloc returned nul pointer");
3637
return mem;
3738
}
3839

@@ -52,8 +53,7 @@ void MemoryLeakAllocator::setCurrentNewAllocator(MemoryLeakAllocator* allocator)
5253

5354
MemoryLeakAllocator* MemoryLeakAllocator::getCurrentNewAllocator()
5455
{
55-
if (currentNewAllocator == 0)
56-
setCurrentNewAllocatorToDefault();
56+
if (currentNewAllocator == 0) setCurrentNewAllocatorToDefault();
5757
return currentNewAllocator;
5858
}
5959

@@ -69,8 +69,7 @@ void MemoryLeakAllocator::setCurrentNewArrayAllocator(MemoryLeakAllocator* alloc
6969

7070
MemoryLeakAllocator* MemoryLeakAllocator::getCurrentNewArrayAllocator()
7171
{
72-
if (currentNewArrayAllocator == 0)
73-
setCurrentNewArrayAllocatorToDefault();
72+
if (currentNewArrayAllocator == 0) setCurrentNewArrayAllocatorToDefault();
7473
return currentNewArrayAllocator;
7574
}
7675

@@ -86,8 +85,7 @@ void MemoryLeakAllocator::setCurrentMallocAllocator(MemoryLeakAllocator* allocat
8685

8786
MemoryLeakAllocator* MemoryLeakAllocator::getCurrentMallocAllocator()
8887
{
89-
if (currentMallocAllocator == 0)
90-
setCurrentMallocAllocatorToDefault();
88+
if (currentMallocAllocator == 0) setCurrentMallocAllocatorToDefault();
9189
return currentMallocAllocator;
9290
}
9391

@@ -106,13 +104,11 @@ char* MemoryLeakAllocator::allocMemoryLeakNode(size_t size)
106104
return alloc_memory(size);
107105
}
108106

109-
void MemoryLeakAllocator::freeMemoryLeakNode(char* memory)
107+
void MemoryLeakAllocator::freeMemoryLeakNode(char* memory)
110108
{
111109
free_memory(memory);
112110
}
113111

114-
115-
116112
char* StandardMallocAllocator::alloc_memory(size_t size)
117113
{
118114
return checkedMalloc(size);

0 commit comments

Comments
 (0)