?? class_test_suite.html
字號:
<html><head><title>CppUnit - The Unit Testing Library</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body bgcolor="#ffffff"> <table width="100%"> <tr> <td width="40%" align="left" valign="center"> <a href="http://sourceforge.net/projects/cppunit"> CppUnit project page </a> </td> <td> <a href="FAQ">FAQ</a> </td> <td width="40%" align="right" valign="center"> <a href="http://cppunit.sourceforge.net">CppUnit home page</a> </td> </tr></table><hr><!-- Generated by Doxygen 1.3.7 --><div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="namespacemembers.html">Namespace Members</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="globals.html">File Members</a> | <a class="qindex" href="pages.html">Related Pages</a></div><h1>TestSuite Class Reference<br><small>[<a class="el" href="group___creating_test_suite.html">Creating TestSuite</a>]</small></h1>A Composite of Tests. <a href="#_details">More...</a><p><code>#include <<a class="el" href="_test_suite_8h-source.html">TestSuite.h</a>></code><p><p>Inheritance diagram for TestSuite:<p><center><img src="class_test_suite.png" usemap="#TestSuite_map" border="0" alt=""></center><map name="TestSuite_map"><area href="class_test_composite.html" alt="TestComposite" shape="rect" coords="0,56,164,80"><area href="class_test.html" alt="Test" shape="rect" coords="0,0,164,24"><area href="class_test_runner_1_1_wrapping_suite.html" alt="TestRunner::WrappingSuite" shape="rect" coords="0,168,164,192"></map><a href="class_test_suite-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0><tr><td></td></tr><tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top> </td><td class="memItemRight" valign=bottom><a class="el" href="class_test_suite.html#a0">TestSuite</a> (std::string name="")</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Default constructor. <a href="#a0"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top> </td><td class="memItemRight" valign=bottom><a class="el" href="class_test_suite.html#a1">~TestSuite</a> ()</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Destructor. <a href="#a1"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="class_test_suite.html#a2">addTest</a> (<a class="el" href="class_test.html">Test</a> *test)</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Adds a test to the suite. <a href="#a2"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>const CppUnitVector< <a class="el" href="class_test.html">Test</a> * > & </td><td class="memItemRight" valign=bottom><a class="el" href="class_test_suite.html#a3">getTests</a> () const</td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="class_test_suite.html#a4">deleteContents</a> ()</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Deletes all tests in the suite. <a href="#a4"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>int </td><td class="memItemRight" valign=bottom><a class="el" href="class_test_suite.html#a5">getChildTestCount</a> () const</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the number of direct child of the test. <a href="#a5"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="class_test.html">Test</a> * </td><td class="memItemRight" valign=bottom><a class="el" href="class_test_suite.html#a6">doGetChildTestAt</a> (int index) const</td></tr><tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the child test of the specified valid index. <a href="#a6"></a><br><br></td></tr><tr><td colspan=2><br><h2>Private Attributes</h2></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>CppUnitVector< <a class="el" href="class_test.html">Test</a> * > </td><td class="memItemRight" valign=bottom><a class="el" href="class_test_suite.html#r0">m_tests</a></td></tr></table><hr><a name="_details"></a><h2>Detailed Description</h2>A Composite of Tests. <p>It runs a collection of test cases. Here is an example. <pre><div class="fragment"> CppUnit::TestSuite *suite= <span class="keyword">new</span> CppUnit::TestSuite(); suite->addTest(<span class="keyword">new</span> CppUnit::TestCaller<MathTest> ( <span class="stringliteral">"testAdd"</span>, testAdd)); suite->addTest(<span class="keyword">new</span> CppUnit::TestCaller<MathTest> ( <span class="stringliteral">"testDivideByZero"</span>, testDivideByZero));</div></pre>Note that <a class="el" href="class_test_suite.html">TestSuites assume lifetime control for any tests added to them. TestSuites do not register themselves in the TestRegistry. Test TestCaller </a><p><hr><h2>Constructor & Destructor Documentation</h2><a class="anchor" name="a0" doxytag="TestSuite::TestSuite" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> CPPUNIT_NS_BEGIN TestSuite::TestSuite </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">std::string </td> <td class="mdname1" valign="top" nowrap> <em>name</em> = <code>""</code> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Default constructor. <p>Constructs a test suite with the specified name. </td> </tr></table><a class="anchor" name="a1" doxytag="TestSuite::~TestSuite" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> TestSuite::~<a class="el" href="class_test_suite.html">TestSuite</a> </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Destructor. <p> </td> </tr></table><hr><h2>Member Function Documentation</h2><a class="anchor" name="a2" doxytag="TestSuite::addTest" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void TestSuite::addTest </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="class_test.html">Test</a> * </td> <td class="mdname1" valign="top" nowrap> <em>test</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Adds a test to the suite. <p>Adds the specified test to the suite. <dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td></td><td valign=top><em>test</em> </td><td><a class="el" href="class_test.html">Test</a> to add. Must not be <code>NULL</code>. </td></tr> </table></dl> </td> </tr></table><a class="anchor" name="a4" doxytag="TestSuite::deleteContents" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void TestSuite::deleteContents </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap><code> [virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Deletes all tests in the suite. <p>Destroys all the tests of the suite. </td> </tr></table><a class="anchor" name="a6" doxytag="TestSuite::doGetChildTestAt" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> <a class="el" href="class_test.html">Test</a> * TestSuite::doGetChildTestAt </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">int </td> <td class="mdname1" valign="top" nowrap> <em>index</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap> const<code> [virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Returns the child test of the specified valid index. <p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td></td><td valign=top><em>index</em> </td><td>Zero based valid index of the child test to return. </td></tr> </table></dl><dl compact><dt><b>Returns:</b></dt><dd>Pointer on the test. Never <code>NULL</code>. </dd></dl><p>Implements <a class="el" href="class_test.html#b1">Test</a>.<p>Reimplemented in <a class="el" href="class_test_runner_1_1_wrapping_suite.html#b0">TestRunner::WrappingSuite</a>. </td> </tr></table><a class="anchor" name="a5" doxytag="TestSuite::getChildTestCount" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> int TestSuite::getChildTestCount </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap> const<code> [virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Returns the number of direct child of the test. <p><p>Implements <a class="el" href="class_test.html#a3">Test</a>.<p>Reimplemented in <a class="el" href="class_test_runner_1_1_wrapping_suite.html#a1">TestRunner::WrappingSuite</a>. </td> </tr></table><a class="anchor" name="a3" doxytag="TestSuite::getTests" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> const CppUnitVector< <a class="el" href="class_test.html">Test</a> * > & TestSuite::getTests </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap> const</td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Returns the list of the tests (DEPRECATED). <p><dl compact><dt><b><a class="el" href="deprecated.html#_deprecated000010">Deprecated:</a></b></dt><dd>Use getChildTestCount() & getChildTestAt() of the <a class="el" href="class_test_composite.html">TestComposite</a> interface instead.</dd></dl><dl compact><dt><b>Returns:</b></dt><dd>Reference on a vector that contains the tests of the suite. </dd></dl> </td> </tr></table><hr><h2>Member Data Documentation</h2><a class="anchor" name="r0" doxytag="TestSuite::m_tests" ></a><p><table class="mdTable" width="100%" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> CppUnitVector<<a class="el" href="class_test.html">Test</a> *> <a class="el" href="class_test_suite.html#r0">TestSuite::m_tests</a><code> [private]</code> </td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p> </td> </tr></table><hr>The documentation for this class was generated from the following files:<ul><li><a class="el" href="_test_suite_8h-source.html">TestSuite.h</a><li><a class="el" href="_test_suite_8cpp.html">TestSuite.cpp</a></ul><hr><table width="100%"> <tr> <td width="10%" align="left" valign="center"> <a href="http://sourceforge.net"> <img src="http://sourceforge.net/sflogo.php?group_id=11795" width="88" height="31" border="0" alt="SourceForge Logo"></a> </td> <td width="20%" align="left" valign="center"> hosts this site. </td> <td> </td> <td align="right" valign="center"> Send comments to:<br> <a href="mailto:cppunit-devel@lists.sourceforge.net">CppUnit Developers</a> </td> </tr></table></body> </html>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -