summaryrefslogtreecommitdiff
path: root/examples/ClockerPlugIn/ClockerXmlHook.cpp
diff options
context:
space:
mode:
authorBaptiste Lepilleur <gaiacrtn@free.fr>2002-07-14 18:48:32 +0000
committerBaptiste Lepilleur <gaiacrtn@free.fr>2002-07-14 18:48:32 +0000
commit251c1ff8aecaa608ef9e6041c2691d369430bf7b (patch)
tree183795a04e06a8a94a64214afc2a1cc8a12a5486 /examples/ClockerPlugIn/ClockerXmlHook.cpp
parent0807889cb53679c5a9e741e8dedc3668ef59729b (diff)
downloadcppunit-251c1ff8aecaa608ef9e6041c2691d369430bf7b.tar.gz
CodingGuideLines.
CodingGuideLines.txt: added. CppUnit's coding guidelines for portability. * include/cppunit/portability/CppUnitStack.h: added. wrapper for std::stack. * include/cppunit/portability/CppUnitSet.h: added. wrapper for std::set. * include/cppunit/ui/text/TestRunner.h: fixed namespace definition for deprecated TestRunner. * include/cppunit/TestAssert.h: * src/cppunit/TestAssert.cpp: removed old deprecated functions that did not use SourceLine. Moved assertEquals() and assertDoubleEquals() into CppUnit namespace. * src/cppunit/TestFactoryRegistry.cpp: use CppUnitMap instead of std::map. * src/DllPlugInTester/CommandLineParser.h: use CppUnitDeque instead std::deque. * examples/cppunittest/*.h: * examples/cppunittest/*.cpp: removed all usage of CppUnitTest namespace. Everything is now in global space. * examples/*/*.h: * examples/*/*.cpp: replaced usage of CppUnit:: with CPPUNIT_NS::. * examples/ClockerPlugIn/ClockerModel.h: use CppUnit STL wrapper instead of STL container.
Diffstat (limited to 'examples/ClockerPlugIn/ClockerXmlHook.cpp')
-rw-r--r--examples/ClockerPlugIn/ClockerXmlHook.cpp44
1 files changed, 22 insertions, 22 deletions
diff --git a/examples/ClockerPlugIn/ClockerXmlHook.cpp b/examples/ClockerPlugIn/ClockerXmlHook.cpp
index 50c7df5..20cc2f8 100644
--- a/examples/ClockerPlugIn/ClockerXmlHook.cpp
+++ b/examples/ClockerPlugIn/ClockerXmlHook.cpp
@@ -23,9 +23,9 @@ ClockerXmlHook::~ClockerXmlHook()
void
-ClockerXmlHook::endDocument( CppUnit::XmlDocument *document )
+ClockerXmlHook::endDocument( CPPUNIT_NS::XmlDocument *document )
{
- CppUnit::XmlElement *testTreeElement = new CppUnit::XmlElement( "TimedTestTree" );
+ CPPUNIT_NS::XmlElement *testTreeElement = new CPPUNIT_NS::XmlElement( "TimedTestTree" );
document->rootElement().addElement( testTreeElement );
addTimedTest( testTreeElement, 0 );
@@ -33,19 +33,19 @@ ClockerXmlHook::endDocument( CppUnit::XmlDocument *document )
void
-ClockerXmlHook::addTimedTest( CppUnit::XmlElement *parentElement,
+ClockerXmlHook::addTimedTest( CPPUNIT_NS::XmlElement *parentElement,
int testIndex )
{
std::string elementName = m_model->isSuite( testIndex ) ? "TimedSuite" : "TimedTest";
- CppUnit::XmlElement *testElement = new CppUnit::XmlElement( elementName );
+ CPPUNIT_NS::XmlElement *testElement = new CPPUNIT_NS::XmlElement( elementName );
parentElement->addElement( testElement );
testElement->addAttribute( "id", testIndex );
- const CppUnit::TestPath &path = m_model->testPathFor( testIndex );
- testElement->addElement( new CppUnit::XmlElement( "Name",
+ const CPPUNIT_NS::TestPath &path = m_model->testPathFor( testIndex );
+ testElement->addElement( new CPPUNIT_NS::XmlElement( "Name",
path.getChildTest()->getName() ) );
- testElement->addElement( new CppUnit::XmlElement( "TestPath", path.toString() ) );
- testElement->addElement( new CppUnit::XmlElement( "Time",
+ testElement->addElement( new CPPUNIT_NS::XmlElement( "TestPath", path.toString() ) );
+ testElement->addElement( new CPPUNIT_NS::XmlElement( "Time",
ClockerModel::timeStringFor(
m_model->testTimeFor( testIndex ) ) ) );
@@ -58,37 +58,37 @@ ClockerXmlHook::addTimedTest( CppUnit::XmlElement *parentElement,
void
-ClockerXmlHook::failTestAdded( CppUnit::XmlDocument *document,
- CppUnit::XmlElement *testElement,
- CppUnit::Test *test,
- CppUnit::TestFailure *failure )
+ClockerXmlHook::failTestAdded( CPPUNIT_NS::XmlDocument *document,
+ CPPUNIT_NS::XmlElement *testElement,
+ CPPUNIT_NS::Test *test,
+ CPPUNIT_NS::TestFailure *failure )
{
successfulTestAdded( document, testElement, test );
}
void
-ClockerXmlHook::successfulTestAdded( CppUnit::XmlDocument *document,
- CppUnit::XmlElement *testElement,
- CppUnit::Test *test )
+ClockerXmlHook::successfulTestAdded( CPPUNIT_NS::XmlDocument *document,
+ CPPUNIT_NS::XmlElement *testElement,
+ CPPUNIT_NS::Test *test )
{
int testIndex = m_model->indexOf( test );
double time = (testIndex >= 0) ? m_model->testTimeFor( testIndex ) : 0.0;
- const CppUnit::TestPath &path = m_model->testPathFor( testIndex );
- testElement->addElement( new CppUnit::XmlElement( "TestPath", path.toString() ) );
- testElement->addElement( new CppUnit::XmlElement( "Time",
+ const CPPUNIT_NS::TestPath &path = m_model->testPathFor( testIndex );
+ testElement->addElement( new CPPUNIT_NS::XmlElement( "TestPath", path.toString() ) );
+ testElement->addElement( new CPPUNIT_NS::XmlElement( "Time",
ClockerModel::timeStringFor( time ) ) );
}
void
-ClockerXmlHook::statisticsAdded( CppUnit::XmlDocument *document,
- CppUnit::XmlElement *statisticsElement )
+ClockerXmlHook::statisticsAdded( CPPUNIT_NS::XmlDocument *document,
+ CPPUNIT_NS::XmlElement *statisticsElement )
{
statisticsElement->addElement(
- new CppUnit::XmlElement( "TotalElapsedTime",
+ new CPPUNIT_NS::XmlElement( "TotalElapsedTime",
ClockerModel::timeStringFor( m_model->totalElapsedTime() ) ) );
statisticsElement->addElement(
- new CppUnit::XmlElement( "AverageTestCaseTime",
+ new CPPUNIT_NS::XmlElement( "AverageTestCaseTime",
ClockerModel::timeStringFor( m_model->averageTestCaseTime() ) ) );
}