Skip to content

Commit e39d072

Browse files
mrajwatlauda
authored andcommitted
CMOCKA-KPB: perform copy test and its verification
Signed-off-by: Marcin Rajwa <marcin.rajwa@linux.intel.com>
1 parent e696749 commit e39d072

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

test/cmocka/src/audio/kpb/kpb_buffer.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,17 +228,30 @@ static void kpb_test_buffer_real_time_stream(void **state)
228228
{
229229
struct comp_buffer *source_test;
230230
struct comp_buffer *sink_test;
231+
int ret;
232+
struct test_case *test_case_data = (struct test_case *)*state;
231233

232234
source_test = list_first_item(&kpb_dev_mock->bsource_list,
233235
struct comp_buffer,
234236
sink_list);
235237
sink_test = list_first_item(&kpb_dev_mock->bsink_list,
236238
struct comp_buffer,
237239
source_list);
238-
/*Verify if we fetched proper sink and source */
240+
241+
/* Verify if we fetched proper sink and source */
239242
assert_ptr_equal(source, source_test);
240243
assert_ptr_equal(sink, sink_test);
241244

245+
/* Perform kpb_copy test */
246+
ret = kpb_drv_mock.ops.copy(kpb_dev_mock);
247+
248+
assert_int_equal(ret, 0);
249+
250+
/* Verify if source was copied to sink */
251+
assert_memory_equal(source_data,
252+
sink_data,
253+
test_case_data->period_bytes);
254+
242255
}
243256

244257
/* Always successful test */

0 commit comments

Comments
 (0)