2 * Copyright (c) 2017 Valve Corporation
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to
6 * deal in the Software without restriction, including without limitation on
7 * the rights to use, copy, modify, merge, publish, distribute, sub license,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS AND/OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
19 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE.
25 * Tests that api errors are thrown where expected for the
26 * GL_EXT_semaphore_fd extension.
29 #include "piglit-util-gl.h"
31 static const struct piglit_gl_test_config
* piglit_config
;
33 static enum piglit_result
34 test_import_semaphore_fd_enum_errors(void * unused
)
39 glGenSemaphoresEXT(1, &sem
);
42 * The spec does not define any errors for ImportSemaphoreFdEXT,
43 * but we should at least make sure this doesn't succeed.
45 glImportSemaphoreFdEXT(sem
, GL_NONE
, fd
);
47 return piglit_check_gl_error(GL_INVALID_ENUM
) ? PIGLIT_PASS
: PIGLIT_FAIL
;
50 static const struct piglit_subtest tests
[] = {
52 "import-semaphore-fd-bad-enum",
54 test_import_semaphore_fd_enum_errors
,
61 PIGLIT_GL_TEST_CONFIG_BEGIN
63 piglit_config
= &config
;
64 config
.subtests
= tests
;
65 config
.supports_gl_compat_version
= 10;
66 config
.window_visual
= PIGLIT_GL_VISUAL_RGBA
| PIGLIT_GL_VISUAL_DOUBLE
;
67 config
.khr_no_error_support
= PIGLIT_HAS_ERRORS
;
69 PIGLIT_GL_TEST_CONFIG_END
74 enum piglit_result result
= PIGLIT_PASS
;
76 result
= piglit_run_selected_subtests(
78 piglit_config
->selected_subtests
,
79 piglit_config
->num_selected_subtests
,
87 piglit_init(int argc
, char **argv
)
89 /* From the EXT_external_objects_fd spec:
91 * "GL_EXT_semaphore_fd requires GL_EXT_semaphore"
93 piglit_require_extension("GL_EXT_semaphore");
94 piglit_require_extension("GL_EXT_semaphore_fd");