mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-10-18 03:45:04 +00:00
added cmocka version
This commit is contained in:
1 parent
3da2d5e046
commit
a2758b2183
12 files changed
+285
No files matched your search
@@ -0,0 +1,6 @@
|
||||
project(sample-cmocka C)
|
||||
|
||||
add_cmocka_test(sample_test
|
||||
SOURCES sample_test.c
|
||||
LINK_LIBRARIES src cmocka-static)
|
||||
add_cmocka_test_environment(add_test)
|
||||
@@ -0,0 +1,24 @@
|
||||
#include <stdarg.h>
|
||||
#include <setjmp.h>
|
||||
#include <stddef.h>
|
||||
#include "cmocka.h"
|
||||
|
||||
#include "GildedRose.h"
|
||||
|
||||
static void test_rose(void **state)
|
||||
{
|
||||
Item items[1];
|
||||
init_item(items, "foo", 0, 0);
|
||||
update_quality(items, 1);
|
||||
|
||||
assert_string_equal("fixme", items[0].name);
|
||||
}
|
||||
|
||||
int main(void) {
|
||||
const struct CMUnitTest tests[] =
|
||||
{
|
||||
cmocka_unit_test(test_rose),
|
||||
};
|
||||
|
||||
return cmocka_run_group_tests(tests, NULL, NULL);
|
||||
}
|
||||
Reference in new issue
Block a user