没有任何数据可供显示
开源项目社区 | 当前位置 : |
|
www.trustie.net/open_source_projects | 主页 > 开源项目社区 > tinytest |
tinytest
|
0 | 0 | 3 |
贡献者 | 讨论 | 代码提交 |
概述
Simple unit testing for c/c++This is as simple and easy to use unit testing as it gets. It consists of a single header file. It won't displace cppunit and boost::test, but it is enough to quickly write and run your test cases.
A c sample
#include
#include
#include "tinytest.h"
int t1(void)
{
int* p = NULL;
TINYTEST_ASSERT(!p);
TINYTEST_ASSERT(!printf(""));
return 1; // Always return a value different than 0 at test end.
}
int t2(void)
{
int* x = (int*)malloc(sizeof(int));
TINYTEST_ASSERT(x);
free(x);
return 1; // Always return a value different than 0 at test end.
}
TINYTEST_START_SUITE(SimpleSuite);
TINYTEST_ADD_TEST(t1);
TINYTEST_ADD_TEST(t2);
TINYTEST_END_SUITE();
TINYTEST_MAIN_SINGLE_SUITE(SimpleSuite);
创建时间:2014-05-11 14:42