updated to use cpputest

This commit is contained in:
jakeg00dwin 2024-03-06 21:18:46 -08:00
parent 7004b260d3
commit 43d3312d8e
1 changed files with 29 additions and 16 deletions

View File

@ -1,18 +1,31 @@
#include <stdarg.h>
#include <stddef.h>
#include <stdint.h>
#include <setjmp.h>
#include <cmocka.h>
/* A test case that does nothing and succeeds. */
static void null_test_success(void **state) {
(void) state; /* unused */
}
int main(void)
/*
* Author: username
* Date: todays_date
* filename: test_module_name.c
* description: module_purpose
*/
#include "CppUTest/CommandLineTestRunner.h"
#include "module_name.h"
TEST_GROUP(FirstTestGroup)
{
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);
}