summaryrefslogtreecommitdiff
path: root/examples/cppunittest/StringToolsTest.h
blob: 05a834ac606f886591e159910a1470a97d39f3fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
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_NS::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