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_memory_object_fd extension.
29 #include "piglit-util-gl.h"
31 PIGLIT_GL_TEST_CONFIG_BEGIN
33 config
.supports_gl_compat_version
= 10;
34 config
.window_visual
= PIGLIT_GL_VISUAL_RGBA
| PIGLIT_GL_VISUAL_DOUBLE
;
35 config
.khr_no_error_support
= PIGLIT_HAS_ERRORS
;
37 PIGLIT_GL_TEST_CONFIG_END
40 test_import_memory_object_fd_enum_errors()
45 glCreateMemoryObjectsEXT(1, &mem
);
48 * The spec does not define any errors for ImportMemoryFdEXT,
49 * but we should at least make sure this doesn't succeed.
51 glImportMemoryFdEXT(mem
, 1, GL_NONE
, fd
);
53 return piglit_check_gl_error(GL_INVALID_ENUM
);
58 const bool subtest_pass = (f); \
59 piglit_report_subtest_result(subtest_pass \
60 ? PIGLIT_PASS : PIGLIT_FAIL, \
62 pass = pass && subtest_pass; \
70 X(test_import_memory_object_fd_enum_errors(), "import-memory-object-fd-bad-enum");
72 return pass
? PIGLIT_PASS
: PIGLIT_FAIL
;
77 piglit_init(int argc
, char **argv
)
79 /* From the EXT_external_objects_fd spec:
81 * "GL_EXT_memory_object_fd requires GL_EXT_memory_object"
83 piglit_require_extension("GL_EXT_memory_object");
84 piglit_require_extension("GL_EXT_memory_object_fd");