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

📄 class_test_path.html

📁 c++开发的一个不错的工具
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<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>TestPath Class Reference<br><small>[<a class="el" href="group___executing_test.html">Executing test</a>]</small></h1>A List of <a class="el" href="class_test.html">Test</a> representing a path to access a <a class="el" href="class_test.html">Test</a>.  <a href="#_details">More...</a><p><code>#include &lt;<a class="el" href="_test_path_8h-source.html">TestPath.h</a>&gt;</code><p><a href="class_test_path-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_path.html#a0">TestPath</a> ()</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructs an invalid path.  <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_path.html#a1">TestPath</a> (<a class="el" href="class_test.html">Test</a> *root)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructs a valid path.  <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_path.html#a2">TestPath</a> (const <a class="el" href="class_test_path.html">TestPath</a> &amp;otherPath, int indexFirst, int count=-1)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Constructs a path using a slice of another path.  <a href="#a2"></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_path.html#a3">TestPath</a> (<a class="el" href="class_test.html">Test</a> *searchRoot, const std::string &amp;pathAsString)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Resolves a path from a string returned by toString().  <a href="#a3"></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_path.html#a4">TestPath</a> (const <a class="el" href="class_test_path.html">TestPath</a> &amp;other)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Copy constructor.  <a href="#a4"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>virtual&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="class_test_path.html#a5">~TestPath</a> ()</td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>virtual bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="class_test_path.html#a6">isValid</a> () const</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Tests if the path contains at least one test.  <a href="#a6"></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_path.html#a7">add</a> (<a class="el" href="class_test.html">Test</a> *test)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Adds a test to the path.  <a href="#a7"></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_path.html#a8">add</a> (const <a class="el" href="class_test_path.html">TestPath</a> &amp;path)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Adds all the tests of the specified path.  <a href="#a8"></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_path.html#a9">insert</a> (<a class="el" href="class_test.html">Test</a> *test, int index)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Inserts a test at the specified index.  <a href="#a9"></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_path.html#a10">insert</a> (const <a class="el" href="class_test_path.html">TestPath</a> &amp;path, int index)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Inserts all the tests at the specified path at a given index.  <a href="#a10"></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_path.html#a11">removeTests</a> ()</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Removes all the test from the path.  <a href="#a11"></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_path.html#a12">removeTest</a> (int index)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Removes the test at the specified index of the path.  <a href="#a12"></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_path.html#a13">up</a> ()</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Removes the last test.  <a href="#a13"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>virtual int&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="class_test_path.html#a14">getTestCount</a> () const</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the number of tests in the path.  <a href="#a14"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>virtual <a class="el" href="class_test.html">Test</a> *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="class_test_path.html#a15">getTestAt</a> (int index) const</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the test of the specified index.  <a href="#a15"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>virtual <a class="el" href="class_test.html">Test</a> *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="class_test_path.html#a16">getChildTest</a> () const</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the last test of the path.  <a href="#a16"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>virtual std::string&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="class_test_path.html#a17">toString</a> () const</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the path as a string.  <a href="#a17"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="class_test_path.html">TestPath</a> &amp;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="class_test_path.html#a18">operator=</a> (const <a class="el" href="class_test_path.html">TestPath</a> &amp;other)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Assignment operator.  <a href="#a18"></a><br><br></td></tr><tr><td colspan=2><br><h2>Protected Types</h2></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>typedef CppUnitDeque&lt; std::string &gt;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="class_test_path.html#x0">PathTestNames</a></td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A list of test names.  <a href="#x0"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>typedef CppUnitDeque&lt; <a class="el" href="class_test.html">Test</a> * &gt;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="class_test_path.html#x1">Tests</a></td></tr><tr><td colspan=2><br><h2>Protected Member Functions</h2></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="class_test_path.html#b0">checkIndexValid</a> (int index) const</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Checks that the specified test index is within valid range.  <a href="#b0"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top>bool&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="class_test_path.html#b1">splitPathString</a> (const std::string &amp;pathAsString, <a class="el" href="class_test_path.html#x0">PathTestNames</a> &amp;testNames)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Splits a path string into its test name components.  <a href="#b1"></a><br><br></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="class_test.html">Test</a> *&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="class_test_path.html#b2">findActualRoot</a> (<a class="el" href="class_test.html">Test</a> *searchRoot, const std::string &amp;pathAsString, <a class="el" href="class_test_path.html#x0">PathTestNames</a> &amp;testNames)</td></tr><tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Finds the actual root of a path string and get the path string name components.  <a href="#b2"></a><br><br></td></tr><tr><td colspan=2><br><h2>Protected Attributes</h2></td></tr><tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="class_test_path.html#x1">Tests</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="class_test_path.html#p0">m_tests</a></td></tr></table><hr><a name="_details"></a><h2>Detailed Description</h2>A List of <a class="el" href="class_test.html">Test</a> representing a path to access a <a class="el" href="class_test.html">Test</a>. <p>The path can be converted to a string and resolved from a string with toString() and <a class="el" href="class_test_path.html#a3">TestPath( Test *root, const std::string &amp;pathAsString )</a>.<p>Pointed tests are not owned by the class.<p><dl compact><dt><b>See also:</b></dt><dd>Test::resolvedTestPath() </dd></dl><p><hr><h2>Member Typedef Documentation</h2><a class="anchor" name="x0" doxytag="TestPath::PathTestNames" ></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"> typedef CppUnitDeque&lt;std::string&gt; <a class="el" href="class_test_path.html#x0">TestPath::PathTestNames</a><code> [protected]</code>          </td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>A list of test names. <p>    </td>  </tr></table><a class="anchor" name="x1" doxytag="TestPath::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"> typedef CppUnitDeque&lt;<a class="el" href="class_test.html">Test</a> *&gt; <a class="el" href="class_test_path.html#x1">TestPath::Tests</a><code> [protected]</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>Constructor &amp; Destructor Documentation</h2><a class="anchor" name="a0" doxytag="TestPath::TestPath" ></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 TestPath::TestPath           </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 an invalid path. <p>The path is invalid until a test is added with add().     </td>  </tr></table><a class="anchor" name="a1" doxytag="TestPath::TestPath" ></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"> TestPath::TestPath           </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top"><a class="el" href="class_test.html">Test</a> *&nbsp;</td>          <td class="mdname1" valign="top" nowrap> <em>root</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 valid path. <p><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td></td><td valign=top><em>root</em>&nbsp;</td><td><a class="el" href="class_test.html">Test</a> to add. </td></tr>  </table></dl>    </td>  </tr></table><a class="anchor" name="a2" doxytag="TestPath::TestPath" ></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"> TestPath::TestPath           </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">const <a class="el" href="class_test_path.html">TestPath</a> &amp;&nbsp;</td>          <td class="mdname" nowrap> <em>otherPath</em>, </td>        </tr>        <tr>          <td class="md" nowrap align="right"></td>          <td></td>          <td class="md" nowrap>int&nbsp;</td>          <td class="mdname" nowrap> <em>indexFirst</em>, </td>        </tr>        <tr>          <td class="md" nowrap align="right"></td>          <td></td>          <td class="md" nowrap>int&nbsp;</td>          <td class="mdname" nowrap> <em>count</em> = <code>-1</code></td>        </tr>        <tr>          <td></td>          <td class="md">)&nbsp;</td>          <td class="md" colspan="2"></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Constructs a path using a slice of another path. <p><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td></td><td valign=top><em>otherPath</em>&nbsp;</td><td>Path the test are copied from. </td></tr>    <tr><td></td><td valign=top><em>indexFirst</em>&nbsp;</td><td>Zero based index of the first test to copy. Adjusted to be in valid range. <em>count</em> is adjusted with <em>indexFirst</em>. </td></tr>    <tr><td></td><td valign=top><em>count</em>&nbsp;</td><td>Number of tests to copy. If &lt; 0 then all test starting from index <em>indexFirst</em> are copied. </td></tr>  </table></dl>    </td>  </tr></table><a class="anchor" name="a3" doxytag="TestPath::TestPath" ></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"> TestPath::TestPath           </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top"><a class="el" href="class_test.html">Test</a> *&nbsp;</td>          <td class="mdname" nowrap> <em>searchRoot</em>, </td>        </tr>        <tr>          <td class="md" nowrap align="right"></td>          <td></td>          <td class="md" nowrap>const std::string &amp;&nbsp;</td>          <td class="mdname" nowrap> <em>pathAsString</em></td>        </tr>        <tr>          <td></td>          <td class="md">)&nbsp;</td>          <td class="md" colspan="2"></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Resolves a path from a string returned by toString(). <p>If <em>pathAsString</em> is an absolute path (begins with '/'), then the first test name of the path must be the name of <em>searchRoot</em>. Otherwise, <em>pathAsString</em> is a relative path, and the first test found using Test::findTest() matching the first test name is used as root. An empty string resolve to a path containing <em>searchRoot</em>.<p>The resolved path is always valid.<p><dl compact><dt><b>Parameters:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td></td><td valign=top><em>searchRoot</em>&nbsp;</td><td><a class="el" href="class_test.html">Test</a> used to resolve the path. </td></tr>    <tr><td></td><td valign=top><em>pathAsString</em>&nbsp;</td><td>String that contains the path as a string created by toString(). </td></tr>  </table></dl><dl compact><dt><b>Exceptions:</b></dt><dd>  <table border="0" cellspacing="2" cellpadding="0">    <tr><td></td><td valign=top><em>std::invalid_argument</em>&nbsp;</td><td>if one of the test names can not be resolved. </td></tr>  </table></dl><dl compact><dt><b>See also:</b></dt><dd>toString(). </dd></dl>    </td>  </tr></table><a class="anchor" name="a4" doxytag="TestPath::TestPath" ></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"> TestPath::TestPath           </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">const <a class="el" href="class_test_path.html">TestPath</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></td>        </tr>      </table>    </td>  </tr></table>

⌨️ 快捷键说明

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