Framework: Add assert to position deviation image compare
authorMaciej Jesionowski <maciej.jesionowski@mobica.com>
Tue, 29 Nov 2016 12:38:22 +0000 (13:38 +0100)
committerMaciej Jesionowski <maciej.jesionowski@mobica.com>
Tue, 29 Nov 2016 12:38:22 +0000 (13:38 +0100)
When using position deviation tolerance it's easy to forget
about the depth and effectively skip the check for the whole
image.

Change-Id: Ide873be57ba19e7e9e45606d27aae403f9c131ec

framework/common/tcuImageCompare.cpp

index 469b095..fb2412d 100644 (file)
@@ -106,6 +106,7 @@ static int findNumPositionDeviationFailingPixels (const PixelBufferAccess& error
        const int                       endZ                            = (acceptOutOfBoundsAsAnyValue) ? (depth  - maxPositionDeviation.z()) : (depth);
 
        TCU_CHECK_INTERNAL(result.getWidth() == width && result.getHeight() == height && result.getDepth() == depth);
+       DE_ASSERT(endX > 0 && endY > 0 && endZ > 0);    // most likely a bug
 
        tcu::clear(errorMask, okColor);