]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
WIP: debug memxor() test failure memxor-tuning
authorMartin Willi <martin@revosec.ch>
Tue, 14 Apr 2015 09:20:50 +0000 (11:20 +0200)
committerMartin Willi <martin@revosec.ch>
Wed, 15 Apr 2015 09:41:56 +0000 (11:41 +0200)
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.

src/libstrongswan/tests/suites/test_utils.c

index 9839445634198daa31d33b9db7f5dcffc3a124bb..ce5f24922c266f3f23b9daadfa68353dbb8c93a6 100644 (file)
@@ -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