[Piglit] [PATCH] tests/spec/arb_robustness/draw-vbo-bounds.c: add clipping
Roland Scheidegger
sroland at vmware.com
Tue Oct 30 12:45:00 PDT 2012
Am 30.10.2012 20:01, schrieb Ian Romanick:
> On 10/29/2012 05:34 PM, Roland Scheidegger wrote:
>> Am 30.10.2012 00:22, schrieb Brian Paul:
>>> On 10/29/2012 05:05 PM, sroland at vmware.com wrote:
>>>> From: Roland Scheidegger<sroland at vmware.com>
>>>>
>>>> Make sure clipping is needed sometimes, and more often use small index
>>>> counts,
>>>> to expose issues and excercise more paths in mesa's draw module.
>>>> ---
>>>> tests/spec/arb_robustness/draw-vbo-bounds.c | 4 ++--
>>>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/tests/spec/arb_robustness/draw-vbo-bounds.c
>>>> b/tests/spec/arb_robustness/draw-vbo-bounds.c
>>>> index 4351ac9..c780a3a 100644
>>>> --- a/tests/spec/arb_robustness/draw-vbo-bounds.c
>>>> +++ b/tests/spec/arb_robustness/draw-vbo-bounds.c
>>>> @@ -95,7 +95,7 @@ random_vertices(GLsizei offset, GLsizei stride,
>>>> GLsizei count)
>>>>
>>>> for (i = 0; i< count; ++i) {
>>>> GLfloat *vertex = (GLfloat *)(vertices + offset + i*stride);
>>>> - vertex[0] = (rand() % 1000) * .001;
>>>> + vertex[0] = (rand() % 1000) * ((rand() % 1000) ? 0.001 : 1.0);
>>>> vertex[1] = (rand() % 1000) * .001;
>>>> }
>>>>
>>>> @@ -145,7 +145,7 @@ static void test(void)
>>>> vertex_count = 1 + rand() % 0xffff;
>>>>
>>>> index_offset = (rand() % 0xff) * sizeof(GLushort);
>>>> - index_count = 1 + rand() % 0xffff;
>>>> + index_count = rand() % 10 ? 1 + rand() % 0xffff : 1 + rand() %
>>>> 0x7ff;
>>>> min_index = rand() % vertex_count;
>>>> max_index = min_index + rand() % (vertex_count - min_index);
>>>>
>>>
>>> Randomness in tests can be OK, but in this case wouldn't you want to
>>> explicitly test some specific coordinates and indexes to make sure the
>>> corner cases are hit?
>>>
>>> -Brain
>>
>> Well I'm not sure it's worth the trouble note the test is run 1000 times
>> so probability is very very high that these cases are hit anyway.
>
> What happens when one of us gets a bug report that this test fails, but
> we're unable to reproduce it? If I had been paying attention, I would
> have already objected to the initial use of rand in this test...
>
Well my guess is José wanted to keep it simple without testing a
gazillion different "interesting" combinations manually (besides what's
interesting might well depend on the driver).
It looks though there's strong opinion against this, would you prefer a
fully deterministic test? I guess since it runs so many iterations
anyway could just loop through pretty much all cases instead (aside from
the exact indices and vertices, but the indices aren't really all that
interesting except if they are inbound or out-of-bound same is true for
the vertices which shouldn't matter except if they are clipped or not).
Roland
More information about the Piglit
mailing list