ext_gpu_shader4: add compiler tests for everything
[piglit.git] / tests / spec / ext_semaphore_fd / api-errors.c
blob2a1414e5044d31edb99a06c0b38d914c88c31535
1 /*
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
13 * Software.
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.
24 /**
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)
36 GLuint sem;
37 int fd = -1;
39 glGenSemaphoresEXT(1, &sem);
41 /**
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",
53 "bad-enum",
54 test_import_semaphore_fd_enum_errors,
55 NULL,
57 { NULL },
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
71 enum piglit_result
72 piglit_display(void)
74 enum piglit_result result = PIGLIT_PASS;
76 result = piglit_run_selected_subtests(
77 tests,
78 piglit_config->selected_subtests,
79 piglit_config->num_selected_subtests,
80 result);
82 return result;
86 void
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");