updated to use cpputest
This commit is contained in:
parent
7004b260d3
commit
43d3312d8e
|
@ -1,18 +1,31 @@
|
||||||
#include <stdarg.h>
|
/*
|
||||||
#include <stddef.h>
|
* Author: username
|
||||||
#include <stdint.h>
|
* Date: todays_date
|
||||||
#include <setjmp.h>
|
* filename: test_module_name.c
|
||||||
#include <cmocka.h>
|
* description: module_purpose
|
||||||
|
*/
|
||||||
/* A test case that does nothing and succeeds. */
|
|
||||||
static void null_test_success(void **state) {
|
#include "CppUTest/CommandLineTestRunner.h"
|
||||||
(void) state; /* unused */
|
#include "module_name.h"
|
||||||
}
|
|
||||||
|
TEST_GROUP(FirstTestGroup)
|
||||||
int main(void)
|
|
||||||
{
|
{
|
||||||
const struct CMUnitTest tests[] = {
|
|
||||||
cmocka_unit_test(null_test_success),
|
};
|
||||||
};
|
|
||||||
return cmocka_run_group_tests(tests, NULL, NULL);
|
TEST(FirstTestGroup, FirstTest)
|
||||||
|
{
|
||||||
|
FAIL("Fail me!");
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(FirstTestGroup, SecondTest)
|
||||||
|
{
|
||||||
|
STRCMP_EQUAL("hello", "world");
|
||||||
|
LONGS_EQUAL(1, 2);
|
||||||
|
CHECK(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int ac, char** av)
|
||||||
|
{
|
||||||
|
return CommandLineTestRunner::RunAllTests(ac, av);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue