X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=tests%2Ftest-csum.c;h=b08f236f4120a30135136f84887c048cee641dab;hb=1cad56e16cc4cc62d97ef9cd40d636a1167a3e27;hp=81f54b809200d71b8d7e8b8901a5355c5fb91db6;hpb=d84d4b88d26e3f37ce24f1d3eebe0d70ef264f73;p=sliver-openvswitch.git diff --git a/tests/test-csum.c b/tests/test-csum.c index 81f54b809..b08f236f4 100644 --- a/tests/test-csum.c +++ b/tests/test-csum.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2010, 2011 Nicira Networks. + * Copyright (c) 2009, 2010, 2011 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -94,9 +94,12 @@ static void test_rfc1624(void) { /* "...an IP packet header in which a 16-bit field m = 0x5555..." */ - uint8_t data[32] = - "\xfe\x8f\xc1\x14\x4b\x6f\x70\x2a\x80\x29\x78\xc0\x58\x81\x77\xaa" - "\x66\x64\xfc\x96\x63\x97\x64\xee\x12\x53\x1d\xa9\x2d\xa9\x55\x55"; + uint8_t data[32] = { + 0xfe, 0x8f, 0xc1, 0x14, 0x4b, 0x6f, 0x70, 0x2a, + 0x80, 0x29, 0x78, 0xc0, 0x58, 0x81, 0x77, 0xaa, + 0x66, 0x64, 0xfc, 0x96, 0x63, 0x97, 0x64, 0xee, + 0x12, 0x53, 0x1d, 0xa9, 0x2d, 0xa9, 0x55, 0x55 + }; /* "...the one's complement sum of all other header octets is 0xCD7A." */ assert(ntohs(csum(data, sizeof data - 2)) == 0xffff - 0xcd7a); @@ -140,8 +143,9 @@ main(void) int i; for (tc = test_cases; tc < &test_cases[ARRAY_SIZE(test_cases)]; tc++) { - const ovs_be16 *data16 = (OVS_FORCE const ovs_be16 *) tc->data; - const ovs_be32 *data32 = (OVS_FORCE const ovs_be32 *) tc->data; + const void *data = tc->data; + const ovs_be16 *data16 = (OVS_FORCE const ovs_be16 *) data; + const ovs_be32 *data32 = (OVS_FORCE const ovs_be32 *) data; uint32_t partial; /* Test csum(). */