summaryrefslogtreecommitdiff
path: root/tests/test-csum.c
diff options
context:
space:
mode:
authorBen Pfaff <blp@nicira.com>2010-11-16 12:51:08 -0800
committerBen Pfaff <blp@nicira.com>2010-11-16 12:51:08 -0800
commitd932cf70b1fe1cdf7d97e598847d9b82e4be3e0b (patch)
tree1480cab8dc97bba8d9ae88b4e10b1ce7797a9136 /tests/test-csum.c
parentb8fa71021e738a8c77cb17ec0a0897230db1d61b (diff)
downloadopenvswitch-d932cf70b1fe1cdf7d97e598847d9b82e4be3e0b.tar.gz
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.
Diffstat (limited to 'tests/test-csum.c')
-rw-r--r--tests/test-csum.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/tests/test-csum.c b/tests/test-csum.c
index eebc8803f..fd16dd3f1 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