summaryrefslogtreecommitdiff
path: root/examples/ClockerPlugIn/ClockerXmlHook.cpp
diff options
context:
space:
mode:
authorBaptiste Lepilleur <gaiacrtn@free.fr>2002-06-16 16:55:58 +0000
committerBaptiste Lepilleur <gaiacrtn@free.fr>2002-06-16 16:55:58 +0000
commit0a810d68d0550ba6f7f28f2e0dfcef691bdca7b4 (patch)
treea060d291bf0dfb6c75720ecbce7f27927b326a5b /examples/ClockerPlugIn/ClockerXmlHook.cpp
parent73a038f1eaa268cec330d971fb550befec6f7798 (diff)
downloadcppunit-0a810d68d0550ba6f7f28f2e0dfcef691bdca7b4.tar.gz
Release 1.
release 1.9.8 * include/cppunit/plugin/TestPlugIn.h: updated documentation. * include/cppunit/tools/XmlDocument.h: updated documentation. * include/cppunit/tools/StringTools.h: * src/cppunit/StringTools.cpp: added split() and wrap() functions. * include/cppunit/CompilerOutputter.h: * src/cppunit/CompilerOutputter.cpp: extracted wrap() and splitMessageIntoLines() to StringTools. * include/cppunit/XmlOutputterHook.h: * src/cppunit/XmlOutputterHook.cpp: removed rooNode parameter from beginDocument() and endDocument(). It can be retreive from document. Renamed 'node' occurences to 'element'. * include/cppunit/XmlOutputter.h: * src/cppunit/XmlOutputter.cpp: updated against XmlOutputterHook changes. Renamed 'node' occurences to 'element'. * examples/ClockerPlugIn/ClockerXmlHook.h: * examples/ClockerPlugIn/ClockerXmlHook.cpp: updated against XmlOutputterHook changes. * examples/cppunittest/XmlElementTest.h: * examples/cppunittest/XmlElementTest.cpp: Renamed 'node' occurences to 'element'. * examples/cppunittest/XmlOutputterTest.cpp: updated against XmlOutputterHook changes. * examples/cppunittest/StringToolsTest.h: * examples/cppunittest/StringToolsTest.cpp: added. Unit tests for StringTools. Turn out that VC++ dismiss empty lines in tools output, which is the reason why empty lines where not printed in CompilerOutputter.
Diffstat (limited to 'examples/ClockerPlugIn/ClockerXmlHook.cpp')
-rw-r--r--examples/ClockerPlugIn/ClockerXmlHook.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/examples/ClockerPlugIn/ClockerXmlHook.cpp b/examples/ClockerPlugIn/ClockerXmlHook.cpp
index 445b868..50c7df5 100644
--- a/examples/ClockerPlugIn/ClockerXmlHook.cpp
+++ b/examples/ClockerPlugIn/ClockerXmlHook.cpp
@@ -5,6 +5,7 @@
// //////////////////////////////////////////////////////////////////////////
#include <cppunit/Test.h>
+#include <cppunit/tools/XmlDocument.h>
#include <cppunit/tools/XmlElement.h>
#include "ClockerModel.h"
#include "ClockerXmlHook.h"
@@ -22,11 +23,10 @@ ClockerXmlHook::~ClockerXmlHook()
void
-ClockerXmlHook::endDocument( CppUnit::XmlDocument *document,
- CppUnit::XmlElement *rootNode )
+ClockerXmlHook::endDocument( CppUnit::XmlDocument *document )
{
CppUnit::XmlElement *testTreeElement = new CppUnit::XmlElement( "TimedTestTree" );
- rootNode->addElement( testTreeElement );
+ document->rootElement().addElement( testTreeElement );
addTimedTest( testTreeElement, 0 );
}
@@ -59,36 +59,36 @@ ClockerXmlHook::addTimedTest( CppUnit::XmlElement *parentElement,
void
ClockerXmlHook::failTestAdded( CppUnit::XmlDocument *document,
- CppUnit::XmlElement *testNode,
+ CppUnit::XmlElement *testElement,
CppUnit::Test *test,
CppUnit::TestFailure *failure )
{
- successfulTestAdded( document, testNode, test );
+ successfulTestAdded( document, testElement, test );
}
void
ClockerXmlHook::successfulTestAdded( CppUnit::XmlDocument *document,
- CppUnit::XmlElement *testNode,
+ CppUnit::XmlElement *testElement,
CppUnit::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 );
- testNode->addElement( new CppUnit::XmlElement( "TestPath", path.toString() ) );
- testNode->addElement( new CppUnit::XmlElement( "Time",
- ClockerModel::timeStringFor( time ) ) );
+ testElement->addElement( new CppUnit::XmlElement( "TestPath", path.toString() ) );
+ testElement->addElement( new CppUnit::XmlElement( "Time",
+ ClockerModel::timeStringFor( time ) ) );
}
void
ClockerXmlHook::statisticsAdded( CppUnit::XmlDocument *document,
- CppUnit::XmlElement *statisticsNode )
+ CppUnit::XmlElement *statisticsElement )
{
- statisticsNode->addElement(
+ statisticsElement->addElement(
new CppUnit::XmlElement( "TotalElapsedTime",
ClockerModel::timeStringFor( m_model->totalElapsedTime() ) ) );
- statisticsNode->addElement(
+ statisticsElement->addElement(
new CppUnit::XmlElement( "AverageTestCaseTime",
ClockerModel::timeStringFor( m_model->averageTestCaseTime() ) ) );
}