@@ -68,7 +68,6 @@ std::set<std::string> TestFixture::missingLibs;
6868
6969TestFixture::TestFixture (const std::string &_name)
7070 :classname(_name)
71- ,gcc_style_errors(false )
7271 ,quiet_tests(false )
7372{
7473 TestRegistry::theInstance ().addTest (this );
@@ -121,38 +120,25 @@ void TestFixture::assert_(const char *filename, unsigned int linenr, bool condit
121120{
122121 if (!condition) {
123122 ++fails_counter;
124- if (gcc_style_errors) {
125- errmsg << filename << ' :' << linenr << " : Assertion failed." << std::endl;
126- } else {
127- errmsg << " Assertion failed in " << filename << " at line " << linenr << std::endl << " _____" << std::endl;
128- }
123+ errmsg << filename << ' :' << linenr << " : Assertion failed." << std::endl << " _____" << std::endl;
124+
129125 }
130126}
131127
132128void TestFixture::assertEquals (const char *filename, unsigned int linenr, const std::string &expected, const std::string &actual, const std::string &msg) const
133129{
134130 if (expected != actual) {
135131 ++fails_counter;
136- if (gcc_style_errors) {
137- errmsg << filename << ' :' << linenr << " : Assertion failed. "
138- << " Expected: "
139- << writestr (expected, true )
140- << " . Actual: "
141- << writestr (actual, true )
142- << ' .'
143- << std::endl;
144- if (!msg.empty ())
145- errmsg << msg << std::endl;
146- } else {
147- errmsg << " Assertion failed in " << filename << " at line " << linenr << std::endl
148- << " Expected:" << std::endl
149- << writestr (expected) << std::endl
150- << " Actual:" << std::endl
151- << writestr (actual) << std::endl;
152- if (!msg.empty ())
153- errmsg << " Hint:" << std::endl << msg << std::endl;
154- errmsg << " _____" << std::endl;
155- }
132+ errmsg << filename << ' :' << linenr << " : Assertion failed. " << std::endl
133+ << " Expected: " << std::endl
134+ << writestr (expected) << std::endl
135+ << " Actual: " << std::endl
136+ << writestr (actual) << std::endl;
137+ if (!msg.empty ())
138+ errmsg << " Hint:" << std::endl << msg << std::endl;
139+ errmsg << " _____" << std::endl;
140+
141+
156142 }
157143}
158144void TestFixture::assertEquals (const char *filename, unsigned int linenr, const char expected[], const std::string& actual, const std::string &msg) const
@@ -192,13 +178,9 @@ void TestFixture::todoAssertEquals(const char *filename, unsigned int linenr,
192178 const std::string &actual) const
193179{
194180 if (wanted == actual) {
195- if (gcc_style_errors) {
196- errmsg << filename << ' :' << linenr << " : Assertion succeeded unexpectedly. "
197- << " Result: " << writestr (wanted, true ) << " ." << std::endl;
198- } else {
199- errmsg << " Assertion succeeded unexpectedly in " << filename << " at line " << linenr << std::endl
200- << " Result:" << std::endl << writestr (wanted) << std::endl << " _____" << std::endl;
201- }
181+ errmsg << filename << ' :' << linenr << " : Assertion succeeded unexpectedly. "
182+ << " Result: " << writestr (wanted, true ) << std::endl << " _____" << std::endl;
183+
202184 ++succeeded_todos_counter;
203185 } else {
204186 assertEquals (filename, linenr, current, actual);
@@ -218,37 +200,25 @@ void TestFixture::todoAssertEquals(const char *filename, unsigned int linenr, lo
218200void TestFixture::assertThrow (const char *filename, unsigned int linenr) const
219201{
220202 ++fails_counter;
221- if (gcc_style_errors) {
222- errmsg << filename << ' :' << linenr << " Assertion succeeded. "
223- << " The expected exception was thrown" << std::endl;
224- } else {
225- errmsg << " Assertion succeeded in " << filename << " at line " << linenr << std::endl
226- << " The expected exception was thrown" << std::endl << " _____" << std::endl;
227- }
203+ errmsg << filename << ' :' << linenr << " : Assertion succeeded. "
204+ << " The expected exception was thrown" << std::endl << " _____" << std::endl;
205+
228206}
229207
230208void TestFixture::assertThrowFail (const char *filename, unsigned int linenr) const
231209{
232210 ++fails_counter;
233- if (gcc_style_errors) {
234- errmsg << filename << ' :' << linenr << " Assertion failed. "
235- << " The expected exception was not thrown" << std::endl;
236- } else {
237- errmsg << " Assertion failed in " << filename << " at line " << linenr << std::endl
238- << " The expected exception was not thrown" << std::endl << " _____" << std::endl;
239- }
211+ errmsg << filename << ' :' << linenr << " : Assertion failed. "
212+ << " The expected exception was not thrown" << std::endl << " _____" << std::endl;
213+
240214}
241215
242216void TestFixture::assertNoThrowFail (const char *filename, unsigned int linenr) const
243217{
244218 ++fails_counter;
245- if (gcc_style_errors) {
246- errmsg << filename << ' :' << linenr << " Assertion failed. "
247- << " Unexpected exception was thrown" << std::endl;
248- } else {
249- errmsg << " Assertion failed in " << filename << " at line " << linenr << std::endl
250- << " Unexpected exception was thrown" << std::endl << " _____" << std::endl;
251- }
219+ errmsg << filename << ' :' << linenr << " : Assertion failed. "
220+ << " Unexpected exception was thrown" << std::endl << " _____" << std::endl;
221+
252222}
253223
254224void TestFixture::complainMissingLib (const char * libname) const
@@ -272,7 +242,6 @@ void TestFixture::run(const std::string &str)
272242void TestFixture::processOptions (const options& args)
273243{
274244 quiet_tests = args.quiet ();
275- gcc_style_errors = args.gcc_style_errors ();
276245}
277246
278247std::size_t TestFixture::runTests (const options& args)
0 commit comments