unit-tests: Make test for bio_writer_t more portable
authorTobias Brunner <tobias@strongswan.org>
Fri, 11 Oct 2013 23:56:24 +0000 (01:56 +0200)
committerTobias Brunner <tobias@strongswan.org>
Thu, 17 Oct 2013 09:44:03 +0000 (11:44 +0200)
src/libstrongswan/tests/test_bio_writer.c

index 767f179..665cd2d 100644 (file)
@@ -29,8 +29,14 @@ static inline void verify_int_buffer(chunk_t data, int bits, int val)
        ck_assert_int_eq(data.len, (val + 1) * len);
        for (i = 0; i < data.len; i++)
        {
-               (i + 1) % len ? ck_assert_int_eq(data.ptr[i], 0)
-                                         : ck_assert_int_eq(data.ptr[i], i / len);
+               if ((i + 1) % len)
+               {
+                       ck_assert_int_eq(data.ptr[i], 0);
+               }
+               else
+               {
+                       ck_assert_int_eq(data.ptr[i], i / len);
+               }
        }
 }