📄 group__rcunit__write__test__suitecunit__test__suite__begin.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=gb2312"><title>RCUnit: Rcunit_write_test_suiteCUNIT_TEST_SUITE_BEGIN</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- 制作者 Doxygen 1.4.2 --><div class="qindex"><a class="qindex" href="index.html">首页</a> | <a class="qindex" href="modules.html">模块</a> | <a class="qindex" href="annotated.html">数据结构</a> | <a class="qindex" href="dirs.html">目录</a> | <a class="qindex" href="files.html">文件列表</a> | <a class="qindex" href="functions.html">数据字段</a> | <a class="qindex" href="globals.html">全局定义</a> | <a class="qindex" href="pages.html">相关页面</a></div><h1>Rcunit_write_test_suiteCUNIT_TEST_SUITE_BEGIN</h1><dl compact><dt><b>参数:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"><tt>[in]</tt> </td><td valign="top"><em>SuiteName</em> </td><td>测试集的名称。请直接写一个合法的C语言变量名作为测试集名称,而不需要用引号括起来。 </td></tr> </table></dl><dl compact><dt><b>使用方法:</b></dt><dd><div class="fragment"><pre class="fragment"> CUNIT_TEST_SUITE_BEGIN(MySuiteName); <span class="comment">// NOTE: write YourSuiteName directly without quote</span> CUNIT_HANDLE_SET_UP(MySetUpFunc); <span class="comment">// Execute this function before running the test cases in this suite</span> CUNIT_HANDLE_TEAR_DOWN(MyTearDownFunc); <span class="comment">// Execute this function after running the test cases in this suite</span> CUNIT_TEST(MyTestCase_Normal); <span class="comment">// My normal test case</span> CUNIT_TEST(MyTestCase_Abnormal); <span class="comment">// My abnormal test case</span> <span class="comment">// and so on...</span> CUNIT_TEST_SUITE_END(); CUNIT_DECL_TEST <span class="keywordtype">void</span> MySetUpFunc() { <span class="comment">// do something job before execute test case</span> <span class="comment">// e.g. reset global variants, alloc some resources...</span> } CUNIT_DECL_TEST <span class="keywordtype">void</span> MyTearDownFunc() { <span class="comment">// do something job after execute test case</span> <span class="comment">// e.g. free resources...</span> } CUNIT_DECL_TEST <span class="keywordtype">void</span> MyTestCase_Normal() { <span class="comment">// a normal case</span> <a class="code" href="rcunit__assert_8h.html#a0">CUNIT_ASSERT_EQUAL</a>(1, 1); <span class="comment">// just a sample</span> } CUNIT_DECL_TEST <span class="keywordtype">void</span> MyTestCase_Abnormal() { <span class="comment">// an abnormal case</span> <a class="code" href="rcunit__assert_8h.html#a0">CUNIT_ASSERT_EQUAL</a>(1, 2); <span class="comment">// just a sample</span> }</pre></div> </dd></dl><p><table border="0" cellpadding="0" cellspacing="0"><tr><td></td></tr></table><hr/><table width="100%"> <tr> <td align="right" valign="center"> 如果对 RCUnit 有任何的疑问或建议,请联系realdodo (<a href="mailto:realdodo@163.com">realdodo@163.com</a>)。 </td> </tr></table></body> </html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -