2 * Copyright (c) 2017 Timothy Arceri
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * on the rights to use, copy, modify, merge, publish, distribute, sub
8 * license, and/or sell copies of the Software, and to permit persons to whom
9 * the 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,
16 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 * NON-INFRINGEMENT. IN NO EVENT SHALL VMWARE AND/OR THEIR SUPPLIERS
19 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26 * Tests that api errors are thrown where expected for the
27 * GL_EXT_memory_object extension.
30 #include "piglit-util-gl.h"
32 PIGLIT_GL_TEST_CONFIG_BEGIN
34 config
.supports_gl_compat_version
= 20; /* Need 2.0 for DSA tests */
35 config
.window_visual
= PIGLIT_GL_VISUAL_RGBA
| PIGLIT_GL_VISUAL_DOUBLE
;
36 config
.khr_no_error_support
= PIGLIT_HAS_ERRORS
;
38 PIGLIT_GL_TEST_CONFIG_END
42 test_gen_semaphores_value_errors()
46 glGenSemaphoresEXT(-1, &sem
);
48 return piglit_check_gl_error(GL_INVALID_VALUE
);
52 test_delete_semaphores_value_errors()
56 glDeleteSemaphoresEXT(-1, &sem
);
58 return piglit_check_gl_error(GL_INVALID_VALUE
);
62 test_semaphore_parameter_enum_errors()
67 glGenSemaphoresEXT(1, &sem
);
70 * The spec does not define any valid parameters
71 * in EXT_external_objects or in EXT_external_objects_fd
73 glSemaphoreParameterui64vEXT(0, sem
, ¶m
);
75 return piglit_check_gl_error(GL_INVALID_ENUM
);
79 test_get_semaphore_parameter_enum_errors()
84 glGenSemaphoresEXT(1, &sem
);
85 glGetSemaphoreParameterui64vEXT(0, sem
, ¶m
);
87 return piglit_check_gl_error(GL_INVALID_ENUM
);
92 const bool subtest_pass = (f); \
93 piglit_report_subtest_result(subtest_pass \
94 ? PIGLIT_PASS : PIGLIT_FAIL, \
96 pass = pass && subtest_pass; \
105 X(test_gen_semaphores_value_errors(), "gen-semaphores-bad-value");
106 X(test_delete_semaphores_value_errors(), "delete-semaphores-bad-value");
107 X(test_semaphore_parameter_enum_errors(), "semaphore-parameter-bad-enum");
108 X(test_get_semaphore_parameter_enum_errors(), "get-semaphore-parameter-bad-enum");
110 return pass
? PIGLIT_PASS
: PIGLIT_FAIL
;
115 piglit_init(int argc
, char **argv
)
117 piglit_require_extension("GL_EXT_semaphore");