CppUnit源码架构

CppUnit源码架构

ID:37657507

大小:99.57 KB

页数:10页

时间:2019-05-27

CppUnit源码架构_第1页
CppUnit源码架构_第2页
CppUnit源码架构_第3页
CppUnit源码架构_第4页
CppUnit源码架构_第5页
资源描述:

《CppUnit源码架构》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库

1、TestPathpublic:TestPath();/*构造一条无效的路径直到一个测试被add()添加!*/TestPath(Test*root);/*构造一条有效的路径,测试root被添加!*//*用其他路径的部分构造一条路径!从otherPath路径的indexFirst索引开始,顺序向后添加count个测试到本路径,如果count小于0,则添加otherPath的所有测试到本路径!*/TestPath(constTestPath&otherPath,intindexFirst,intcount=-1);/*从函数toStri

2、ng()返回的一个字符串路径分解一条路径!把字符串路径pathAsString分解成各个测试名,然后插入到searchRoot对应的路径中*/TestPath(Test*searchRoot,conststd::string&pathAsString);TestPath(constTestPath&other);virtual~TestPath();virtualboolisValid()const;/*路径至少包含一个测试是有效的!*/virtualvoidadd(Test*test);/*添加一个测试到路径!*/virtual

3、voidadd(constTestPath&path);/*添加路径path的测试到本路径!*/virtualvoidinsert(Test*test,intindex);/*在索引index位置插入测试!*//*在索引index位置插入路径path的所有测试!*/virtualvoidinsert(constTestPath&path,intindex);virtualvoidremoveTests();/*删除路径上所有的测试,路径变成无效的!*/virtualvoidremoveTest(intindex);/*删除路径中具

4、体索引index的测试!*/virtualvoidup();/*删除最后一个的测试!*/virtualintgetTestCount()const;/*返回路径中测试的总数目!*/virtualTest*getTestAt(intindex)const;/*返回路径中索引index的测试!*/virtualTest*getChildTest()const;/*返回路径中层次最底层的测试!*//*返回路径字符串!例如:一个路径包含三个名字为"AllTests"、"Math"和"Math::testAdd"的测试,调用此函数将返回:"

5、/AllTests/Math/Math::testAdd"*/virtualstd::stringtoString()const;TestPath&operator=(constTestPath&other);protected:voidcheckIndexValid(intindex)const;/*检查测试索引index在有效的范围内!*/typedefCppUnitDequePathTestNames;/*分离路径字符串成它的测试名成分,将各个测试名字符串放到队列testNames中!例如:path

6、AsString为:"/AllTests/Math/Math::testAdd",则调用此函数后,testNames[0]=“AllTests“,testNames[1]=“Math“,testNames[2]=“Math::testAdd“*/boolsplitPathString(conststd::string&pathAsString,PathTestNames&testNames);/*查找路径字符串的实际根(第一个测试名)和得到路径字符串名字成分!*/Test*findActualRoot(Test*searchRoo

7、t,conststd::string&pathAsString,PathTestNames&testNames);typedefCppUnitDequeTests;Testsm_tests;Testpublic:virtual~Test();virtualvoidrun(TestResult*result)=0;/*运行测试,收集结果!*/virtualintcountTestCases()const=0;/*返回被run()调用的测试用例的数目!*//*返回测试的直接孩子(直接子测试包)的数目!*/virtuali

8、ntgetChildTestCount()const=0;/*返回具体索引为index的测试孩子(测试包)的地址!*/virtualTest*getChildTestAt(intindex)const;virtualstd::stringgetNa

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。