KhronosGroup/WebGL — pull request #453 by TiborsHub (2014-01-28 13:15:43+00:00)
Title: Vector constructor argument list validation, request for comment

This is my progress on the constructor tests sofar.
The tests in the pull request are for vecx, ivecx, bvecx, x : { 2, 3, 4 }
I think the current approach allows for easy adding of test of vector types of half float and doubles when needed.
It tests all combinations of arguments from 0 up till one not used scalar argument, all argument types have the same
scalar type as the target type (so no conversions).
This keeps the total count of tests reasonable.
For a mat3 this would result in about 1570 tests, Is this still acceptable ?
For mat4 this would end up in 155227 tests, this is too much I think. I will think
of a way to generate a smaller subset of argument lists.

The current test tests on;y if the combination of arguments is valid.
What is not tested yet :
Is the order of assignment of components correct for the valid combinations of arguments ?
This is more or less tested throughout the conformance suite, but testing this explicit is a good idea or not ?

There are several ways to add this :
I could implement this in the current tests but that is may be too much in one test ?
So is it a better approach to create separate tests for this ?
I could compare the vector components in the shader and return red or green based on
the result
or :
render the output and compare with a reference texture.
The first approach would strike me a bit odd because in a function where constructor functionality
is tested, you rely on other glsl functionality to compute the correctness.
Or is that a too purist look at the issue ?

I would like to know if this is more or less what fits the conformance suite ?
Please look at code style, messages displayed in test, other issues with the test code.

One thing I noticed is that the reported test count is one more than the actual tests.
Is the test set itself also counted as one test ?
I did not investigate this further.

The current constructor tests are all passed by :
Chrome 32.0.1700.102 m
Firefox 26.0
Opera 18.0.1284.68
Maxthon 4.2.1.1000

IE 11 11.0.9600.16476
passes :
14 out of 17 (vec2, ivec2)
23 out of 31 (vec3, ivec3)
42 out of 59 (vec4, ivec4)

14 out of 18 (bvec2)
23 out of 32 (bvec3)
42 out of 60 (bvec4)
For the boolean vectors IE sees one test more ?!
I did not investigate where this comes from.

Regards,

Tibor