Check that glReadnPixels() is supported in negative tests
authorMika Isojärvi <misojarvi@google.com>
Thu, 10 Mar 2016 21:36:52 +0000 (13:36 -0800)
committerMika Isojärvi <misojarvi@google.com>
Thu, 10 Mar 2016 21:39:51 +0000 (13:39 -0800)
Bug: 27536300
Change-Id: Id7b52bbaa0c635b9b4f0a8060a17fc304fdc453f

modules/gles31/functional/es31fNegativeBufferApiTests.cpp

index 3d9871e..509d48c 100644 (file)
@@ -199,6 +199,13 @@ void readn_pixels (NegativeTestContext& ctx)
        std::vector<GLubyte>    ubyteData       (4);
        GLuint                                  fbo                     = 0x1234;
 
+       if (!contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2))
+               && !ctx.isExtensionSupported("GL_KHR_robustness")
+               && !ctx.isExtensionSupported("GL_EXT_robustness"))
+       {
+               TCU_THROW(NotSupportedError, "GLES 3.2 or robustness extension not supported");
+       }
+
        ctx.beginSection("GL_INVALID_OPERATION is generated if the combination of format and type is unsupported.");
        ctx.glReadnPixels(0, 0, 1, 1, GL_LUMINANCE_ALPHA, GL_UNSIGNED_SHORT_4_4_4_4, (int) ubyteData.size(), &ubyteData[0]);
        ctx.expectError(GL_INVALID_OPERATION);