From: Martin Willi Date: Tue, 14 Apr 2015 09:20:50 +0000 (+0200) Subject: WIP: debug memxor() test failure X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b01ad12ad1e70d9446ef56eb3b676bc1f40bdce5;p=thirdparty%2Fstrongswan.git WIP: debug memxor() test failure On x86 using GCC 4.8.1, the memxor_aligned test fails when not reading from "ca" after the last test. Also, the failure occurs only when doing the 16-bit aligned test before the 8-bit aligned test. So either our inlining memxor() does something wrong, or something else is screwed. --- diff --git a/src/libstrongswan/tests/suites/test_utils.c b/src/libstrongswan/tests/suites/test_utils.c index 9839445634..ce5f24922c 100644 --- a/src/libstrongswan/tests/suites/test_utils.c +++ b/src/libstrongswan/tests/suites/test_utils.c @@ -291,18 +291,19 @@ START_TEST(test_memxor_aligned) /* 32-bit aligned source */ a = 0; memxor(ca.ptr, cb.ptr + 4, 4); - ck_assert(chunk_equals(ca, chunk_from_chars(0x05, 0x06, 0x07, 0x08, - 0x00, 0x00, 0x00, 0x00))); + ck_assert(chunk_equals(ca, + chunk_from_chars(0x05, 0x06, 0x07, 0x08, 0x00, 0x00, 0x00, 0x00))); /* 16-bit aligned source */ a = 0; memxor(ca.ptr, cb.ptr + 2, 6); - ck_assert(chunk_equals(ca, chunk_from_chars(0x03, 0x04, 0x05, 0x06, - 0x07, 0x08, 0x00, 0x00))); + ck_assert(chunk_equals(ca, + chunk_from_chars(0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x00, 0x00))); /* 8-bit aligned source */ a = 0; memxor(ca.ptr, cb.ptr + 1, 7); - ck_assert(chunk_equals(ca, chunk_from_chars(0x02, 0x03, 0x04, 0x05, - 0x06, 0x07, 0x08, 0x00))); + ck_assert_msg(chunk_equals(ca, + chunk_from_chars(0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x00)), + "%016llX", a); } END_TEST