From: Ben Pfaff Date: Tue, 16 Nov 2010 20:51:08 +0000 (-0800) Subject: test-csum: Make test_case requirements clear. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d932cf70b1fe1cdf7d97e598847d9b82e4be3e0b;p=openvswitch test-csum: Make test_case requirements clear. This test code only works properly with test cases whose data is a multiple of 4, so make that clear in the code and the data. --- diff --git a/tests/test-csum.c b/tests/test-csum.c index eebc8803..fd16dd3f 100644 --- a/tests/test-csum.c +++ b/tests/test-csum.c @@ -29,7 +29,7 @@ struct test_case { char *data; - size_t size; + size_t size; /* Test requires a multiple of 4. */ uint16_t csum; }; @@ -37,15 +37,22 @@ struct test_case { static const struct test_case test_cases[] = { /* RFC 1071 section 3. */ - TEST_CASE("\x00\x01\xf2\x03\xf4\xf5\xf6\xf7", (uint16_t) ~0xddf2), + TEST_CASE("\x00\x01\xf2\x03" + "\xf4\xf5\xf6\xf7", + (uint16_t) ~0xddf2), /* http://www.sbprojects.com/projects/tcpip/theory/theory14.htm */ - TEST_CASE("\x45\x00\x00\x28\x1F\xFD\x40\x00\x80\x06" - "\x00\x00\xC0\xA8\x3B\x0A\xC0\xA8\x3B\x32", + TEST_CASE("\x45\x00\x00\x28" + "\x1F\xFD\x40\x00" + "\x80\x06\x00\x00" + "\xC0\xA8\x3B\x0A" + "\xC0\xA8\x3B\x32", 0xe345), /* http://mathforum.org/library/drmath/view/54379.html */ - TEST_CASE("\x86\x5e\xac\x60\x71\x2a\x81\xb5", 0xda60), + TEST_CASE("\x86\x5e\xac\x60" + "\x71\x2a\x81\xb5", + 0xda60), }; static void