From 545d74e83cff0800c8d65adf1812768745b7ec60 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mika=20Isoj=C3=A4rvi?= Date: Tue, 9 Jun 2015 10:59:48 -0700 Subject: [PATCH] Fix uninitialized values in vertex array tests Change-Id: I8a789177a2c74eec766dbff4962f869773fb9372 --- modules/glshared/glsVertexArrayTests.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/modules/glshared/glsVertexArrayTests.cpp b/modules/glshared/glsVertexArrayTests.cpp index 71bba45..54cb855 100644 --- a/modules/glshared/glsVertexArrayTests.cpp +++ b/modules/glshared/glsVertexArrayTests.cpp @@ -1817,14 +1817,21 @@ void VertexArrayTest::compare (void) m_isOk = true; - for (int y = 1; y < ref.getHeight()-1; y++) + for (int y = 0; y < ref.getHeight(); y++) { - for (int x = 1; x < ref.getWidth()-1; x++) + for (int x = 0; x < ref.getWidth(); x++) { tcu::RGBA refPixel = ref.getPixel(x, y); tcu::RGBA screenPixel = screen.getPixel(x, y); bool isOkPixel = false; + if (y == 0 || y + 1 == ref.getHeight() || x == 0 || x + 1 == ref.getWidth()) + { + // Don't check borders since the pixel neighborhood is undefined + error.setPixel(x, y, tcu::RGBA(screenPixel.getRed(), (screenPixel.getGreen() + 255) / 2, screenPixel.getBlue(), 255)); + continue; + } + // Don't do comparisons for this pixel if it belongs to a one-pixel-thin part (i.e. it doesn't have similar-color neighbors in both x and y directions) in both result and reference. // This fixes some false negatives. bool refThin = (!tcu::compareThreshold(refPixel, ref.getPixel(x-1, y ), threshold) && !tcu::compareThreshold(refPixel, ref.getPixel(x+1, y ), threshold)) || -- 2.7.4