xref: /aosp_15_r20/external/angle/src/tests/egl_tests/EGLNoErrorTest.cpp (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
1 //
2 // Copyright 2024 The ANGLE Project Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5 //
6 // EGLNoErrorTest.cpp:
7 //   Tests for the EGL extension EGL_ANGLE_no_error
8 //
9 
10 #include <gtest/gtest.h>
11 
12 #include "test_utils/ANGLETest.h"
13 
14 using namespace angle;
15 
16 class EGLNoErrorTest : public ANGLETest<>
17 {};
18 
19 // Validation errors become undefined behavour with this extension. Simply test turning validation
20 // off and on.
TEST_P(EGLNoErrorTest,EnableDisable)21 TEST_P(EGLNoErrorTest, EnableDisable)
22 {
23     if (IsEGLClientExtensionEnabled("EGL_ANGLE_no_error"))
24     {
25         eglSetValidationEnabledANGLE(EGL_FALSE);
26         eglSetValidationEnabledANGLE(EGL_TRUE);
27         EXPECT_EGL_ERROR(EGL_SUCCESS);
28     }
29     else
30     {
31         eglSetValidationEnabledANGLE(EGL_FALSE);
32         EXPECT_EGL_ERROR(EGL_BAD_ACCESS);
33     }
34 }
35 
36 GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(EGLNoErrorTest);
37 ANGLE_INSTANTIATE_TEST(EGLNoErrorTest,
38                        ES2_D3D9(),
39                        ES2_D3D11(),
40                        ES3_D3D11(),
41                        ES2_OPENGL(),
42                        ES3_OPENGL(),
43                        ES2_VULKAN());
44