summaryrefslogtreecommitdiff
path: root/src/cppunit/TextOutputter.cpp
diff options
context:
space:
mode:
authorBaptiste Lepilleur <gaiacrtn@free.fr>2004-06-25 09:41:28 +0000
committerBaptiste Lepilleur <gaiacrtn@free.fr>2004-06-25 09:41:28 +0000
commit212df8f138166ed053d63d6d54e1a1290e395ae5 (patch)
treecadc9e6eaca1d184b7a69a8b389214d966c4ffb6 /src/cppunit/TextOutputter.cpp
parentd9353259d7f48a5497e72a257f2a549ba719bc0c (diff)
downloadcppunit-212df8f138166ed053d63d6d54e1a1290e395ae5.tar.gz
Include/cppunit/Portability.
include/cppunit/Portability.h: moved OStringStream alias definition to Portability/Stream.h. User need to define EVC4 to indicate that config-evc4.h should be used. (how to we detect this automatically ?). Notes that this means it might be needed to add #include <string> to some headers since its no longer included by Portability.h. * include/cppunit/Portability/Stream.h: define alias OStringStream, stdCOut(), and OFileStream. If CPPUNIT_NO_STREAM is defined (evc4 config), then provides our own implementation (based on sprintf and fwrite). * include/cppunit/config/config-evc4.h: config file for embedded visual c++ 4. Still need to detect for this platform in Portability.h (currently relying on EVC4 being defined...) * *.[cpp/h]: most source files have been impacted with the following change: #include <iostream> -> #include <cppunit/Portability/Stream.h> std::ostream -> CPPUNIT_NS::OStream std::ofstream -> CPPUNIT_NS::OFileStream std::cout -> CPPUNIT_NS::stdCOut() std::endl -> "\n" Also, code using std::cin as been defined out if CPPUNIT_NO_STREAM was defined. The exact list of impact files can be obtain in CVS using tags: TG_CPPUNIT_NO_STREAM_BEFORE & TG_CPPUNIT_NO_STREAM_AFTER.
Diffstat (limited to 'src/cppunit/TextOutputter.cpp')
-rw-r--r--src/cppunit/TextOutputter.cpp25
1 files changed, 12 insertions, 13 deletions
diff --git a/src/cppunit/TextOutputter.cpp b/src/cppunit/TextOutputter.cpp
index 6dd54e5..f74214f 100644
--- a/src/cppunit/TextOutputter.cpp
+++ b/src/cppunit/TextOutputter.cpp
@@ -9,7 +9,7 @@ CPPUNIT_NS_BEGIN
TextOutputter::TextOutputter( TestResultCollector *result,
- std::ostream &stream )
+ OStream &stream )
: m_result( result )
, m_stream( stream )
{
@@ -25,9 +25,9 @@ void
TextOutputter::write()
{
printHeader();
- m_stream << std::endl;
+ m_stream << "\n";
printFailures();
- m_stream << std::endl;
+ m_stream << "\n";
}
@@ -38,7 +38,7 @@ TextOutputter::printFailures()
int failureNumber = 1;
while ( itFailure != m_result->failures().end() )
{
- m_stream << std::endl;
+ m_stream << "\n";
printFailure( *itFailure++, failureNumber++ );
}
}
@@ -55,9 +55,9 @@ TextOutputter::printFailure( TestFailure *failure,
printFailureType( failure );
m_stream << ' ';
printFailureLocation( failure->sourceLine() );
- m_stream << std::endl;
+ m_stream << "\n";
printFailureDetail( failure->thrownException() );
- m_stream << std::endl;
+ m_stream << "\n";
}
@@ -98,7 +98,7 @@ TextOutputter::printFailureLocation( SourceLine sourceLine )
void
TextOutputter::printFailureDetail( Exception *thrownException )
{
- m_stream << thrownException->message().shortDescription() << std::endl;
+ m_stream << thrownException->message().shortDescription() << "\n";
m_stream << thrownException->message().details();
}
@@ -107,11 +107,10 @@ void
TextOutputter::printHeader()
{
if ( m_result->wasSuccessful() )
- m_stream << std::endl << "OK (" << m_result->runTests () << " tests)"
- << std::endl;
+ m_stream << "\nOK (" << m_result->runTests () << " tests)\n" ;
else
{
- m_stream << std::endl;
+ m_stream << "\n";
printFailureWarning();
printStatistics();
}
@@ -121,19 +120,19 @@ TextOutputter::printHeader()
void
TextOutputter::printFailureWarning()
{
- m_stream << "!!!FAILURES!!!" << std::endl;
+ m_stream << "!!!FAILURES!!!\n";
}
void
TextOutputter::printStatistics()
{
- m_stream << "Test Results:" << std::endl;
+ m_stream << "Test Results:\n";
m_stream << "Run: " << m_result->runTests()
<< " Failures: " << m_result->testFailures()
<< " Errors: " << m_result->testErrors()
- << std::endl;
+ << "\n";
}