Fix uninitialized values in vertex array tests
authorMika Isojärvi <misojarvi@google.com>
Tue, 9 Jun 2015 17:59:48 +0000 (10:59 -0700)
committerMika Isojärvi <misojarvi@google.com>
Tue, 9 Jun 2015 21:39:25 +0000 (14:39 -0700)
Change-Id: I8a789177a2c74eec766dbff4962f869773fb9372

modules/glshared/glsVertexArrayTests.cpp

index 71bba458830729c077b9f1a5d601012b178a6387..54cb85582526ebfa5c34928d272fd5ece365e3fb 100644 (file)
@@ -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)) ||