Check OpenVG support in negative EGL api tests.
authorMika Isojärvi <misojarvi@google.com>
Tue, 26 Jan 2016 19:47:20 +0000 (11:47 -0800)
committerMika Isojärvi <misojarvi@google.com>
Tue, 26 Jan 2016 19:47:20 +0000 (11:47 -0800)
Bug: 25764793
Change-Id: I5a32dec18c68c9a40e9138caede8fccbbdc05f62

modules/egl/teglNegativeApiTests.cpp

index c2b7ebc309f2ec7a85f646afd964c6aab9fde362..6eac350bc23f33d5be72e72ee208f18d7d3df8bb 100644 (file)
@@ -456,24 +456,27 @@ void NegativeApiTests::init (void)
 
                        log << TestLog::EndSection;
 
-                       log << TestLog::Section("Test2", "EGL_BAD_CONFIG or EGL_BAD_PARAMETER is generated if config is not an EGL frame buffer configuration and if buffer is not valid OpenVG image");
+                       if (isAPISupported(EGL_OPENVG_API))
+                       {
+                               log << TestLog::Section("Test2", "EGL_BAD_CONFIG or EGL_BAD_PARAMETER is generated if config is not an EGL frame buffer configuration and if buffer is not valid OpenVG image");
 
-                       expectNoSurface(eglCreatePbufferFromClientBuffer(display, EGL_OPENVG_IMAGE, (EGLClientBuffer)-1, (EGLConfig)-1, DE_NULL));
-                       expectEitherError(EGL_BAD_CONFIG, EGL_BAD_PARAMETER);
+                               expectNoSurface(eglCreatePbufferFromClientBuffer(display, EGL_OPENVG_IMAGE, (EGLClientBuffer)-1, (EGLConfig)-1, DE_NULL));
+                               expectEitherError(EGL_BAD_CONFIG, EGL_BAD_PARAMETER);
 
-                       log << TestLog::EndSection;
+                               log << TestLog::EndSection;
 
-                       log << TestLog::Section("Test3", "EGL_BAD_PARAMETER is generated if buftype is not EGL_OPENVG_IMAGE");
+                               log << TestLog::Section("Test3", "EGL_BAD_PARAMETER is generated if buftype is not EGL_OPENVG_IMAGE");
 
-                       log << TestLog::EndSection;
+                               expectTrue(eglGetConfigs(display, &anyConfig, 1, &unused));
 
-                       expectTrue(eglGetConfigs(display, &anyConfig, 1, &unused));
+                               log << TestLog::EndSection;
 
-                       log << TestLog::Section("Test4", "EGL_BAD_PARAMETER is generated if buffer is not valid OpenVG image");
-                       expectNoSurface(eglCreatePbufferFromClientBuffer(display, EGL_OPENVG_IMAGE, (EGLClientBuffer)-1, anyConfig, DE_NULL));
-                       expectError(EGL_BAD_PARAMETER);
+                               log << TestLog::Section("Test4", "EGL_BAD_PARAMETER is generated if buffer is not valid OpenVG image");
+                               expectNoSurface(eglCreatePbufferFromClientBuffer(display, EGL_OPENVG_IMAGE, (EGLClientBuffer)-1, anyConfig, DE_NULL));
+                               expectError(EGL_BAD_PARAMETER);
 
-                       log << TestLog::EndSection;
+                               log << TestLog::EndSection;
+                       }
                });
 
        static const EGLint s_validGenericPbufferAttrib[] = { EGL_WIDTH, 64, EGL_HEIGHT, 64, EGL_NONE };