summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2009-09-29 12:36:53 -0700
committerEric Anholt <eric@anholt.net>2009-09-29 12:36:53 -0700
commit9a6cb4b2ac1e50a957dadbda3233216d4ab0cd87 (patch)
tree857701c78b4733700dbcf2f2ae7591c5109c61e9
parentc3da635874bbc8251605aa841c6567ce1427194f (diff)
-rw-r--r--tests/glean/dsfilt.cpp16
-rw-r--r--tests/glean/dsfilt.h4
-rw-r--r--tests/glean/main.cpp9
-rw-r--r--tests/glean/options.cpp1
-rw-r--r--tests/glean/options.h2
-rw-r--r--tests/glean/tapi2.cpp4
-rw-r--r--tests/glean/tbase.h2
-rw-r--r--tests/glean/tclipflat.cpp8
-rw-r--r--tests/glean/tdepthstencil.cpp3
-rw-r--r--tests/glean/tfbo.cpp6
-rw-r--r--tests/glean/tfragprog1.cpp31
-rw-r--r--tests/glean/tglsl1.cpp132
-rw-r--r--tests/glean/tpbo.cpp55
-rw-r--r--tests/glean/ttexcombine.cpp5
-rw-r--r--tests/glean/tvertprog1.cpp6
-rw-r--r--tests/glean/winsys.cpp8
16 files changed, 230 insertions, 62 deletions
diff --git a/tests/glean/dsfilt.cpp b/tests/glean/dsfilt.cpp
index fe5ed2660..015aa64b8 100644
--- a/tests/glean/dsfilt.cpp
+++ b/tests/glean/dsfilt.cpp
@@ -163,11 +163,23 @@ DrawingSurfaceFilter::matches(DrawingSurfaceConfig& c) {
///////////////////////////////////////////////////////////////////////////////
vector<DrawingSurfaceConfig*>
DrawingSurfaceFilter::filter(vector<DrawingSurfaceConfig*>& v) {
+ return filter(v, ~0u);
+} // DrawingSurfaceFilter::filter
+
+///////////////////////////////////////////////////////////////////////////////
+// filter - filter as above, but limit number of results
+///////////////////////////////////////////////////////////////////////////////
+vector<DrawingSurfaceConfig*>
+DrawingSurfaceFilter::filter(vector<DrawingSurfaceConfig*>& v,
+ unsigned int maxConfigs) {
vector<DrawingSurfaceConfig*> result;
+ unsigned count = 0;
for (vector<DrawingSurfaceConfig*>::const_iterator p = v.begin();
- p < v.end(); ++p) {
- if (matches(**p))
+ p < v.end() && count < maxConfigs; ++p) {
+ if (matches(**p)) {
result.push_back(*p);
+ count++;
+ }
}
sort(result.begin(), result.end(), ConfigSort(sortKeys));
diff --git a/tests/glean/dsfilt.h b/tests/glean/dsfilt.h
index ec715759f..da9977ae2 100644
--- a/tests/glean/dsfilt.h
+++ b/tests/glean/dsfilt.h
@@ -119,6 +119,10 @@ class DrawingSurfaceFilter {
// match the filter criteria, sorted according to the sorting
// criteria.
+ vector<DrawingSurfaceConfig*> filter(vector<DrawingSurfaceConfig*>& v,
+ unsigned int maxConfigs);
+ // As above, but limit number of filter results to given count.
+
protected:
typedef enum {
diff --git a/tests/glean/main.cpp b/tests/glean/main.cpp
index 6e4b5b231..ae3c956ab 100644
--- a/tests/glean/main.cpp
+++ b/tests/glean/main.cpp
@@ -60,6 +60,7 @@ main(int argc, char* argv[]) {
// Until someone gets around to writing a fancy GUI front-end,
// we'll set options the old-fashioned way.
Options o;
+ bool visFilter = false;
vector<string> allTestNames;
for (Test* t = Test::testList; t; t = t->nextTest)
@@ -91,6 +92,7 @@ main(int argc, char* argv[]) {
++i;
o.db2Name = mandatoryArg(argc, argv, i);
} else if (!strcmp(argv[i], "--visuals")) {
+ visFilter = true;
++i;
o.visFilter = mandatoryArg(argc, argv, i);
} else if (!strcmp(argv[i], "-t")
@@ -118,6 +120,13 @@ main(int argc, char* argv[]) {
exit(0);
}
+ if (o.quick && !visFilter) {
+ // If we have --quick but not --visuals then limit testing to
+ // a single RGB, Z, Stencil visual.
+ o.visFilter = "rgb && z>0 && s>0 && conformant";
+ o.maxVisuals = 1;
+ }
+
// Create the test environment, then invoke each test to generate
// results or compare two previous runs.
try {
diff --git a/tests/glean/options.cpp b/tests/glean/options.cpp
index bf7dd31ac..051eb3211 100644
--- a/tests/glean/options.cpp
+++ b/tests/glean/options.cpp
@@ -46,6 +46,7 @@ Options::Options() {
db1Name = "results";
db2Name = "previous";
visFilter = "1";
+ maxVisuals = ~0U;
selectedTests.resize(0);
overwrite = false;
quick = false;
diff --git a/tests/glean/options.h b/tests/glean/options.h
index ea84348e6..60a47ab00 100644
--- a/tests/glean/options.h
+++ b/tests/glean/options.h
@@ -78,6 +78,8 @@ class Options {
// DrawingSurfaceFilter for description of
// contents.
+ unsigned int maxVisuals;// Max number of visuals to test
+
vector<string> selectedTests;
// Sorted list of tests to be executed.
diff --git a/tests/glean/tapi2.cpp b/tests/glean/tapi2.cpp
index 15fe59d44..f180bc3b9 100644
--- a/tests/glean/tapi2.cpp
+++ b/tests/glean/tapi2.cpp
@@ -311,14 +311,14 @@ API2Test::renderQuadWithArrays(GLint attr, const GLfloat value[4],
};
glVertexPointer(3, GL_FLOAT, 0, vertcoords);
- glEnable(GL_VERTEX_ARRAY);
+ glEnableClientState(GL_VERTEX_ARRAY);
glVertexAttribPointer_func(attr, 4, GL_FLOAT, GL_FALSE, 0, values);
glEnableVertexAttribArray_func(attr);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glDrawArrays(GL_POLYGON, 0, 4);
- glDisable(GL_VERTEX_ARRAY);
+ glDisableClientState(GL_VERTEX_ARRAY);
glDisableVertexAttribArray_func(attr);
// read a pixel from lower-left corner of rendered quad
diff --git a/tests/glean/tbase.h b/tests/glean/tbase.h
index ecd3e17ac..4f0104f8b 100644
--- a/tests/glean/tbase.h
+++ b/tests/glean/tbase.h
@@ -283,7 +283,7 @@ public:
// Select the drawing configurations for testing
DrawingSurfaceFilter f(filter);
vector<DrawingSurfaceConfig*>
- configs(f.filter(ws.surfConfigs));
+ configs(f.filter(ws.surfConfigs, environment.options.maxVisuals));
// Test each config
for (vector<DrawingSurfaceConfig*>::const_iterator
diff --git a/tests/glean/tclipflat.cpp b/tests/glean/tclipflat.cpp
index 3246fbf8f..a2798c01d 100644
--- a/tests/glean/tclipflat.cpp
+++ b/tests/glean/tclipflat.cpp
@@ -220,13 +220,13 @@ ClipFlatTest::drawArrays(GLenum mode, const GLfloat *verts, GLuint count)
{
glColorPointer(3, GL_FLOAT, 5 * sizeof(GLfloat), verts + 0);
glVertexPointer(2, GL_FLOAT, 5 * sizeof(GLfloat), verts + 3);
- glEnable(GL_COLOR_ARRAY);
- glEnable(GL_VERTEX_ARRAY);
+ glEnableClientState(GL_COLOR_ARRAY);
+ glEnableClientState(GL_VERTEX_ARRAY);
glDrawArrays(mode, 0, count);
- glDisable(GL_COLOR_ARRAY);
- glDisable(GL_VERTEX_ARRAY);
+ glDisableClientState(GL_COLOR_ARRAY);
+ glDisableClientState(GL_VERTEX_ARRAY);
}
diff --git a/tests/glean/tdepthstencil.cpp b/tests/glean/tdepthstencil.cpp
index 54e97df0f..ad672ef54 100644
--- a/tests/glean/tdepthstencil.cpp
+++ b/tests/glean/tdepthstencil.cpp
@@ -261,7 +261,8 @@ DepthStencilTest::readPixelsRate(GLenum format, GLenum type)
delete [] img;
- double rate = width * height * iterations / elapsedTime;
+ double rate = width * height * (double) iterations / elapsedTime;
+ assert(rate > 0.0);
return rate; // pixels/second
}
diff --git a/tests/glean/tfbo.cpp b/tests/glean/tfbo.cpp
index fd044b8c5..1c6685359 100644
--- a/tests/glean/tfbo.cpp
+++ b/tests/glean/tfbo.cpp
@@ -664,7 +664,7 @@ FBOTest::testRender2SingleTexture(void)
glDepthFunc(GL_ALWAYS);
switch (textureModes[mode]) {
case GL_TEXTURE_1D:
- glBegin(GL_LINE);
+ glBegin(GL_LINES);
glVertex3f(TEXSIZE / 4, 0, 0.3);
glVertex3f(TEXSIZE * 5 / 8, 0, 0.3);
glEnd();
@@ -694,7 +694,7 @@ FBOTest::testRender2SingleTexture(void)
GL_KEEP, GL_REPLACE);
switch (textureModes[mode]) {
case GL_TEXTURE_1D:
- glBegin(GL_LINE);
+ glBegin(GL_LINES);
glVertex3f(TEXSIZE / 2, 0, 0.3);
glVertex3f(TEXSIZE * 7 / 8, 0, 0.3);
glEnd();
@@ -725,7 +725,7 @@ FBOTest::testRender2SingleTexture(void)
switch (textureModes[mode]) {
case GL_TEXTURE_1D:
- glBegin(GL_LINE);
+ glBegin(GL_LINES);
glVertex3f(0, 0, 0.2);
glVertex3f(TEXSIZE, 0, 0.2);
glEnd();
diff --git a/tests/glean/tfragprog1.cpp b/tests/glean/tfragprog1.cpp
index 101f0bc6b..17aeb6a3a 100644
--- a/tests/glean/tfragprog1.cpp
+++ b/tests/glean/tfragprog1.cpp
@@ -119,6 +119,21 @@ static const FragmentProgram Programs[] = {
DONT_CARE_Z
},
{
+ "ADD with saturation",
+ "!!ARBfp1.0\n"
+ "PARAM p = program.local[1]; \n"
+ "TEMP t; \n"
+ "ADD t, p, p; \n"
+ "ADD_SAT result.color, t, p; \n"
+ "END \n",
+ { CLAMP01(Param1[0] + Param1[0] + Param1[0]),
+ CLAMP01(Param1[1] + Param1[1] + Param1[1]),
+ CLAMP01(Param1[2] + Param1[2] + Param1[2]),
+ CLAMP01(Param1[3] + Param1[3] + Param1[3]),
+ },
+ DONT_CARE_Z
+ },
+ {
"CMP test",
"!!ARBfp1.0\n"
"PARAM zero = program.local[0]; \n"
@@ -562,6 +577,22 @@ static const FragmentProgram Programs[] = {
DONT_CARE_Z
},
{
+ "SUB with saturation",
+ "!!ARBfp1.0\n"
+ "PARAM p1 = program.local[1]; \n"
+ "PARAM bias = {0.1, 0.1, 0.1, 0.1}; \n"
+ "TEMP t; \n"
+ "SUB_SAT t, fragment.color, p1; \n"
+ "ADD result.color, t, bias; \n"
+ "END \n",
+ { CLAMP01(FragColor[0] - Param1[1]) + 0.1,
+ CLAMP01(FragColor[1] - Param1[1]) + 0.1,
+ CLAMP01(FragColor[2] - Param1[2]) + 0.1,
+ CLAMP01(FragColor[3] - Param1[3]) + 0.1
+ },
+ DONT_CARE_Z
+ },
+ {
"SWZ test",
"!!ARBfp1.0\n"
"PARAM p = program.local[1]; \n"
diff --git a/tests/glean/tglsl1.cpp b/tests/glean/tglsl1.cpp
index 64678b958..79ac78e67 100644
--- a/tests/glean/tglsl1.cpp
+++ b/tests/glean/tglsl1.cpp
@@ -359,6 +359,21 @@ static const ShaderProgram Programs[] = {
},
{
+ // This test targets SOA implementations where we have to
+ // check for SOA dependencies.
+ "Swizzle in-place",
+ NO_VERTEX_SHADER,
+ "void main() { \n"
+ " vec4 a = vec4(0.5, 0.2, 0.1, 0.8); \n"
+ " a = a.yxwz; \n"
+ " gl_FragColor = a; \n"
+ "} \n",
+ { 0.2, 0.5, 0.8, 0.1 },
+ DONT_CARE_Z,
+ FLAG_NONE
+ },
+
+ {
"Swizzled swizzle",
NO_VERTEX_SHADER,
"void main() { \n"
@@ -2185,13 +2200,13 @@ static const ShaderProgram Programs[] = {
{
"function call with in, out params",
NO_VERTEX_SHADER,
- "void half(in float x, out float y) { \n"
+ "void Half(in float x, out float y) { \n"
" y = 0.5 * x; \n"
"} \n"
"\n"
"void main() { \n"
" float a = 0.5, b = 0.1; \n"
- " half(a, b); \n"
+ " Half(a, b); \n"
" gl_FragColor = vec4(b); \n"
"} \n",
{ 0.25, 0.25, 0.25, 0.25 },
@@ -2257,9 +2272,30 @@ static const ShaderProgram Programs[] = {
},
{
+ "function with early return (4)",
+ NO_VERTEX_SHADER,
+ "float val = 0.5; \n"
+ "void sub(in float x) { \n"
+ " if (x >= 0.3) \n"
+ " if (x >= 0.4) \n"
+ " return; \n"
+ " val = 1.0; \n"
+ "} \n"
+ "\n"
+ "void main() { \n"
+ " sub(gl_TexCoord[0].s); \n"
+ " gl_FragColor = vec4(val); \n"
+ "} \n",
+ { 0.5, 0.5, 0.5, 0.5 },
+ DONT_CARE_Z,
+ FLAG_NONE
+ },
+
+
+ {
"nested function calls (1)",
NO_VERTEX_SHADER,
- "float half(const in float x) { \n"
+ "float Half(const in float x) { \n"
" return 0.5 * x; \n"
"} \n"
"\n"
@@ -2269,7 +2305,7 @@ static const ShaderProgram Programs[] = {
"\n"
"void main() { \n"
" float a = 0.5; \n"
- " float b = square(half(1.0)); \n"
+ " float b = square(Half(1.0)); \n"
" gl_FragColor = vec4(b); \n"
"} \n",
{ 0.25, 0.25, 0.25, 0.25 },
@@ -2280,12 +2316,12 @@ static const ShaderProgram Programs[] = {
{
"nested function calls (2)",
NO_VERTEX_SHADER,
- "float half(const in float x) { \n"
+ "float Half(const in float x) { \n"
" return 0.5 * x; \n"
"} \n"
"\n"
"float square_half(const in float x) { \n"
- " float y = half(x); \n"
+ " float y = Half(x); \n"
" return y * y; \n"
"} \n"
"\n"
@@ -2302,13 +2338,13 @@ static const ShaderProgram Programs[] = {
{
"nested function calls (3)",
NO_VERTEX_SHADER,
- "float half(const in float x) { \n"
+ "float Half(const in float x) { \n"
" return 0.5 * x; \n"
"} \n"
"\n"
"void main() { \n"
" float a = 0.5; \n"
- " float b = half(half(a)); \n"
+ " float b = Half(Half(a)); \n"
" gl_FragColor = vec4(b); \n"
"} \n",
{ 0.125, 0.125, 0.125, 0.125 },
@@ -3175,6 +3211,86 @@ static const ShaderProgram Programs[] = {
DONT_CARE_Z,
FLAG_VERSION_1_20
},
+#if 0 // not working with Mesa yet
+ {
+ "GLSL 1.20 array constructor 3",
+ NO_VERTEX_SHADER,
+ "#version 120 \n"
+ "vec4 [] colors = vec4[2](vec4(0.5, 0.4, 0.3, 0.2), \n"
+ " vec4(0.7, 0.8, 0.9, 1.0)); \n"
+ "void main() { \n"
+ " gl_FragColor = colors[1]; \n"
+ "} \n",
+ { 0.7, 0.8, 0.9, 1.0 },
+ DONT_CARE_Z,
+ FLAG_VERSION_1_20
+ },
+ {
+ "GLSL 1.20 array constructor 4",
+ NO_VERTEX_SHADER,
+ "#version 120 \n"
+ "vec4 [2] colors = vec4[](vec4(0.5, 0.4, 0.3, 0.2), \n"
+ " vec4(0.7, 0.8, 0.9, 1.0)); \n"
+ "void main() { \n"
+ " gl_FragColor = colors[1]; \n"
+ "} \n",
+ { 0.7, 0.8, 0.9, 1.0 },
+ DONT_CARE_Z,
+ FLAG_VERSION_1_20
+ },
+ {
+ "GLSL 1.20 array constructor 5",
+ NO_VERTEX_SHADER,
+ "#version 120 \n"
+ "vec4 [] colors = vec4[](vec4(0.5, 0.4, 0.3, 0.2), \n"
+ " vec4(0.7, 0.8, 0.9, 1.0)); \n"
+ "void main() { \n"
+ " gl_FragColor = colors[1]; \n"
+ "} \n",
+ { 0.7, 0.8, 0.9, 1.0 },
+ DONT_CARE_Z,
+ FLAG_VERSION_1_20
+ },
+ {
+ "GLSL 1.20 array constructor 6",
+ NO_VERTEX_SHADER,
+ "#version 120 \n"
+ "vec4 colors[] = vec4[](vec4(0.5, 0.4, 0.3, 0.2), \n"
+ " vec4(0.7, 0.8, 0.9, 1.0)); \n"
+ "void main() { \n"
+ " gl_FragColor = colors[1]; \n"
+ "} \n",
+ { 0.7, 0.8, 0.9, 1.0 },
+ DONT_CARE_Z,
+ FLAG_VERSION_1_20
+ },
+ {
+ "GLSL 1.20 array constructor 7",
+ NO_VERTEX_SHADER,
+ "#version 120 \n"
+ "vec4 colors[2] = vec4[](vec4(0.5, 0.4, 0.3, 0.2), \n"
+ " vec4(0.7, 0.8, 0.9, 1.0)); \n"
+ "void main() { \n"
+ " gl_FragColor = colors[1]; \n"
+ "} \n",
+ { 0.7, 0.8, 0.9, 1.0 },
+ DONT_CARE_Z,
+ FLAG_VERSION_1_20
+ },
+ {
+ "GLSL 1.20 array constructor 8",
+ NO_VERTEX_SHADER,
+ "#version 120 \n"
+ "vec4 colors[2] = vec4[2](vec4(0.5, 0.4, 0.3, 0.2), \n"
+ " vec4(0.7, 0.8, 0.9, 1.0)); \n"
+ "void main() { \n"
+ " gl_FragColor = colors[1]; \n"
+ "} \n",
+ { 0.7, 0.8, 0.9, 1.0 },
+ DONT_CARE_Z,
+ FLAG_VERSION_1_20
+ },
+#endif
{
"GLSL 1.20 const array constructor 1",
NO_VERTEX_SHADER,
diff --git a/tests/glean/tpbo.cpp b/tests/glean/tpbo.cpp
index f2ac7a8ba..7d862796e 100644
--- a/tests/glean/tpbo.cpp
+++ b/tests/glean/tpbo.cpp
@@ -74,8 +74,7 @@ bool PBOTest::setup(void)
glReadBuffer(GL_FRONT);
// compute error tolerances (may need fine-tuning)
- int
- bufferBits[5];
+ int bufferBits[5];
glGetIntegerv(GL_RED_BITS, &bufferBits[0]);
glGetIntegerv(GL_GREEN_BITS, &bufferBits[1]);
@@ -96,7 +95,7 @@ bool PBOTest::setup(void)
tolerance[4] = 1.0;
// Check if GL_ARB_pixel_buffer_object is supported
- if (!strstr((char *) glGetString(GL_EXTENSIONS), "GL_ARB_pixel_buffer_object")) {
+ if (!GLUtils::haveExtension("GL_ARB_pixel_buffer_object")) {
//printf("GL_ARB_pixel_buffer_object is not supported\n");
usePBO = 0;
return false;
@@ -315,8 +314,7 @@ bool PBOTest::testDrawPixels(void)
exp[2] = j % 256;
if (i < TEXSIZE && j < TEXSIZE) {
- if (equalColors1(&pboPackMem[(j * windowSize + i) * 4], exp)
- != true) {
+ if (!equalColors1(&pboPackMem[(j * windowSize + i) * 4], exp)) {
REPORT_FAILURE("glDrawPixels failed");
printf(" got (%d, %d) = [%d, %d, %d], ", i, j,
pboPackMem[(j * windowSize + i) * 4],
@@ -329,8 +327,7 @@ bool PBOTest::testDrawPixels(void)
}
}
else {
- if (equalColors1(&pboPackMem[(j * windowSize + i) * 4],
- black) != true) {
+ if (!equalColors1(&pboPackMem[(j * windowSize + i) * 4], black)) {
REPORT_FAILURE("glDrawPixels failed");
printf("(%d, %d) = [%d, %d, %d], ", i, j,
pboPackMem[(j * windowSize + i) * 4],
@@ -544,8 +541,7 @@ bool PBOTest::testBitmap(void)
else
exp = white;
if (i < TEXSIZE && j < TEXSIZE) {
- if (equalColors(&pboPackMem[(j * windowSize + i) * 3], exp)
- != true) {
+ if (!equalColors(&pboPackMem[(j * windowSize + i) * 3], exp)) {
REPORT_FAILURE("glBitmap failed");
printf(" got (%d, %d) = [%f, %f, %f], ", i, j,
pboPackMem[(j * windowSize + i) * 3],
@@ -558,9 +554,8 @@ bool PBOTest::testBitmap(void)
}
}
else {
- if (equalColors
- (&pboPackMem[(j * windowSize + i) * 3],
- black) != true) {
+ if (!equalColors(&pboPackMem[(j * windowSize + i) * 3],
+ black)) {
REPORT_FAILURE("glBitmap failed");
printf("(%d, %d) = [%f, %f, %f], ", i, j,
pboPackMem[(j * windowSize + i) * 3],
@@ -719,7 +714,7 @@ bool PBOTest::testTexImage(void)
for (i = 0; i < TEXSIZE * TEXSIZE; i++) {
if (i == 0 && breakCOWTexture && useTexUnpackBuffer) {
GLfloat exp[3] = { 0.8, 0.8, 0.8 };
- if (equalColors(&pboMem[i * 3], exp) != true) {
+ if (!equalColors(&pboMem[i * 3], exp)) {
REPORT_FAILURE("glGetTexImage failed");
printf(" got (%d) = [%f, %f, %f], ", i,
pboMem[i * 3],
@@ -732,7 +727,7 @@ bool PBOTest::testTexImage(void)
}
else {
GLfloat exp[3] = { 1.0, 1.0, 0.0 };
- if (equalColors(&pboMem[i * 3], exp) != true) {
+ if (!equalColors(&pboMem[i * 3], exp)) {
REPORT_FAILURE("glGetTexImage failed");
printf(" got (%d) = [%f, %f, %f], ", i,
pboMem[i * 3],
@@ -765,6 +760,7 @@ bool PBOTest::testTexImage(void)
glTexCoord2f(0, 1);
glVertex2f(0, TEXSIZE);
glEnd();
+ glDisable(GL_TEXTURE_2D);
glReadPixels(0, 0, windowSize, windowSize, GL_RGB, GL_FLOAT,
buf);
@@ -773,8 +769,7 @@ bool PBOTest::testTexImage(void)
if (i == 0 && j == 0 && breakCOWTexture
&& useTexUnpackBuffer) {
GLfloat exp[3] = { 0.8, 0.8, 0.8 };
- if (equalColors(&buf[(j * windowSize + i) * 3], exp)
- != true) {
+ if (!equalColors(&buf[(j * windowSize + i) * 3], exp)) {
REPORT_FAILURE("glTexImage failed");
printf(" got (%d, %d) = [%f, %f, %f], ", i, j,
buf[(j * windowSize + i) * 3],
@@ -787,8 +782,7 @@ bool PBOTest::testTexImage(void)
}
}
else if (i < TEXSIZE && j < TEXSIZE) {
- if (equalColors(&buf[(j * windowSize + i) * 3], green)
- != true) {
+ if (!equalColors(&buf[(j * windowSize + i) * 3], green)) {
REPORT_FAILURE("glTexImage failed");
printf(" got (%d, %d) = [%f, %f, %f], ", i, j,
buf[(j * windowSize + i) * 3],
@@ -801,8 +795,7 @@ bool PBOTest::testTexImage(void)
}
}
else {
- if (equalColors(&buf[(j * windowSize + i) * 3], black)
- != true) {
+ if (!equalColors(&buf[(j * windowSize + i) * 3], black)) {
REPORT_FAILURE("glTexImage failed");
printf("(%d, %d) = [%f, %f, %f], ", i, j,
buf[(j * windowSize + i) * 3],
@@ -897,7 +890,7 @@ bool PBOTest::testTexSubImage(void)
for (j = 0; j < windowSize; j++) {
for (i = 0; i < windowSize; i++) {
if (i < 10 && j < 10) {
- if (equalColors(&buf[(j * windowSize + i) * 3], green) != true) {
+ if (!equalColors(&buf[(j * windowSize + i) * 3], green)) {
REPORT_FAILURE("glTexSubImage failed");
printf(" got (%d, %d) = [%f, %f, %f], ", i, j,
buf[(j * windowSize + i) * 3],
@@ -910,7 +903,7 @@ bool PBOTest::testTexSubImage(void)
}
}
else {
- if (equalColors(&buf[(j * windowSize + i) * 3], black) != true) {
+ if (!equalColors(&buf[(j * windowSize + i) * 3], black)) {
REPORT_FAILURE("glTexSubImage failed");
printf("(%d, %d) = [%f, %f, %f], ", i, j,
buf[(j * windowSize + i) * 3],
@@ -1008,6 +1001,7 @@ bool PBOTest::testPolygonStip(void)
}
glEnable(GL_POLYGON_STIPPLE);
+ glColor4f(1.0, 1.0, 1.0, 0.0);
glBegin(GL_POLYGON);
glVertex2f(0, 0);
glVertex2f(10, 0);
@@ -1030,8 +1024,7 @@ bool PBOTest::testPolygonStip(void)
else
exp = white;
if (i < 10 && j < 10) {
- if (equalColors(&buf[(j * windowSize + i) * 3], exp) !=
- true) {
+ if (!equalColors(&buf[(j * windowSize + i) * 3], exp)) {
REPORT_FAILURE("glGetPolygonStipple failed");
printf("(%d, %d) = [%f, %f, %f], ", i, j,
buf[(j * windowSize + i) * 3],
@@ -1042,8 +1035,7 @@ bool PBOTest::testPolygonStip(void)
}
}
else {
- if (equalColors(&buf[(j * windowSize + i) * 3], black) !=
- true) {
+ if (!equalColors(&buf[(j * windowSize + i) * 3], black)) {
REPORT_FAILURE("glGetPolygonStipple failed");
printf("(%d, %d) = [%f, %f, %f], ", i, j,
buf[(j * windowSize + i) * 3],
@@ -1123,11 +1115,12 @@ bool PBOTest::testFunctionality(MultiTestResult & r)
}
enum {
- BLACK,
- RED,
- GREEN,
- BLUE,
-WHITE };
+ BLACK,
+ RED,
+ GREEN,
+ BLUE,
+ WHITE
+};
GLfloat colors1[][4] = {
{0.0, 0.0, 0.0, 0.0},
diff --git a/tests/glean/ttexcombine.cpp b/tests/glean/ttexcombine.cpp
index be9b42112..d4a43c2e6 100644
--- a/tests/glean/ttexcombine.cpp
+++ b/tests/glean/ttexcombine.cpp
@@ -1441,10 +1441,9 @@ TexCombineTest::runOne(BasicResult& r, Window& w) {
// Test the availability of the DOT3 extenstion
haveDot3 = GLUtils::haveExtensions("GL_EXT_texture_env_dot3");
- if (0 == haveDot3)
- haveDot3 = GLUtils::haveExtensions("GL_ARB_texture_env_dot3");
- haveCrossbar = GLUtils::haveExtensions("GL_ARB_texture_env_crossbar");
+ haveCrossbar = GLUtils::haveExtensions("GL_ARB_texture_env_crossbar")
+ && GLUtils::haveExtensions("GL_ARB_texture_env_combine");
// compute RGB error tolerance
{
diff --git a/tests/glean/tvertprog1.cpp b/tests/glean/tvertprog1.cpp
index 32053358d..8d955e1ef 100644
--- a/tests/glean/tvertprog1.cpp
+++ b/tests/glean/tvertprog1.cpp
@@ -1083,10 +1083,10 @@ VertexProgramTest::testBadProgram(MultiTestResult &result)
};
glVertexPointer(3, GL_FLOAT, 0, vertcoords);
- glEnable(GL_VERTEX_ARRAY);
+ glEnableClientState(GL_VERTEX_ARRAY);
glDrawArrays(GL_POLYGON, 0, 4);
err = glGetError();
- glDisable(GL_VERTEX_ARRAY);
+ glDisableClientState(GL_VERTEX_ARRAY);
if (err != GL_INVALID_OPERATION) {
env->log << "Unexpected OpenGL error state " << (int) err <<
@@ -1095,7 +1095,7 @@ VertexProgramTest::testBadProgram(MultiTestResult &result)
result.numFailed++;
while (err != 0)
- glGetError();
+ err = glGetError();
} else {
result.numPassed++;
}
diff --git a/tests/glean/winsys.cpp b/tests/glean/winsys.cpp
index 866bb813a..76216d0ee 100644
--- a/tests/glean/winsys.cpp
+++ b/tests/glean/winsys.cpp
@@ -93,7 +93,7 @@ WindowSystem::WindowSystem(Options& o) {
// constraints provided by the user. (This makes it convenient
// to run tests on just a subset of all available configs.)
DrawingSurfaceFilter f(o.visFilter); // may throw an exception!
- surfConfigs = f.filter(glxv);
+ surfConfigs = f.filter(glxv, o.maxVisuals);
} // WindowSystem::WindowSystem
#elif defined(__WIN__)
@@ -135,7 +135,7 @@ WindowSystem::WindowSystem(Options& o) {
// constraints provided by the user. (This makes it convenient
// to run tests on just a subset of all available configs.)
DrawingSurfaceFilter f(o.visFilter); // may throw an exception!
- surfConfigs = f.filter(glpf);
+ surfConfigs = f.filter(glpf, o.maxVisuals);
}
#elif defined(__BEWIN__)
@@ -150,7 +150,7 @@ WindowSystem::WindowSystem(Options& o) {
glconfigs.push_back(new DrawingSurfaceConfig());
DrawingSurfaceFilter f(o.visFilter); // may throw an exception!
- surfConfigs = f.filter(glconfigs);
+ surfConfigs = f.filter(glconfigs, o.maxVisuals);
}
@@ -201,7 +201,7 @@ WindowSystem::WindowSystem(Options& o) {
// constraints provided by the user. (This makes it convenient
// to run tests on just a subset of all available configs.)
DrawingSurfaceFilter f(o.visFilter); // may throw an exception!
- surfConfigs = f.filter(glpf);
+ surfConfigs = f.filter(glpf, o.maxVisuals);
}
#endif