[Piglit] [RESEND RFC 23/25] gen_tess_input_tests.py: simplify some of the logic
baker.dylan.c at gmail.com
baker.dylan.c at gmail.com
Wed Oct 21 10:20:32 PDT 2015
From: Dylan Baker <baker.dylan.c at gmail.com>
This produces the same result, but it's much clearer what's happening.
Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
---
generated_tests/gen_tess_input_tests.py | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/generated_tests/gen_tess_input_tests.py b/generated_tests/gen_tess_input_tests.py
index f4c50e6..4950976 100644
--- a/generated_tests/gen_tess_input_tests.py
+++ b/generated_tests/gen_tess_input_tests.py
@@ -143,8 +143,7 @@ class TcsTest(object):
elif self.var_type.startswith('u'):
rand = lambda: np.random.randint(0, 0xffffffff)
else:
- rand = lambda: ((np.int_(-1) + np.int_(2) *
- np.random.randint(0, 1)) *
+ rand = lambda: (np.int_(np.random.choice((-1, 1))) *
np.random.randint(0, 2**23-1) *
np.float_(2.0)**(np.random.randint(-126, 127)))
@@ -306,8 +305,7 @@ class TesTest(object):
elif self.var_type.startswith('u'):
rand = lambda: np.random.randint(0, 0xffffffff)
else:
- rand = lambda: ((np.int_(-1) + np.int_(2) *
- np.random.randint(0, 1)) *
+ rand = lambda: (np.int_(np.random.choice((-1, 1))) *
np.random.randint(0, 2**23-1) *
np.float_(2.0)**(np.random.randint(-126, 127)))
--
2.6.1
More information about the Piglit
mailing list