test: buffer: Replace memcpy to memcpy_s

Introduced change resolve checkpach issue related with edited lines
of code.

Signed-off-by: Karol Trzcinski <karolx.trzcinski@linux.intel.com>
This commit is contained in:
Karol Trzcinski 2020-01-23 10:44:56 +01:00 committed by Daniel Baluta
parent a40175724f
commit f493e907a1
2 changed files with 4 additions and 4 deletions

View File

@ -33,7 +33,7 @@ static void test_audio_buffer_write_fill_10_bytes_and_write_5(void **state)
uint8_t bytes[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; uint8_t bytes[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
memcpy(buf->stream.w_ptr, &bytes, 10); memcpy_s(buf->stream.w_ptr, test_buf_desc.size, &bytes, 10);
comp_update_buffer_produce(buf, 10); comp_update_buffer_produce(buf, 10);
assert_int_equal(buf->stream.avail, 10); assert_int_equal(buf->stream.avail, 10);
@ -42,7 +42,7 @@ static void test_audio_buffer_write_fill_10_bytes_and_write_5(void **state)
uint8_t more_bytes[5] = {10, 11, 12, 13, 14}; uint8_t more_bytes[5] = {10, 11, 12, 13, 14};
memcpy(buf->stream.w_ptr, &more_bytes, 5); memcpy_s(buf->stream.w_ptr, test_buf_desc.size, &more_bytes, 5);
comp_update_buffer_produce(buf, 5); comp_update_buffer_produce(buf, 5);
uint8_t ref_1[5] = {5, 6, 7, 8, 9}; uint8_t ref_1[5] = {5, 6, 7, 8, 9};

View File

@ -34,7 +34,7 @@ static void test_audio_buffer_write_10_bytes_out_of_256_and_read_back
uint8_t bytes[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; uint8_t bytes[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
memcpy(buf->stream.w_ptr, &bytes, 10); memcpy_s(buf->stream.w_ptr, test_buf_desc.size, &bytes, 10);
comp_update_buffer_produce(buf, 10); comp_update_buffer_produce(buf, 10);
assert_int_equal(buf->stream.avail, 10); assert_int_equal(buf->stream.avail, 10);
@ -69,7 +69,7 @@ static void test_audio_buffer_fill_10_bytes(void **state)
uint8_t bytes[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; uint8_t bytes[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
memcpy(buf->stream.w_ptr, &bytes, 10); memcpy_s(buf->stream.w_ptr, test_buf_desc.size, &bytes, 10);
comp_update_buffer_produce(buf, 10); comp_update_buffer_produce(buf, 10);
assert_int_equal(buf->stream.avail, 10); assert_int_equal(buf->stream.avail, 10);