From: Ben Pfaff Date: Wed, 1 Apr 2009 17:05:36 +0000 (-0700) Subject: Fix failures in unit tests. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b91c77105f3c0bc2ff59a4616f88acd641c8ff8c;p=openvswitch Fix failures in unit tests. All of these unit test failures indicated bugs in the tests, not bugs in the code under test. --- diff --git a/tests/flowgen.pl b/tests/flowgen.pl index eb17b2af..6325f1fe 100755 --- a/tests/flowgen.pl +++ b/tests/flowgen.pl @@ -186,7 +186,7 @@ sub output { print FLOWS pack('Nn', 0, # wildcards - 0); # in_port + 1); # in_port print FLOWS pack_ethaddr($flow{DL_SRC}); print FLOWS pack_ethaddr($flow{DL_DST}); print FLOWS pack('nnCxNNnn', diff --git a/tests/test-classifier.c b/tests/test-classifier.c index efbb2390..b281134e 100644 --- a/tests/test-classifier.c +++ b/tests/test-classifier.c @@ -463,7 +463,8 @@ make_rule(int wc_fields, unsigned int priority, int value_pat) } rule = xcalloc(1, sizeof *rule); - cls_rule_from_flow(&rule->cls_rule, &flow, wildcards, priority); + cls_rule_from_flow(&rule->cls_rule, &flow, wildcards, + !wildcards ? UINT_MAX : priority); return rule; } diff --git a/tests/test-flows.c b/tests/test-flows.c index 74016c85..89895e41 100644 --- a/tests/test-flows.c +++ b/tests/test-flows.c @@ -51,7 +51,7 @@ main(int argc UNUSED, char *argv[]) ofp_fatal(retval, "error reading pcap file"); } - flow_extract(packet, 0, &flow); + flow_extract(packet, 1, &flow); flow_to_match(&flow, 0, &extracted_match); if (memcmp(&expected_match, &extracted_match, sizeof expected_match)) {