unit-tests: Fix test_chunk_eq() if arguments have side-effects
[strongswan.git] / src / libstrongswan / tests / test_suite.h
index 66c6846..97c1b42 100644 (file)
@@ -298,7 +298,7 @@ void test_fail_if_worker_failed();
        chunk_t _a = (chunk_t)a; \
        chunk_t _b = (chunk_t)b; \
        test_fail_if_worker_failed(); \
-       if (_a.len != _b.len || !memeq(a.ptr, b.ptr, a.len)) \
+       if (_a.len != _b.len || !memeq(_a.ptr, _b.ptr, _a.len)) \
        { \
                test_fail_msg(__FILE__, __LINE__, \
                                          #a " != " #b " (\"%#B\" != \"%#B\")", &_a, &_b); \