[Piglit] [PATCH 15/34] gen_constant_array_size_tests.py: python2/3 hybridize
Dylan Baker
baker.dylan.c at gmail.com
Fri Feb 20 18:18:02 PST 2015
This produces a bit more precision in python3 than in python2
Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
---
generated_tests/gen_constant_array_size_tests.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/generated_tests/gen_constant_array_size_tests.py b/generated_tests/gen_constant_array_size_tests.py
index f8ee394..a239405 100644
--- a/generated_tests/gen_constant_array_size_tests.py
+++ b/generated_tests/gen_constant_array_size_tests.py
@@ -41,6 +41,8 @@ import optparse
import os
import os.path
+from six.moves import range
+
from modules import utils
class ParserTest(object):
@@ -115,7 +117,7 @@ class ParserTest(object):
# is safe to use pow() here because its behavior is
# verified in the pow() tests.
terms = []
- for col in xrange(self.__signature.rettype.num_cols):
+ for col in range(self.__signature.rettype.num_cols):
terms.append('pow(distance({0}[{1}], {2}), 2)'.format(
invocation, col,
glsl_constant(test_vector.result[:, col])))
@@ -134,7 +136,7 @@ class ParserTest(object):
# Don't use the equal() function to test itself.
assert self.__signature.rettype.is_vector
terms = []
- for row in xrange(self.__signature.rettype.num_rows):
+ for row in range(self.__signature.rettype.num_rows):
terms.append('{0}[{1}] == {2}'.format(
invocation, row,
glsl_constant(test_vector.result[row])))
--
2.3.0
More information about the Piglit
mailing list