# HG changeset patch # User Olaf Wintermann # Date 1376489269 -7200 # Node ID e974640ec4e03dacda6cfca8246d8cf0e7ef7a04 # Parent b6dcc9d112ebe8fb4e3425ab6cd109b507388e1f fixed utils tests diff -r b6dcc9d112eb -r e974640ec4e0 test/utils_tests.c --- a/test/utils_tests.c Wed Aug 14 15:54:22 2013 +0200 +++ b/test/utils_tests.c Wed Aug 14 16:07:49 2013 +0200 @@ -47,12 +47,16 @@ "wrong content in b1 after second fprintf"); ucx_fprintf(b2, (write_func)ucx_buffer_write, "%s%s", teststr1, teststr2); + UCX_TEST_ASSERT(b2->pos == 2046, "wrong length"); UCX_TEST_ASSERT(!memcmp(b2->space, teststr1, 1023), "wrong first half in b2"); UCX_TEST_ASSERT(!memcmp(b2->space+1023, teststr2, 1023), "wrong second half in b2"); UCX_TEST_END + + ucx_buffer_free(b1); + ucx_buffer_free(b2); } UCX_TEST(test_ucx_asprintf) { @@ -71,10 +75,13 @@ free(s1.ptr); sstr_t s2 = ucx_asprintf(a, "%s%s", teststr1, teststr2); + UCX_TEST_ASSERT(s2.ptr, "s2.ptr is NULL"); + UCX_TEST_ASSERT(s2.length == 2046, "wrong length"); UCX_TEST_ASSERT(!memcmp(s2.ptr, teststr1, 1023), "wrong first half in s2"); UCX_TEST_ASSERT(!memcmp(s2.ptr+1023, teststr2, 1023), "wrong second half in s2"); + free(s2.ptr); UCX_TEST_END }