framework/replay: disable AA accounting when comparing with no tolerance
[piglit.git] / tests / spec / ext_external_objects / semaphore-api-errors.c
blobe20276a5f0a9ac5d0efa0e34fd3579ad6f0ba0ef
1 /*
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
13 * Software.
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
22 * SOFTWARE.
25 /**
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
41 static bool
42 test_gen_semaphores_value_errors()
44 GLuint sem;
46 glGenSemaphoresEXT(-1, &sem);
48 return piglit_check_gl_error(GL_INVALID_VALUE);
51 static bool
52 test_delete_semaphores_value_errors()
54 GLuint sem;
56 glDeleteSemaphoresEXT(-1, &sem);
58 return piglit_check_gl_error(GL_INVALID_VALUE);
61 static bool
62 test_semaphore_parameter_enum_errors()
64 GLuint sem;
65 GLuint64 param;
67 glGenSemaphoresEXT(1, &sem);
69 /**
70 * The spec does not define any valid parameters
71 * in EXT_external_objects or in EXT_external_objects_fd
73 glSemaphoreParameterui64vEXT(0, sem, &param);
75 return piglit_check_gl_error(GL_INVALID_ENUM);
78 static bool
79 test_get_semaphore_parameter_enum_errors()
81 GLuint sem;
82 GLuint64 param;
84 glGenSemaphoresEXT(1, &sem);
85 glGetSemaphoreParameterui64vEXT(0, sem, &param);
87 return piglit_check_gl_error(GL_INVALID_ENUM);
90 #define X(f, desc) \
91 do { \
92 const bool subtest_pass = (f); \
93 piglit_report_subtest_result(subtest_pass \
94 ? PIGLIT_PASS : PIGLIT_FAIL, \
95 (desc)); \
96 pass = pass && subtest_pass; \
97 } while (0)
100 enum piglit_result
101 piglit_display(void)
103 bool pass = true;
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;
114 void
115 piglit_init(int argc, char **argv)
117 piglit_require_extension("GL_EXT_semaphore");