diff --git a/test/cmocka/CMakeLists.txt b/test/cmocka/CMakeLists.txt index b260c1411..5747a1219 100644 --- a/test/cmocka/CMakeLists.txt +++ b/test/cmocka/CMakeLists.txt @@ -67,6 +67,10 @@ function(cmocka_test test_name) target_link_libraries(${test_name} PRIVATE cmocka) target_link_libraries(${test_name} PRIVATE sof_options) target_compile_definitions(${test_name} PRIVATE -DCHECK) + + # Cmocka requires this define for stdint.h that defines uintptr + target_compile_definitions(${test_name} PRIVATE -D_UINTPTR_T_DEFINED) + add_test(NAME ${test_name} COMMAND xt-run --exit_with_target_code ${test_name}) endfunction() diff --git a/test/cmocka/src/audio/buffer/buffer_copy.c b/test/cmocka/src/audio/buffer/buffer_copy.c index 6a9dea367..5cb5f74d0 100644 --- a/test/cmocka/src/audio/buffer/buffer_copy.c +++ b/test/cmocka/src/audio/buffer/buffer_copy.c @@ -37,6 +37,7 @@ #include #include #include +#include #include static void test_audio_buffer_copy_underrun(void **state) diff --git a/test/cmocka/src/audio/buffer/buffer_new.c b/test/cmocka/src/audio/buffer/buffer_new.c index 4c5cb5b1d..f73510da3 100644 --- a/test/cmocka/src/audio/buffer/buffer_new.c +++ b/test/cmocka/src/audio/buffer/buffer_new.c @@ -37,6 +37,7 @@ #include #include #include +#include #include static void test_audio_buffer_new(void **state) diff --git a/test/cmocka/src/audio/buffer/buffer_wrap.c b/test/cmocka/src/audio/buffer/buffer_wrap.c index aae5b030b..5db3f0cf3 100644 --- a/test/cmocka/src/audio/buffer/buffer_wrap.c +++ b/test/cmocka/src/audio/buffer/buffer_wrap.c @@ -37,6 +37,7 @@ #include #include #include +#include #include static void test_audio_buffer_write_fill_10_bytes_and_write_5(void **state) diff --git a/test/cmocka/src/audio/buffer/buffer_write.c b/test/cmocka/src/audio/buffer/buffer_write.c index 47e45c7e1..7e4d25f4b 100644 --- a/test/cmocka/src/audio/buffer/buffer_write.c +++ b/test/cmocka/src/audio/buffer/buffer_write.c @@ -37,6 +37,7 @@ #include #include #include +#include #include static void test_audio_buffer_write_10_bytes_out_of_256_and_read_back diff --git a/test/cmocka/src/audio/component/comp_set_state.c b/test/cmocka/src/audio/component/comp_set_state.c index 45b044843..42084413b 100644 --- a/test/cmocka/src/audio/component/comp_set_state.c +++ b/test/cmocka/src/audio/component/comp_set_state.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include diff --git a/test/cmocka/src/audio/kpb/kpb_buffer.c b/test/cmocka/src/audio/kpb/kpb_buffer.c index 252630229..98d6899f9 100644 --- a/test/cmocka/src/audio/kpb/kpb_buffer.c +++ b/test/cmocka/src/audio/kpb/kpb_buffer.c @@ -33,8 +33,8 @@ #include #include #include -#include #include +#include #include #include diff --git a/test/cmocka/src/audio/kpb/kpb_mock.c b/test/cmocka/src/audio/kpb/kpb_mock.c index 6a1e1deb9..5cda63f04 100644 --- a/test/cmocka/src/audio/kpb/kpb_mock.c +++ b/test/cmocka/src/audio/kpb/kpb_mock.c @@ -1,6 +1,7 @@ #include #include #include +#include #include #include diff --git a/test/cmocka/src/audio/mixer/mixer_test.c b/test/cmocka/src/audio/mixer/mixer_test.c index 97b4a9cac..1bb55781b 100644 --- a/test/cmocka/src/audio/mixer/mixer_test.c +++ b/test/cmocka/src/audio/mixer/mixer_test.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include diff --git a/test/cmocka/src/audio/mixer/mock.c b/test/cmocka/src/audio/mixer/mock.c index 1746e987b..c96e1f426 100644 --- a/test/cmocka/src/audio/mixer/mock.c +++ b/test/cmocka/src/audio/mixer/mock.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include diff --git a/test/cmocka/src/audio/selector/selector_test.c b/test/cmocka/src/audio/selector/selector_test.c index 3941d715e..42549b824 100644 --- a/test/cmocka/src/audio/selector/selector_test.c +++ b/test/cmocka/src/audio/selector/selector_test.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include "selector.h" diff --git a/test/cmocka/src/audio/volume/volume_process.c b/test/cmocka/src/audio/volume/volume_process.c index 1d34d75d5..0bac7d62c 100644 --- a/test/cmocka/src/audio/volume/volume_process.c +++ b/test/cmocka/src/audio/volume/volume_process.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include "volume.h" diff --git a/test/cmocka/src/debugability/macros.c b/test/cmocka/src/debugability/macros.c index 68d4a50b9..63d05ca41 100644 --- a/test/cmocka/src/debugability/macros.c +++ b/test/cmocka/src/debugability/macros.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -70,7 +71,7 @@ static void test_debugability_macros_declare_log_entry(void **state) "(6 << 24)" "1" "1" - "53" + "54" "sizeof(\"" __FILE__ "\")" "sizeof(\"Message\")" "\"" __FILE__ "\"" diff --git a/test/cmocka/src/lib/lib/rstrcmp.c b/test/cmocka/src/lib/lib/rstrcmp.c index 267c5bb00..f582d04ac 100644 --- a/test/cmocka/src/lib/lib/rstrcmp.c +++ b/test/cmocka/src/lib/lib/rstrcmp.c @@ -32,6 +32,7 @@ #include #include +#include #include static void test_lib_lib_rstrcmp_for_a_and_a_equals_0(void **state) diff --git a/test/cmocka/src/lib/lib/rstrlen.c b/test/cmocka/src/lib/lib/rstrlen.c index 419d5c629..d79c6a5a6 100644 --- a/test/cmocka/src/lib/lib/rstrlen.c +++ b/test/cmocka/src/lib/lib/rstrlen.c @@ -32,6 +32,7 @@ #include #include +#include #include static void test_lib_lib_rstrlen_for_empty_str_equals_0(void **state) diff --git a/test/cmocka/src/lib/lib/strcheck.c b/test/cmocka/src/lib/lib/strcheck.c index d821ecea9..040b4786f 100644 --- a/test/cmocka/src/lib/lib/strcheck.c +++ b/test/cmocka/src/lib/lib/strcheck.c @@ -31,6 +31,7 @@ #include #include +#include #include #include diff --git a/test/cmocka/src/lib/preproc/concat.c b/test/cmocka/src/lib/preproc/concat.c index e6be1f3ea..46404deb6 100644 --- a/test/cmocka/src/lib/preproc/concat.c +++ b/test/cmocka/src/lib/preproc/concat.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include diff --git a/test/cmocka/src/lib/preproc/defer.c b/test/cmocka/src/lib/preproc/defer.c index 205ba5c26..8babf0618 100644 --- a/test/cmocka/src/lib/preproc/defer.c +++ b/test/cmocka/src/lib/preproc/defer.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include diff --git a/test/cmocka/src/lib/preproc/get_arg.c b/test/cmocka/src/lib/preproc/get_arg.c index 3e6bae417..3c76405da 100644 --- a/test/cmocka/src/lib/preproc/get_arg.c +++ b/test/cmocka/src/lib/preproc/get_arg.c @@ -32,6 +32,7 @@ #include #include +#include #include #include diff --git a/test/cmocka/src/lib/preproc/seq.c b/test/cmocka/src/lib/preproc/seq.c index 56caa7639..059ee3fbb 100644 --- a/test/cmocka/src/lib/preproc/seq.c +++ b/test/cmocka/src/lib/preproc/seq.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include diff --git a/test/cmocka/src/lib/preproc/varargs_count.c b/test/cmocka/src/lib/preproc/varargs_count.c index a00134aee..54cd93207 100644 --- a/test/cmocka/src/lib/preproc/varargs_count.c +++ b/test/cmocka/src/lib/preproc/varargs_count.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include diff --git a/test/cmocka/src/list/list_init.c b/test/cmocka/src/list/list_init.c index 5bd6f3ead..ae0d00891 100644 --- a/test/cmocka/src/list/list_init.c +++ b/test/cmocka/src/list/list_init.c @@ -33,6 +33,7 @@ #include #include #include +#include #include static void test_list_list_init_prev_equal_to_root(void **state) diff --git a/test/cmocka/src/list/list_is_empty.c b/test/cmocka/src/list/list_is_empty.c index 95aff3e4b..d6116c759 100644 --- a/test/cmocka/src/list/list_is_empty.c +++ b/test/cmocka/src/list/list_is_empty.c @@ -34,6 +34,7 @@ #include #include #include +#include #include static void test_list_list_is_empty_when_empty_then_true(void **state) diff --git a/test/cmocka/src/list/list_item.c b/test/cmocka/src/list/list_item.c index 5a62f24ba..3021600f2 100644 --- a/test/cmocka/src/list/list_item.c +++ b/test/cmocka/src/list/list_item.c @@ -34,6 +34,7 @@ #include #include #include +#include #include struct test_list_container { diff --git a/test/cmocka/src/list/list_item_append.c b/test/cmocka/src/list/list_item_append.c index 4fd4c66e9..d1a429f18 100644 --- a/test/cmocka/src/list/list_item_append.c +++ b/test/cmocka/src/list/list_item_append.c @@ -34,6 +34,7 @@ #include #include #include +#include #include struct test_data { diff --git a/test/cmocka/src/list/list_item_del.c b/test/cmocka/src/list/list_item_del.c index dfe6e6db7..efb146d78 100644 --- a/test/cmocka/src/list/list_item_del.c +++ b/test/cmocka/src/list/list_item_del.c @@ -34,6 +34,7 @@ #include #include #include +#include #include struct test_data { diff --git a/test/cmocka/src/list/list_item_is_last.c b/test/cmocka/src/list/list_item_is_last.c index 2e6bd0fd1..8be00bc20 100644 --- a/test/cmocka/src/list/list_item_is_last.c +++ b/test/cmocka/src/list/list_item_is_last.c @@ -34,6 +34,7 @@ #include #include #include +#include #include struct test_data { diff --git a/test/cmocka/src/list/list_item_prepend.c b/test/cmocka/src/list/list_item_prepend.c index 75c1e7620..869f46ba3 100644 --- a/test/cmocka/src/list/list_item_prepend.c +++ b/test/cmocka/src/list/list_item_prepend.c @@ -34,6 +34,7 @@ #include #include #include +#include #include struct test_data { diff --git a/test/cmocka/src/math/numbers/ceil_divide.c b/test/cmocka/src/math/numbers/ceil_divide.c index f20514e6e..de98d9a17 100644 --- a/test/cmocka/src/math/numbers/ceil_divide.c +++ b/test/cmocka/src/math/numbers/ceil_divide.c @@ -35,6 +35,7 @@ #include #include #include +#include #include static void test_math_numbers_ceil_divide(void **state) diff --git a/test/cmocka/src/math/numbers/find_equal_int16.c b/test/cmocka/src/math/numbers/find_equal_int16.c index 84e06de43..83167554f 100644 --- a/test/cmocka/src/math/numbers/find_equal_int16.c +++ b/test/cmocka/src/math/numbers/find_equal_int16.c @@ -33,6 +33,7 @@ #include #include #include +#include #include static void test_math_numbers_find_equal_int16_for_5_123_5_10_123_500_123_n_123_equals_1_4_and_6 diff --git a/test/cmocka/src/math/numbers/find_max_abs_int32.c b/test/cmocka/src/math/numbers/find_max_abs_int32.c index 1a882634e..cc0b81b0f 100644 --- a/test/cmocka/src/math/numbers/find_max_abs_int32.c +++ b/test/cmocka/src/math/numbers/find_max_abs_int32.c @@ -33,6 +33,7 @@ #include #include #include +#include #include static void test_math_numbers_find_max_abs_int32_for_neg100_99_98_50_equals_100 diff --git a/test/cmocka/src/math/numbers/find_min_int16.c b/test/cmocka/src/math/numbers/find_min_int16.c index 744ed12d3..b46888faf 100644 --- a/test/cmocka/src/math/numbers/find_min_int16.c +++ b/test/cmocka/src/math/numbers/find_min_int16.c @@ -33,6 +33,7 @@ #include #include #include +#include #include static void test_math_numbers_find_min_int16_for_2_equals_2(void **state) diff --git a/test/cmocka/src/math/numbers/gcd.c b/test/cmocka/src/math/numbers/gcd.c index dab9fa328..a872485a3 100644 --- a/test/cmocka/src/math/numbers/gcd.c +++ b/test/cmocka/src/math/numbers/gcd.c @@ -34,6 +34,7 @@ #include #include #include +#include #include static void test_math_numbers_gcd_for_5083_and_391_equals_391(void **state) diff --git a/test/cmocka/src/math/numbers/norm_int32.c b/test/cmocka/src/math/numbers/norm_int32.c index 5ffe33ecf..3a43f2058 100644 --- a/test/cmocka/src/math/numbers/norm_int32.c +++ b/test/cmocka/src/math/numbers/norm_int32.c @@ -33,6 +33,7 @@ #include #include #include +#include #include static void test_math_numbers_norm_int32_for_0_equals_31(void **state)