summaryrefslogtreecommitdiff
path: root/examples/ClockerPlugIn
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 /examples/ClockerPlugIn
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 'examples/ClockerPlugIn')
-rw-r--r--examples/ClockerPlugIn/ClockerListener.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/examples/ClockerPlugIn/ClockerListener.cpp b/examples/ClockerPlugIn/ClockerListener.cpp
index 643a947..a3e2a6c 100644
--- a/examples/ClockerPlugIn/ClockerListener.cpp
+++ b/examples/ClockerPlugIn/ClockerListener.cpp
@@ -4,7 +4,7 @@
// Created: 2002/04/19
// //////////////////////////////////////////////////////////////////////////
#include <cppunit/Test.h>
-#include <iostream>
+#include <cppunit/Portability/Stream.h>
#include "ClockerListener.h"
#include "ClockerModel.h"
#include <stdio.h>
@@ -72,10 +72,10 @@ void
ClockerListener::printStatistics() const
{
printTest( 0, "" );
- std::cout << std::endl;
- std::cout << "Total elapsed time: ";
+ CPPUNIT_NS::stdCOut() << "\n";
+ CPPUNIT_NS::stdCOut() << "Total elapsed time: ";
printTime( m_model->totalElapsedTime() );
- std::cout << ", average test case time: ";
+ CPPUNIT_NS::stdCOut() << ", average test case time: ";
printTime( m_model->averageTestCaseTime() );
}
@@ -90,8 +90,8 @@ ClockerListener::printTest( int testIndex,
printTestIndent( indentString, indentLength );
printTime( m_model->testTimeFor( testIndex ) );
- std::cout << m_model->testPathFor( testIndex ).getChildTest()->getName();
- std::cout << std::endl;
+ CPPUNIT_NS::stdCOut() << m_model->testPathFor( testIndex ).getChildTest()->getName();
+ CPPUNIT_NS::stdCOut() << "\n";
if ( m_model->childCountFor( testIndex ) == 0 )
indent+= std::string( indentLength, ' ' );
@@ -110,14 +110,14 @@ ClockerListener::printTestIndent( const std::string &indent,
if ( indent.empty() )
return;
- std::cout << " ";
- std::cout << indent.substr( 0, indent.length() - indentLength ) ;
- std::cout << "+" << std::string( indentLength -1, '-' );
+ CPPUNIT_NS::stdCOut() << " ";
+ CPPUNIT_NS::stdCOut() << indent.substr( 0, indent.length() - indentLength ) ;
+ CPPUNIT_NS::stdCOut() << "+" << std::string( indentLength -1, '-' );
}
void
ClockerListener::printTime( double time ) const
{
- std::cout << '(' << ClockerModel::timeStringFor( time ) << "s) ";
+ CPPUNIT_NS::stdCOut() << '(' << ClockerModel::timeStringFor( time ) << "s) ";
}