TestLeaf.h 921 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifndef CPPUNIT_TESTLEAF_H
  2. #define CPPUNIT_TESTLEAF_H
  3. #include <cppunit/Test.h>
  4. CPPUNIT_NS_BEGIN
  5. /*! \brief A single test object.
  6. *
  7. * Base class for single test case: a test that doesn't have any children.
  8. *
  9. */
  10. class CPPUNIT_API TestLeaf: public Test
  11. {
  12. public:
  13. /*! Returns 1 as the default number of test cases invoked by run().
  14. *
  15. * You may override this method when many test cases are invoked (RepeatedTest
  16. * for example).
  17. *
  18. * \return 1.
  19. * \see Test::countTestCases().
  20. */
  21. int countTestCases() const;
  22. /*! Returns the number of child of this test case: 0.
  23. *
  24. * You should never override this method: a TestLeaf as no children by definition.
  25. *
  26. * \return 0.
  27. */
  28. int getChildTestCount() const;
  29. /*! Always throws std::out_of_range.
  30. * \see Test::doGetChildTestAt().
  31. */
  32. Test *doGetChildTestAt( int index ) const;
  33. };
  34. CPPUNIT_NS_END
  35. #endif // CPPUNIT_TESTLEAF_H