diff --git a/test/core/dap_common_test.c b/test/core/dap_common_test.c new file mode 100644 index 0000000000000000000000000000000000000000..cfc733974fafc1f54351c7a92337ffdf44bc9820 --- /dev/null +++ b/test/core/dap_common_test.c @@ -0,0 +1,13 @@ +#include "dap_common_test.h" + +void test_put_int() { + const int INT_VAL = 10; + const char * EXPECTED_RESULT = "10"; + char * result_arr = itoa(INT_VAL); + assert(strcmp(result_arr, EXPECTED_RESULT) == 0 && "test_put_int failed"); +} + +void dap_common_test_run() { + printf("Start running dap_common_test\n"); + test_put_int(); +} diff --git a/test/core/dap_common_test.h b/test/core/dap_common_test.h new file mode 100644 index 0000000000000000000000000000000000000000..00959ed03798809630a519497a974fb1bac50331 --- /dev/null +++ b/test/core/dap_common_test.h @@ -0,0 +1,9 @@ +#pragma once +#include "dap_common.h" +#include "assert.h" +#include "stdbool.h" +#include "stdlib.h" +#include "stdio.h" +#include "string.h" + +extern void dap_common_test_run(void); diff --git a/test/core/main.c b/test/core/main.c index 17a9c612d16e98c8cb8e4131d4b828fd2f260a4b..083a475e2e496e8db65755f70495a7076717e332 100755 --- a/test/core/main.c +++ b/test/core/main.c @@ -1,8 +1,10 @@ #include "dap_config_test.h" +#include "dap_common_test.h" #include "dap_common.h" int main(void) { // switch off debug info from library set_log_level(L_CRITICAL); dap_config_tests_run(); + dap_common_test_run(); } diff --git a/test/core/test_headers.h b/test/core/test_headers.h index 5b9b6df475c2ccdd82539047f0eeaf6c8fdd029c..f7f04d65666e5455e162964fb71d2b705c30285c 100755 --- a/test/core/test_headers.h +++ b/test/core/test_headers.h @@ -1,3 +1,4 @@ #pragma once #include "dap_config_test.h" +#include "dap_common_test.h"