diff --git a/test/token.c b/test/token.c index a83466f..92a79e1 100644 --- a/test/token.c +++ b/test/token.c @@ -3,17 +3,22 @@ #include "../src/include/token.h" #include "registry.h" +#include "unity/unity_internals.h" -int test_token_init() { - UNITY_BEGIN(); +void test_token_init() { char* s = malloc(sizeof("Hello, world!")); s = "Hello, world!"; Token* t = token_init(TOKEN_TYPE_CALL, s); TEST_ASSERT_EQUAL(TOKEN_TYPE_CALL, t->type); TEST_ASSERT_EQUAL_STRING("Hello, world!", t->val); +} + +int test_token() { + UNITY_BEGIN(); + RUN_TEST(test_token_init); return UNITY_END(); } __attribute__((constructor)) void register_tests_token() { - register_test(test_token_init); + register_test(test_token); } diff --git a/test/util.c b/test/util.c index 737c660..0268bee 100644 --- a/test/util.c +++ b/test/util.c @@ -2,13 +2,17 @@ #include "registry.h" #include "unity/unity.h" -int test_is_even() { - UNITY_BEGIN(); - TEST_ASSERT_EQUAL(0, is_even(1)); +void test_is_even() { + TEST_ASSERT_EQUAL(0, is_even(1));; TEST_ASSERT_EQUAL(1, is_even(2)); +} + +int test_util() { + UNITY_BEGIN(); + RUN_TEST(test_is_even); return UNITY_END(); } __attribute__((constructor)) void register_tests_util() { - register_test(test_is_even); + register_test(test_util); }