[Piglit] [PATCH 1/2] Fix bogus assertions in builtin uniform test generator.
Kenneth Graunke
kenneth at whitecape.org
Wed May 9 23:12:51 UTC 2018
self.test_rows is measured in a number of 4x4 rectangles, but y is
measured in pixels, so they are not comparable. The only reason this
doesn't trip is because self.test_rows is currently the number of 4x4
rectangles that can fit in a 250x250 window (62)...and no test has
nearly that many rows of rectangles.
Instead, just assert y fits in the window height.
---
generated_tests/gen_builtin_uniform_tests.py | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/generated_tests/gen_builtin_uniform_tests.py b/generated_tests/gen_builtin_uniform_tests.py
index 50cced444..ac09a64fc 100644
--- a/generated_tests/gen_builtin_uniform_tests.py
+++ b/generated_tests/gen_builtin_uniform_tests.py
@@ -386,7 +386,7 @@ class ShaderTest(object):
def draw_command(self, test_num):
x = (test_num % self.tests_per_row) * self.rect_width
y = (test_num // self.tests_per_row) * self.rect_height
- assert(y < self.test_rows)
+ assert(y + self.rect_height <= self.win_height)
return 'draw rect ortho {0} {1} {2} {3}\n'.format(x, y,
self.rect_width,
self.rect_height)
@@ -662,7 +662,7 @@ class TessellationShaderTest(ShaderTest):
def draw_command(self, test_num):
x = (test_num % self.tests_per_row) * self.rect_width
y = (test_num // self.tests_per_row) * self.rect_height
- assert(y < self.test_rows)
+ assert(y + self.rect_height <= self.win_height)
return 'draw rect ortho patch {0} {1} {2} {3}\n'.format(x, y,
self.rect_width,
self.rect_height)
--
2.17.0
More information about the Piglit
mailing list