Blame examples/cppunittest/TestPathTest.h

Packit 8c9aa0
#ifndef TESTPATHTEST_H
Packit 8c9aa0
#define TESTPATHTEST_H
Packit 8c9aa0
Packit 8c9aa0
#include <cppunit/extensions/HelperMacros.h>
Packit 8c9aa0
#include <cppunit/TestPath.h>
Packit 8c9aa0
#include <cppunit/TestCase.h>
Packit 8c9aa0
#include <stdexcept>
Packit 8c9aa0
Packit 8c9aa0
Packit 8c9aa0
/*! \class TestPathTest
Packit 8c9aa0
 * \brief Unit tests for class TestPath.
Packit 8c9aa0
 */
Packit 8c9aa0
class TestPathTest : public CPPUNIT_NS::TestFixture
Packit 8c9aa0
{
Packit 8c9aa0
  CPPUNIT_TEST_SUITE( TestPathTest );
Packit 8c9aa0
  CPPUNIT_TEST( testDefaultConstructor );
Packit 8c9aa0
  CPPUNIT_TEST( testAddTest );
Packit 8c9aa0
  CPPUNIT_TEST_EXCEPTION( testGetTestAtThrow1, std::out_of_range );
Packit 8c9aa0
  CPPUNIT_TEST_EXCEPTION( testGetTestAtThrow2, std::out_of_range );
Packit 8c9aa0
  CPPUNIT_TEST( testGetChildTest );
Packit 8c9aa0
  CPPUNIT_TEST( testGetChildTestManyTests );
Packit 8c9aa0
  CPPUNIT_TEST_EXCEPTION( testGetChildTestThrowIfNotValid, std::out_of_range );
Packit 8c9aa0
  CPPUNIT_TEST( testAddPath );
Packit 8c9aa0
  CPPUNIT_TEST( testAddInvalidPath );
Packit 8c9aa0
  CPPUNIT_TEST( testRemoveTests );
Packit 8c9aa0
  CPPUNIT_TEST( testRemoveTest );
Packit 8c9aa0
  CPPUNIT_TEST_EXCEPTION( testRemoveTestThrow1, std::out_of_range );
Packit 8c9aa0
  CPPUNIT_TEST_EXCEPTION( testRemoveTestThrow2, std::out_of_range );
Packit 8c9aa0
  CPPUNIT_TEST( testUp );
Packit 8c9aa0
  CPPUNIT_TEST_EXCEPTION( testUpThrow, std::out_of_range );
Packit 8c9aa0
  CPPUNIT_TEST( testInsert );
Packit 8c9aa0
  CPPUNIT_TEST( testInsertAtEnd );
Packit 8c9aa0
  CPPUNIT_TEST_EXCEPTION( testInsertThrow1, std::out_of_range );
Packit 8c9aa0
  CPPUNIT_TEST_EXCEPTION( testInsertThrow2, std::out_of_range );
Packit 8c9aa0
  CPPUNIT_TEST( testInsertPath );
Packit 8c9aa0
  CPPUNIT_TEST_EXCEPTION( testInsertPathThrow, std::out_of_range );
Packit 8c9aa0
  CPPUNIT_TEST( testInsertPathDontThrowIfInvalid );
Packit 8c9aa0
  CPPUNIT_TEST( testRootConstructor );
Packit 8c9aa0
  CPPUNIT_TEST( testPathSliceConstructorCopyUntilEnd );
Packit 8c9aa0
  CPPUNIT_TEST( testPathSliceConstructorCopySpecifiedCount );
Packit 8c9aa0
  CPPUNIT_TEST( testPathSliceConstructorCopyNone );
Packit 8c9aa0
  CPPUNIT_TEST( testPathSliceConstructorNegativeIndex );
Packit 8c9aa0
  CPPUNIT_TEST( testPathSliceConstructorAfterEndIndex );
Packit 8c9aa0
  CPPUNIT_TEST( testPathSliceConstructorNegativeIndexUntilEnd );
Packit 8c9aa0
  CPPUNIT_TEST( testPathSliceConstructorNegativeIndexNone );
Packit 8c9aa0
  CPPUNIT_TEST( testToStringNoTest );
Packit 8c9aa0
  CPPUNIT_TEST( testToStringOneTest );
Packit 8c9aa0
  CPPUNIT_TEST( testToStringHierarchy );
Packit 8c9aa0
  CPPUNIT_TEST( testPathStringConstructorRoot );
Packit 8c9aa0
  CPPUNIT_TEST( testPathStringConstructorEmptyIsRoot );
Packit 8c9aa0
  CPPUNIT_TEST( testPathStringConstructorHierarchy );
Packit 8c9aa0
  CPPUNIT_TEST_EXCEPTION( testPathStringConstructorBadRootThrow, std::invalid_argument );
Packit 8c9aa0
  CPPUNIT_TEST( testPathStringConstructorRelativeRoot );
Packit 8c9aa0
  CPPUNIT_TEST( testPathStringConstructorRelativeRoot2 );
Packit 8c9aa0
  CPPUNIT_TEST_EXCEPTION( testPathStringConstructorThrow1, std::invalid_argument );
Packit 8c9aa0
  CPPUNIT_TEST( testPathStringConstructorRelativeHierarchy );
Packit 8c9aa0
  CPPUNIT_TEST_EXCEPTION( testPathStringConstructorBadRelativeHierarchyThrow, std::invalid_argument );
Packit 8c9aa0
  CPPUNIT_TEST_SUITE_END();
Packit 8c9aa0
Packit 8c9aa0
public:
Packit 8c9aa0
  /*! Constructs a TestPathTest object.
Packit 8c9aa0
   */
Packit 8c9aa0
  TestPathTest();
Packit 8c9aa0
Packit 8c9aa0
  /// Destructor.
Packit 8c9aa0
  virtual ~TestPathTest();
Packit 8c9aa0
Packit 8c9aa0
  void setUp();
Packit 8c9aa0
  void tearDown();
Packit 8c9aa0
Packit 8c9aa0
  void testDefaultConstructor();
Packit 8c9aa0
  void testAddTest();
Packit 8c9aa0
  void testGetTestAtThrow1();
Packit 8c9aa0
  void testGetTestAtThrow2();
Packit 8c9aa0
  void testGetChildTest();
Packit 8c9aa0
  void testGetChildTestManyTests();
Packit 8c9aa0
  void testGetChildTestThrowIfNotValid();
Packit 8c9aa0
Packit 8c9aa0
  void testAddPath();
Packit 8c9aa0
  void testAddInvalidPath();
Packit 8c9aa0
Packit 8c9aa0
  void testRemoveTests();
Packit 8c9aa0
  void testRemoveTest();
Packit 8c9aa0
  void testRemoveTestThrow1();
Packit 8c9aa0
  void testRemoveTestThrow2();
Packit 8c9aa0
  void testUp();
Packit 8c9aa0
  void testUpThrow();
Packit 8c9aa0
Packit 8c9aa0
  void testInsert();
Packit 8c9aa0
  void testInsertAtEnd();
Packit 8c9aa0
  void testInsertThrow1();
Packit 8c9aa0
  void testInsertThrow2();
Packit 8c9aa0
Packit 8c9aa0
  void testInsertPath();
Packit 8c9aa0
  void testInsertPathThrow();
Packit 8c9aa0
  void testInsertPathDontThrowIfInvalid();
Packit 8c9aa0
Packit 8c9aa0
  void testRootConstructor();
Packit 8c9aa0
  void testPathSliceConstructorCopyUntilEnd();
Packit 8c9aa0
  void testPathSliceConstructorCopySpecifiedCount();
Packit 8c9aa0
  void testPathSliceConstructorCopyNone();
Packit 8c9aa0
  void testPathSliceConstructorNegativeIndex();
Packit 8c9aa0
  void testPathSliceConstructorAfterEndIndex();
Packit 8c9aa0
  void testPathSliceConstructorNegativeIndexUntilEnd();
Packit 8c9aa0
  void testPathSliceConstructorNegativeIndexNone();
Packit 8c9aa0
Packit 8c9aa0
  void testToStringNoTest();
Packit 8c9aa0
  void testToStringOneTest();
Packit 8c9aa0
  void testToStringHierarchy();
Packit 8c9aa0
Packit 8c9aa0
  void testPathStringConstructorRoot();
Packit 8c9aa0
  void testPathStringConstructorEmptyIsRoot();
Packit 8c9aa0
  void testPathStringConstructorHierarchy();
Packit 8c9aa0
  void testPathStringConstructorBadRootThrow();
Packit 8c9aa0
  void testPathStringConstructorRelativeRoot();
Packit 8c9aa0
  void testPathStringConstructorRelativeRoot2();
Packit 8c9aa0
  void testPathStringConstructorThrow1();
Packit 8c9aa0
  void testPathStringConstructorRelativeHierarchy();
Packit 8c9aa0
  void testPathStringConstructorBadRelativeHierarchyThrow();
Packit 8c9aa0
Packit 8c9aa0
private:
Packit 8c9aa0
  /// Prevents the use of the copy constructor.
Packit 8c9aa0
  TestPathTest( const TestPathTest &copy );
Packit 8c9aa0
Packit 8c9aa0
  /// Prevents the use of the copy operator.
Packit 8c9aa0
  void operator =( const TestPathTest &copy );
Packit 8c9aa0
Packit 8c9aa0
private:
Packit 8c9aa0
  CPPUNIT_NS::TestPath *m_path;
Packit 8c9aa0
  CPPUNIT_NS::TestCase *m_test1;
Packit 8c9aa0
  CPPUNIT_NS::TestCase *m_test2;
Packit 8c9aa0
  CPPUNIT_NS::TestCase *m_test3;
Packit 8c9aa0
  CPPUNIT_NS::TestCase *m_test4;
Packit 8c9aa0
  CPPUNIT_NS::TestSuite *m_suite1;
Packit 8c9aa0
  CPPUNIT_NS::TestSuite *m_suite2;
Packit 8c9aa0
  CPPUNIT_NS::TestCase *m_testSuite2a;
Packit 8c9aa0
  CPPUNIT_NS::TestCase *m_testSuite2b;
Packit 8c9aa0
};
Packit 8c9aa0
Packit 8c9aa0
Packit 8c9aa0
Packit 8c9aa0
#endif  // TESTPATHTEST_H