Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions regression/test-c-gen/array1/test.desc
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
CORE
main.c
--function fun --cover branch --gen-c-test-case
--function fun --cover branch --gen-c-test-case unity
^EXIT=0$
^SIGNAL=0$
^#include <assert\.h>$
^#include <stdio\.h>$
^#include "unity\.h"$
^#include <stdlib\.h>$

^#include "main\.c"$
^int test_main(int argc, char\* argv)$
^\{$
^ signed int \* arg_fun_array = ((signed int \*)NULL);$

^void fun_000()$
^ signed int \* arg_fun_array = ((signed int \*)NULL);$
^void fun_001()$
^ signed int arg_fun_array\[\] = {1, 2, 3, 4, 5};$

^ signed int ret_fun;$
^ ret_fun = fun();$
^ TEST_ASSERT_EQUAL_INT32(7, ret_fun);$

^ assert(ret_fun == 7);$
^ exit(0);$
^\}$
^ return 0;$
^int test_main(int argc, char\* argv)$
^\{$
^ UNITY_BEGIN();$
^ RUN_TEST(fun_000);$
^ RUN_TEST(fun_001);$
^ int result = UNITY_END();$
^ exit(result);$
^ return result;$
^\}$


Expand Down
25 changes: 14 additions & 11 deletions regression/test-c-gen/array2/test.desc
Original file line number Diff line number Diff line change
@@ -1,26 +1,29 @@
CORE
main.c
--function fun --cover branch --gen-c-test-case
--function fun --cover branch --gen-c-test-case unity
^EXIT=0$
^SIGNAL=0$
^#include <assert\.h>$
^#include <stdio\.h>$
^#include "unity\.h"$
^#include <stdlib\.h>$

^#include "main\.c"$
^int test_main(int argc, char\* argv)$
^\{$
^ signed int \* arg_fun_array = ((signed int \*)NULL);$

^void fun_000()$
^ signed int \* arg_fun_array = ((signed int \*)NULL);$
^void fun_001()$
^ signed int arg_fun_array\[\] = {1, 2, 3, 4, 5};$

^ signed int ret_fun;$
^ ret_fun = fun();$
^ TEST_ASSERT_EQUAL_INT32(7, ret_fun);$

^ assert(ret_fun == 7);$
^ exit(0);$
^\}$
^ return 0;$
^int test_main(int argc, char\* argv)$
^\{$
^ UNITY_BEGIN();$
^ RUN_TEST(fun_000);$
^ RUN_TEST(fun_001);$
^ int result = UNITY_END();$
^ exit(result);$
^ return result;$
^\}$


Expand Down
21 changes: 14 additions & 7 deletions regression/test-c-gen/cover1/test.desc
Original file line number Diff line number Diff line change
@@ -1,20 +1,27 @@
CORE
main.c
--function fun --cover branch --gen-c-test-case
--function fun --cover branch --gen-c-test-case unity
^EXIT=0$
^SIGNAL=0$
^#include <assert\.h>$
^#include <stdio\.h>$
^#include "unity\.h"$
^#include <stdlib\.h>$

^#include "main\.c"$
^int test_main(int argc, char\* argv)$
^\{$

^void fun_000()$
^ signed int arg_fun_a = 1;$
^void fun_001()$
^ signed int arg_fun_a = -2147483648;$
^ fun(arg_fun_a);$
^ exit(0);$
^ return 0;$

^int test_main(int argc, char\* argv)$
^\{$
^ UNITY_BEGIN();$
^ RUN_TEST(fun_000);$
^ RUN_TEST(fun_001);$
^ int result = UNITY_END();$
^ exit(result);$
^ return result;$
^\}$
--
^warning: ignoring
21 changes: 13 additions & 8 deletions regression/test-c-gen/function_call1/test.desc
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
CORE
main.c
--function fun --cover branch --gen-c-test-case
--function fun --cover branch --gen-c-test-case unity
^EXIT=0$
^SIGNAL=0$
^#include <assert\.h>$
^#include <stdio\.h>$
^#include "unity\.h"$
^#include <stdlib\.h>$

^#include "main\.c"$
^int test_main(int argc, char\* argv)$
^\{$

^void fun_000()$
^ signed int ret_fun;$
^ ret_fun = fun();$
^ assert(ret_fun == 4)
^ exit(0);$
^ return 0;$
^ TEST_ASSERT_EQUAL_INT32(4, ret_fun);$

^int test_main(int argc, char\* argv)$
^\{$
^ UNITY_BEGIN();$
^ RUN_TEST(fun_000);$
^ int result = UNITY_END();$
^ exit(result);$
^ return result;$
^\}$
--
^warning: ignoring
25 changes: 16 additions & 9 deletions regression/test-c-gen/function_call2/test.desc
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
CORE
main.c
--function fun --cover branch --gen-c-test-case
--function fun --cover branch --gen-c-test-case unity
^EXIT=0$
^SIGNAL=0$
^#include <assert\.h>$
^#include <stdio\.h>$
^#include "unity\.h"$
^#include <stdlib\.h>$

^#include "main\.c"$
^int test_main(int argc, char\* argv)$
^\{$

^void fun_000()$
^ signed int ret_fun;$
^ ret_fun = fun();$
^ assert(ret_fun == 1);$
^ assert(ret_fun == -1);$
^ exit(0);$
^ return 0;$
^ TEST_ASSERT_EQUAL_INT32(1, ret_fun)$
^void fun_001()$
^ TEST_ASSERT_EQUAL_INT32(-1, ret_fun)$

^int test_main(int argc, char\* argv)$
^\{$
^ UNITY_BEGIN();$
^ RUN_TEST(fun_000);$
^ RUN_TEST(fun_001);$
^ int result = UNITY_END();$
^ exit(result);$
^ return result;$
^\}$
--
^warning: ignoring
16 changes: 10 additions & 6 deletions regression/test-c-gen/local_variable1/test.desc
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
CORE
main.c
--function fun --cover branch --gen-c-test-case
--function fun --cover branch --gen-c-test-case unity
^EXIT=0$
^SIGNAL=0$
^#include <assert\.h>$
^#include <stdio\.h>$
^#include "unity\.h"$
^#include <stdlib\.h>$

^void fun_000()$
^ fun();$

^#include "main\.c"$
^int test_main(int argc, char\* argv)$
^\{$
^ fun();$
^ exit(0);$
^ return 0;$
^ UNITY_BEGIN();$
^ RUN_TEST(fun_000);$
^ int result = UNITY_END();$
^ exit(result);$
^ return result;$
^\}$


Expand Down
21 changes: 12 additions & 9 deletions regression/test-c-gen/main_call1/test.desc
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
CORE
main.c
--function main --cover branch --gen-c-test-case
--function main --cover branch --gen-c-test-case unity
^EXIT=0$
^SIGNAL=0$
^#include <assert\.h>$
^#include <stdio\.h>$
^#include "unity\.h"$
^#include <stdlib\.h>$

^#include "main\.c"$
^int test_main(int argc, char\* argv)$
^\{$

^void fun_000()$
^ signed int arg_main_argc = 4098;$
^ char \*\*arg_main_params = ((char \*\*)NULL);$
^ signed int ret_main;$
^ ret_main = main(arg_main_argc, arg_main_params);$
^ TEST_ASSERT_EQUAL_INT32(45, ret_main);$

^ assert(ret_main == 45);$
^ exit(0);$
^\}$
^ return 0;$
^int test_main(int argc, char\* argv)$
^\{$
^ UNITY_BEGIN();$
^ RUN_TEST(fun_000);$
^ int result = UNITY_END();$
^ exit(result);$
^ return result;$
^\}$


Expand Down
27 changes: 15 additions & 12 deletions regression/test-c-gen/pointer1/test.desc
Original file line number Diff line number Diff line change
@@ -1,28 +1,31 @@
CORE
main.c
--function fun --cover branch --gen-c-test-case
--function fun --cover branch --gen-c-test-case unity
^EXIT=0$
^SIGNAL=0$
^#include <assert\.h>$
^#include <stdio\.h>$
^#include "unity\.h"$
^#include <stdlib\.h>$

^#include "main\.c"$
^int test_main(int argc, char\* argv)$
^\{$
^ signed int \* arg_fun_ptr_x = ((signed int \*)NULL);$

^void fun_000()$
^ signed int \* arg_fun_ptr_x = ((signed int \*)NULL);$
^void fun_001()$
^ signed int \* arg_fun_ptr_x = ((signed int \*)malloc(sizeof(signed int)));$
^ *arg_fun_ptr_x = -1;$

^ signed int ret_fun;$
^ ret_fun = fun();$
^ TEST_ASSERT_EQUAL_INT32(4, ret_fun);$
^ TEST_ASSERT_EQUAL_INT32(0, ret_fun);$

^ assert(ret_fun == 4);$

^ assert(ret_fun == 0);$
^ exit(0);$
^ return 0;$
^int test_main(int argc, char\* argv)$
^\{$
^ UNITY_BEGIN();$
^ RUN_TEST(fun_000);$
^ RUN_TEST(fun_001);$
^ int result = UNITY_END();$
^ exit(result);$
^ return result;$
^\}$


Expand Down
21 changes: 13 additions & 8 deletions regression/test-c-gen/return1/test.desc
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
CORE
main.c
--function fun --cover branch --gen-c-test-case
--function fun --cover branch --gen-c-test-case unity
^EXIT=0$
^SIGNAL=0$
^#include <assert\.h>$
^#include <stdio\.h>$
^#include "unity\.h"$
^#include <stdlib\.h>$

^#include "main\.c"$
^int test_main(int argc, char\* argv)$
^\{$

^void fun_000()$
^ signed int ret_fun;
^ ret_fun = fun();$
^ assert(ret_fun == 5);$
^ exit(0);$
^ return 0;$
^ TEST_ASSERT_EQUAL_INT32(5, ret_fun);$

^int test_main(int argc, char\* argv)$
^\{$
^ UNITY_BEGIN();$
^ RUN_TEST(fun_000);$
^ int result = UNITY_END();$
^ exit(result);$
^ return result;$
^\}$
--
^warning: ignoring
23 changes: 14 additions & 9 deletions regression/test-c-gen/return2/test.desc
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
CORE
main.c
--function fun --cover branch --gen-c-test-case
--function fun --cover branch --gen-c-test-case unity
^EXIT=0$
^SIGNAL=0$
^#include <assert\.h>$
^#include <stdio\.h>$
^#include "unity\.h"$
^#include <stdlib\.h>$

^#include "main\.c"$
^int test_main(int argc, char\* argv)$
^\{$

^void fun_000()$
^ struct example_s ret_fun;
^ ret_fun = fun();$
^ assert(ret_fun.b == 1);$
^ assert(ret_fun.x == 4);$
^ exit(0);$
^ return 0;$
^ TEST_ASSERT_TRUE(ret_fun.b);$
^ TEST_ASSERT_EQUAL_INT32(4, ret_fun.x);$

^int test_main(int argc, char\* argv)$
^\{$
^ UNITY_BEGIN();$
^ RUN_TEST(fun_000);$
^ int result = UNITY_END();$
^ exit(result);$
^ return result;$
^\}$
--
^warning: ignoring
2 changes: 1 addition & 1 deletion regression/test-c-gen/return3/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ struct example_s
struct example_s fun()
{
struct nested_struct my_nest = { .y = 3.14159f };
struct example_s return_var = { .b = true, .x = 4, .internal = my_nest };
struct example_s return_var = { .b = false, .x = 4, .internal = my_nest };
return return_var;
}
Loading