add corner case unit test function
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 18 Feb 2019 21:04:29 +0000 (21:04 +0000)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Mon, 18 Feb 2019 21:04:29 +0000 (21:04 +0000)
src/add/unit_test_single.py

index b2396131993203cb3dff0325489d6f22f327b900..a752189fca8e8deaf191d54172783ecc08773c83 100644 (file)
@@ -114,6 +114,16 @@ def run_test(dut, stimulus_a, stimulus_b, op):
 
             sys.exit(0)
 
+def run_corner_cases(dut, count, op):
+    #corner cases
+    from itertools import permutations
+    stimulus_a = [i[0] for i in permutations([0x80000000, 0x00000000, 0x7f800000, 0xff800000, 0x7fc00000, 0xffc00000], 2)]
+    stimulus_b = [i[1] for i in permutations([0x80000000, 0x00000000, 0x7f800000, 0xff800000, 0x7fc00000, 0xffc00000], 2)]
+    yield from run_test(dut, stimulus_a, stimulus_b, op)
+    count += len(stimulus_a)
+    print (count, "vectors passed")
+
+
 def run_edge_cases(dut, count, op):
     #edge cases
     stimulus_a = [0x80000000 for i in range(1000)]