Fix failures in unit tests.
authorBen Pfaff <blp@nicira.com>
Wed, 1 Apr 2009 17:05:36 +0000 (10:05 -0700)
committerBen Pfaff <blp@nicira.com>
Wed, 1 Apr 2009 17:05:36 +0000 (10:05 -0700)
All of these unit test failures indicated bugs in the tests, not bugs in
the code under test.

tests/flowgen.pl
tests/test-classifier.c
tests/test-flows.c

index eb17b2af15d403a52c36ad55028137af89eb8606..6325f1fea90144647a829236b8449680b5b6d94d 100755 (executable)
@@ -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',
index efbb2390317146ff356c6089616a7766eeb6f56d..b281134e8e403546f08005c817b392b64372b5b8 100644 (file)
@@ -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;
 }
 
index 74016c8556182797b49e9a650432e0dd1db5dc1c..89895e41ae393c5608d0dea89c8b7e169892d946 100644 (file)
@@ -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)) {