From b91c77105f3c0bc2ff59a4616f88acd641c8ff8c Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 1 Apr 2009 10:05:36 -0700 Subject: [PATCH] Fix failures in unit tests. All of these unit test failures indicated bugs in the tests, not bugs in the code under test. --- tests/flowgen.pl | 2 +- tests/test-classifier.c | 3 ++- tests/test-flows.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) 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)) { -- 2.30.2