From ebf406d084520676bc78f4bd5bf1d9754f832119 Mon Sep 17 00:00:00 2001 From: Jaska Uimonen Date: Tue, 11 Jun 2019 13:28:54 +0300 Subject: [PATCH] unit tests: fix cmocka test for pipeline connect cmocka pipeline connect unit test is checking the successful connection from frames count set in components. However the frames are not set in pipeline complete if we set the frames from stream parameters. So check now that the pipeline pointer has been set and matches the pipeline in high level test function. Signed-off-by: Jaska Uimonen --- .../audio/pipeline/pipeline_connect_upstream.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/test/cmocka/src/audio/pipeline/pipeline_connect_upstream.c b/test/cmocka/src/audio/pipeline/pipeline_connect_upstream.c index 65f10d0e1..975b002a2 100644 --- a/test/cmocka/src/audio/pipeline/pipeline_connect_upstream.c +++ b/test/cmocka/src/audio/pipeline/pipeline_connect_upstream.c @@ -84,11 +84,8 @@ static void test_audio_pipeline_complete_connect_downstream_variable_set /*Testing component*/ pipeline_complete(&result, test_data->first, test_data->second); - assert_int_equal - ( - result.sched_comp->frames, test_data->p.ipc_pipe.frames_per_sched - ); assert_ptr_equal(result.sched_comp->pipeline, &result); + assert_ptr_equal(test_data->first->pipeline, &result); } /*Test going downstream ignoring sink from other pipeline*/ @@ -171,10 +168,8 @@ static void test_audio_pipeline_complete_connect_downstream_full(void **state) /*Testing component*/ pipeline_complete(&result, test_data->first, test_data->second); - assert_int_equal(test_data->first->frames, - result.ipc_pipe.frames_per_sched); - assert_int_equal(test_data->second->frames, - result.ipc_pipe.frames_per_sched); + assert_ptr_equal(test_data->first->pipeline, &result); + assert_ptr_equal(test_data->second->pipeline, &result); } /*Test going upstream all the way*/ @@ -195,10 +190,8 @@ static void test_audio_pipeline_complete_connect_upstream_full(void **state) /*Testing component*/ pipeline_complete(&result, test_data->first, test_data->second); - assert_int_equal(test_data->first->frames, - result.ipc_pipe.frames_per_sched); - assert_int_equal(test_data->second->frames, - result.ipc_pipe.frames_per_sched); + assert_ptr_equal(test_data->first->pipeline, &result); + assert_ptr_equal(test_data->second->pipeline, &result); } /*Test going upstream all the way*/