summaryrefslogtreecommitdiff
path: root/examples/cppunittest/StringToolsTest.h
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/cppunittest/StringToolsTest.h
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/cppunittest/StringToolsTest.h')
-rw-r--r--examples/cppunittest/StringToolsTest.h74
1 files changed, 74 insertions, 0 deletions
diff --git a/examples/cppunittest/StringToolsTest.h b/examples/cppunittest/StringToolsTest.h
new file mode 100644
index 0000000..4a42e20
--- /dev/null
+++ b/examples/cppunittest/StringToolsTest.h
@@ -0,0 +1,74 @@
+#ifndef STRINGTOOLSTEST_H
+#define STRINGTOOLSTEST_H
+
+#include <cppunit/extensions/HelperMacros.h>
+#include <cppunit/tools/StringTools.h>
+
+
+/// Unit tests for StringToolsTest
+class StringToolsTest : public CppUnit::TestCase
+{
+ CPPUNIT_TEST_SUITE( StringToolsTest );
+ CPPUNIT_TEST( testToStringInt );
+ CPPUNIT_TEST( testToStringDouble );
+ CPPUNIT_TEST( testSplitEmptyString );
+ CPPUNIT_TEST( testSplitOneItem );
+ CPPUNIT_TEST( testSplitItemEmpty );
+ CPPUNIT_TEST( testSplitTwoItem );
+ CPPUNIT_TEST( testSplitEmptyTwoItem );
+ CPPUNIT_TEST( testSplitEmptyItemEmpty );
+ CPPUNIT_TEST( testSplitEmptyItemEmptyEmptyItem );
+ CPPUNIT_TEST( testWrapEmpty );
+ CPPUNIT_TEST( testWrapNotNeeded );
+ CPPUNIT_TEST( testWrapLimitNotNeeded );
+ CPPUNIT_TEST( testWrapOneNeeded );
+ CPPUNIT_TEST( testWrapTwoNeeded );
+ CPPUNIT_TEST( testWrapLimitTwoNeeded );
+ CPPUNIT_TEST( testWrapOneNeededTwoNeeded );
+ CPPUNIT_TEST( testWrapNotNeededEmptyLinesOneNeeded );
+ CPPUNIT_TEST_SUITE_END();
+
+public:
+ /*! Constructs a StringToolsTest object.
+ */
+ StringToolsTest();
+
+ /// Destructor.
+ virtual ~StringToolsTest();
+
+ void setUp();
+ void tearDown();
+
+ void testToStringInt();
+ void testToStringDouble();
+
+ void testSplitEmptyString();
+ void testSplitOneItem();
+ void testSplitItemEmpty();
+ void testSplitTwoItem();
+ void testSplitEmptyTwoItem();
+ void testSplitEmptyItemEmpty();
+ void testSplitEmptyItemEmptyEmptyItem();
+
+ void testWrapEmpty();
+ void testWrapNotNeeded();
+ void testWrapLimitNotNeeded();
+ void testWrapOneNeeded();
+ void testWrapTwoNeeded();
+ void testWrapLimitTwoNeeded();
+ void testWrapOneNeededTwoNeeded();
+ void testWrapNotNeededEmptyLinesOneNeeded();
+
+private:
+ /// Prevents the use of the copy constructor.
+ StringToolsTest( const StringToolsTest &other );
+
+ /// Prevents the use of the copy operator.
+ void operator =( const StringToolsTest &other );
+
+private:
+};
+
+
+
+#endif // STRINGTOOLSTEST_H