unit-tests: define 64-bit constats with ULL, fixing compiler warning on 32-bit
authorMartin Willi <martin@revosec.ch>
Tue, 11 Jun 2013 15:45:45 +0000 (17:45 +0200)
committerMartin Willi <martin@revosec.ch>
Fri, 21 Jun 2013 08:53:22 +0000 (10:53 +0200)
src/libstrongswan/tests/test_utils.c

index f7cb605..ec9baf1 100644 (file)
@@ -119,7 +119,7 @@ START_TEST(test_htoun)
        chunk_t net64, expected;
        u_int16_t host16 = 513;
        u_int32_t net16 = 0, host32 = 67305985;
-       u_int64_t net32 = 0, host64 = 578437695752307201;
+       u_int64_t net32 = 0, host64 = 578437695752307201ULL;
 
        net64 = chunk_alloca(16);
        memset(net64.ptr, 0, net64.len);
@@ -159,7 +159,7 @@ START_TEST(test_untoh)
        net = chunk_from_chars(0x00, 0x00, 0x00, 0x00, 0x08, 0x07, 0x06, 0x05,
                                                   0x04, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00);
        host64 = untoh64(net.ptr + 4);
-       ck_assert(host64 == 578437695752307201);
+       ck_assert(host64 == 578437695752307201ULL);
 }
 END_TEST