Chinaunix首页 | 论坛 | 博客
  • 博客访问: 215600
  • 博文数量: 70
  • 博客积分: 2050
  • 博客等级: 大尉
  • 技术积分: 700
  • 用 户 组: 普通用户
  • 注册时间: 2006-07-15 21:42
文章分类

全部博文(70)

文章存档

2013年(1)

2011年(5)

2010年(3)

2009年(9)

2008年(17)

2007年(6)

2006年(29)

我的朋友

分类: C/C++

2008-07-12 18:40:33

/* 参考便利的开发工具CppUnit快速使用指南 */

#include
#include

class hello: public CppUnit::TestFixture
{
    CPPUNIT_TEST_SUITE(hello);
    CPPUNIT_TEST(foo);
    CPPUNIT_TEST(bar);
    CPPUNIT_TEST_SUITE_END();
    public:
        void foo()
        {
            CPPUNIT_ASSERT_EQUAL_MESSAGE("CPPUNIT_ASSERT_MESSAGE", 1, 2);
            CPPUNIT_ASSERT("foo" == 0);
        }
        void bar()
        {
            puts("bar");
        }
};

class world: public hello
{
    CPPUNIT_TEST_SUITE(world);
    CPPUNIT_TEST(foo);
    CPPUNIT_TEST(bar);
    CPPUNIT_TEST_SUITE_END();
};

CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(hello, "生克乘侮");
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(world, "生克乘侮");

#include
#include

int main(void)
{
    CppUnit::TextUi::TestRunner runner;

    CppUnit::TestFactoryRegistry ®istry = CppUnit::TestFactoryRegistry::getRegistry("生克乘侮");
    runner.addTest(registry.makeTest());
    runner.run();

    return 0;
}
文件:cppunit-1.12.1.tar.gz
大小:744KB
下载:下载

阅读(1112) | 评论(0) | 转发(0) |
0

上一篇:bt track server interact

下一篇:dump tcp only

给主人留下些什么吧!~~