# HG changeset patch # User Olaf Wintermann # Date 1457715987 -3600 # Node ID 2df780a4482b60a5061a374b9a28e564139acd93 # Parent b20d6088795c8d4ba8d8e32fa5e5a2b42ef3e4b2 fixed misaligned memory access in test_ucx_buffer_write diff -r b20d6088795c -r 2df780a4482b test/buffer_tests.c --- a/test/buffer_tests.c Fri Feb 26 16:33:04 2016 +0100 +++ b/test/buffer_tests.c Fri Mar 11 18:06:27 2016 +0100 @@ -381,15 +381,19 @@ UCX_TEST_ASSERT(memcmp(buffer, " test string7\0\0", 18) == 0, "incorrect buffer content (test string)"); + r = ucx_buffer_write(".", 1, 1, b); + UCX_TEST_ASSERT(r == 1, "returned incorrect number of written elements"); + UCX_TEST_ASSERT(b->pos == 16, "incorrect position"); + int32_t testarr[4] = {0x09abcdef, 0x05fedcba, 0x01abefcd, 0x3cd07ab}; r = ucx_buffer_write(testarr, 4, 4, b); UCX_TEST_ASSERT(r = 4, "returned incorrect number of written elements"); - UCX_TEST_ASSERT(b->pos == 31, "incorrect position"); + UCX_TEST_ASSERT(b->pos == 32, "incorrect position"); char cmp[32]; memset(cmp, 0, 32); - memcpy(cmp, " test string", 15); - int32_t *ptr = (int32_t*) (cmp+15); + memcpy(cmp, " test string.", 16); + int32_t *ptr = (int32_t*) (cmp+16); ptr[0] = testarr[0]; ptr[1] = testarr[1]; ptr[2] = testarr[2]; diff -r b20d6088795c -r 2df780a4482b test/mpool_tests.c --- a/test/mpool_tests.c Fri Feb 26 16:33:04 2016 +0100 +++ b/test/mpool_tests.c Fri Mar 11 18:06:27 2016 +0100 @@ -26,7 +26,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ -#include +#include #include "mpool_tests.h"