⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 class_test_case.html

📁 c++开发的一个不错的工具
💻 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&nbsp;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&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="namespacemembers.html">Namespace&nbsp;Members</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a></div><h1>TestCase Class Reference</h1>A single test object.  <a href="#_details">More...</a><p><code>#include &lt;<a class="el" href="_test_case_8h-source.html">TestCase.h</a>&gt;</code><p><p>Inheritance diagram for TestCase:<p><center><img src="class_test_case.png" usemap="#TestCase_map" border="0" alt=""></center><map name="TestCase_map"><area href="class_test_leaf.html" alt="TestLeaf" shape="rect" coords="158,56,465,80"><area href="class_test_fixture.html" alt="TestFixture" shape="rect" coords="475,56,782,80"><area href="class_test.html" alt="Test" shape="rect" coords="158,0,465,24"><area href="class_orthodox.html" alt="Orthodox< ClassUnderTest >" shape="rect" coords="0,168,307,192"><area href="class_test_caller.html" alt="TestCaller< Fixture >" shape="rect" coords="317,168,624,192"><area href="class_test_case_decorator.html" alt="TestCaseDecorator" shape="rect" coords="634,168,941,192"><area href="class_exception_test_case_decorator.html" alt="ExceptionTestCaseDecorator< ExpectedException >" shape="rect" coords="634,224,941,248"></map><a href="class_test_case-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>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="class_test_case.html#a0">TestCase</a> (const std::string &amp;name)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructs a test case.  <a href="#a0"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="class_test_case.html#a1">TestCase</a> ()</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructs a test case for a suite.  <a href="#a1"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="class_test_case.html#a2">~TestCase</a> ()</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Destructs a test case.  <a href="#a2"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>virtual void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="class_test_case.html#a3">run</a> (<a class="el" href="class_test_result.html">TestResult</a> *result)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Run the test and catch any exceptions that are triggered by it.  <a href="#a3"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>std::string&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="class_test_case.html#a4">getName</a> () const</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the name of the test case.  <a href="#a4"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>virtual void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="class_test_case.html#a5">runTest</a> ()</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">FIXME: this should probably be pure virtual.  <a href="#a5"></a><br><br></td></tr><tr><td colspan=2><br><h2>Private Member Functions</h2></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="class_test_case.html#d0">TestCase</a> (const <a class="el" href="class_test_case.html">TestCase</a> &amp;other)</td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="class_test_case.html">TestCase</a> &amp;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="class_test_case.html#d1">operator=</a> (const <a class="el" href="class_test_case.html">TestCase</a> &amp;other)</td></tr><tr><td colspan=2><br><h2>Private Attributes</h2></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>const std::string&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="class_test_case.html#r0">m_name</a></td></tr></table><hr><a name="_details"></a><h2>Detailed Description</h2>A single test object. <p>This class is used to implement a simple test case: define a subclass that overrides the runTest method.<p>You don't usually need to use that class, but <a class="el" href="class_test_fixture.html">TestFixture</a> and <a class="el" href="class_test_caller.html">TestCaller</a> instead.<p>You are expected to subclass TestCase is you need to write a class similiar to <a class="el" href="class_test_caller.html">TestCaller</a>. <p><hr><h2>Constructor &amp; Destructor Documentation</h2><a class="anchor" name="a0" doxytag="TestCase::TestCase" ></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"> TestCase::TestCase           </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">const std::string &amp;&nbsp;</td>          <td class="mdname1" valign="top" nowrap> <em>name</em>          </td>          <td class="md" valign="top">&nbsp;)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Constructs a test case. <p><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td></td><td valign=top><em>name</em>&nbsp;</td><td>the name of the TestCase. </td></tr>  </table></dl>    </td>  </tr></table><a class="anchor" name="a1" doxytag="TestCase::TestCase" ></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"> TestCase::TestCase           </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="mdname1" valign="top" nowrap>          </td>          <td class="md" valign="top">&nbsp;)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Constructs a test case for a suite. <p><dl compact><dt><b><a class="el" href="deprecated.html#_deprecated000005">Deprecated:</a></b></dt><dd>This constructor was used by fixture when <a class="el" href="class_test_fixture.html">TestFixture</a> did not exist. Have your fixture inherits <a class="el" href="class_test_fixture.html">TestFixture</a> instead of TestCase.</dd></dl>    </td>  </tr></table><a class="anchor" name="a2" doxytag="TestCase::~TestCase" ></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"> TestCase::~<a class="el" href="class_test_case.html">TestCase</a>           </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="mdname1" valign="top" nowrap>          </td>          <td class="md" valign="top">&nbsp;)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Destructs a test case. <p>    </td>  </tr></table><a class="anchor" name="d0" doxytag="TestCase::TestCase" ></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"> TestCase::TestCase           </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">const <a class="el" href="class_test_case.html">TestCase</a> &amp;&nbsp;</td>          <td class="mdname1" valign="top" nowrap> <em>other</em>          </td>          <td class="md" valign="top">&nbsp;)&nbsp;</td>          <td class="md" nowrap><code> [private]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>    </td>  </tr></table><hr><h2>Member Function Documentation</h2><a class="anchor" name="a4" doxytag="TestCase::getName" ></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"> std::string TestCase::getName           </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="mdname1" valign="top" nowrap>          </td>          <td class="md" valign="top">&nbsp;)&nbsp;</td>          <td class="md" nowrap> const<code> [virtual]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Returns the name of the test case. <p><p>Implements <a class="el" href="class_test.html#a5">Test</a>.<p>Reimplemented in <a class="el" href="class_test_case_decorator.html#a2">TestCaseDecorator</a>.    </td>  </tr></table><a class="anchor" name="d1" doxytag="TestCase::operator=" ></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_case.html">TestCase</a>&amp; TestCase::operator=           </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">const <a class="el" href="class_test_case.html">TestCase</a> &amp;&nbsp;</td>          <td class="mdname1" valign="top" nowrap> <em>other</em>          </td>          <td class="md" valign="top">&nbsp;)&nbsp;</td>          <td class="md" nowrap><code> [private]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>    </td>  </tr></table><a class="anchor" name="a3" doxytag="TestCase::run" ></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 TestCase::run           </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top"><a class="el" href="class_test_result.html">TestResult</a> *&nbsp;</td>          <td class="mdname1" valign="top" nowrap> <em>result</em>          </td>          <td class="md" valign="top">&nbsp;)&nbsp;</td>          <td class="md" nowrap><code> [virtual]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Run the test and catch any exceptions that are triggered by it. <p><p>Implements <a class="el" href="class_test.html#a1">Test</a>.    </td>  </tr></table><a class="anchor" name="a5" doxytag="TestCase::runTest" ></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 TestCase::runTest           </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="mdname1" valign="top" nowrap>          </td>          <td class="md" valign="top">&nbsp;)&nbsp;</td>          <td class="md" nowrap><code> [virtual]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>FIXME: this should probably be pure virtual. <p><p>Reimplemented in <a class="el" href="class_exception_test_case_decorator.html#a1">ExceptionTestCaseDecorator&lt; ExpectedException &gt;</a>, <a class="el" href="class_orthodox.html#b1">Orthodox&lt; ClassUnderTest &gt;</a>, <a class="el" href="class_test_case_decorator.html#a5">TestCaseDecorator</a>, and <a class="el" href="class_test_caller.html#a4">TestCaller&lt; Fixture &gt;</a>.    </td>  </tr></table><hr><h2>Member Data Documentation</h2><a class="anchor" name="r0" doxytag="TestCase::m_name" ></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 std::string <a class="el" href="class_test_case.html#r0">TestCase::m_name</a><code> [private]</code>          </td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </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_case_8h-source.html">TestCase.h</a><li><a class="el" href="_test_case_8cpp.html">TestCase.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>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -