From 25895686abdabd9d63342d26b19baabf936de7f9 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Mon, 8 Jul 2019 13:59:09 +0100 Subject: [PATCH] add single-arg option to fp tests --- src/ieee754/fpcommon/test/case_gen.py | 59 ++++++++++++++++++--------- src/ieee754/fpcommon/test/fpmux.py | 5 ++- 2 files changed, 42 insertions(+), 22 deletions(-) diff --git a/src/ieee754/fpcommon/test/case_gen.py b/src/ieee754/fpcommon/test/case_gen.py index 26b6cd62..f7a6e125 100644 --- a/src/ieee754/fpcommon/test/case_gen.py +++ b/src/ieee754/fpcommon/test/case_gen.py @@ -10,11 +10,13 @@ def corner_cases(mod): mod.inf(1), mod.inf(0), mod.nan(1), mod.nan(0)] -def get_corner_cases(mod): +def get_corner_cases(mod, single_op=False): #corner cases from itertools import permutations cc = corner_cases(mod) stimulus_a = [i[0] for i in permutations(cc, 2)] + if single_op: + return stimulus_a stimulus_b = [i[1] for i in permutations(cc, 2)] return zip(stimulus_a, stimulus_b) @@ -29,59 +31,71 @@ def get_rval(width): mval = (1<