1/*------------------------------------------------------------------------- 2 * drawElements Quality Program OpenGL ES 3.0 Module 3 * ------------------------------------------------- 4 * 5 * Copyright 2014 The Android Open Source Project 6 * 7 * Licensed under the Apache License, Version 2.0 (the "License"); 8 * you may not use this file except in compliance with the License. 9 * You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, software 14 * distributed under the License is distributed on an "AS IS" BASIS, 15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 * See the License for the specific language governing permissions and 17 * limitations under the License. 18 * 19 *//*! 20 * \file 21 * \brief Negative Fragment Pipe API tests. 22 *//*--------------------------------------------------------------------*/ 23 24#include "es3fNegativeFragmentApiTests.hpp" 25#include "es3fApiCase.hpp" 26 27#include "gluContextInfo.hpp" 28#include "glwDefs.hpp" 29#include "glwEnums.hpp" 30 31using namespace glw; // GL types 32 33namespace deqp 34{ 35namespace gles3 36{ 37namespace Functional 38{ 39 40using tcu::TestLog; 41 42static bool checkDrawBuffersIndexedSupport(Context& ctx) 43{ 44 return contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)) || 45 contextSupports(ctx.getRenderContext().getType(), glu::ApiType::core(4, 5)) || 46 ctx.getContextInfo().isExtensionSupported("GL_EXT_draw_buffers_indexed"); 47} 48 49NegativeFragmentApiTests::NegativeFragmentApiTests (Context& context) 50 : TestCaseGroup(context, "fragment", "Negative Fragment API Cases") 51{ 52} 53 54NegativeFragmentApiTests::~NegativeFragmentApiTests (void) 55{ 56} 57 58void NegativeFragmentApiTests::init (void) 59{ 60 ES3F_ADD_API_CASE(scissor, "Invalid glScissor() usage", 61 { 62 m_log << TestLog::Section("", "GL_INVALID_VALUE is generated if either width or height is negative."); 63 glScissor(0, 0, -1, 0); 64 expectError(GL_INVALID_VALUE); 65 glScissor(0, 0, 0, -1); 66 expectError(GL_INVALID_VALUE); 67 glScissor(0, 0, -1, -1); 68 expectError(GL_INVALID_VALUE); 69 m_log << TestLog::EndSection; 70 }); 71 ES3F_ADD_API_CASE(depth_func, "Invalid glDepthFunc() usage", 72 { 73 m_log << TestLog::Section("", "GL_INVALID_ENUM is generated if func is not an accepted value."); 74 glDepthFunc(-1); 75 expectError(GL_INVALID_ENUM); 76 m_log << TestLog::EndSection; 77 }); 78 ES3F_ADD_API_CASE(viewport, "Invalid glViewport() usage", 79 { 80 m_log << TestLog::Section("", "GL_INVALID_VALUE is generated if either width or height is negative."); 81 glViewport(0, 0, -1, 1); 82 expectError(GL_INVALID_VALUE); 83 glViewport(0, 0, 1, -1); 84 expectError(GL_INVALID_VALUE); 85 glViewport(0, 0, -1, -1); 86 expectError(GL_INVALID_VALUE); 87 m_log << TestLog::EndSection; 88 }); 89 90 // Stencil functions 91 92 ES3F_ADD_API_CASE(stencil_func, "Invalid glStencilFunc() usage", 93 { 94 m_log << TestLog::Section("", "GL_INVALID_ENUM is generated if func is not one of the eight accepted values."); 95 glStencilFunc(-1, 0, 1); 96 expectError(GL_INVALID_ENUM); 97 m_log << TestLog::EndSection; 98 }); 99 ES3F_ADD_API_CASE(stencil_func_separate, "Invalid glStencilFuncSeparate() usage", 100 { 101 m_log << TestLog::Section("", "GL_INVALID_ENUM is generated if face is not GL_FRONT, GL_BACK, or GL_FRONT_AND_BACK."); 102 glStencilFuncSeparate(-1, GL_NEVER, 0, 1); 103 expectError(GL_INVALID_ENUM); 104 m_log << TestLog::EndSection; 105 106 m_log << TestLog::Section("", "GL_INVALID_ENUM is generated if func is not one of the eight accepted values."); 107 glStencilFuncSeparate(GL_FRONT, -1, 0, 1); 108 expectError(GL_INVALID_ENUM); 109 m_log << TestLog::EndSection; 110 }); 111 ES3F_ADD_API_CASE(stencil_op, "Invalid glStencilOp() usage", 112 { 113 m_log << TestLog::Section("", "GL_INVALID_ENUM is generated if sfail, dpfail, or dppass is any value other than the defined symbolic constant values."); 114 glStencilOp(-1, GL_ZERO, GL_REPLACE); 115 expectError(GL_INVALID_ENUM); 116 glStencilOp(GL_KEEP, -1, GL_REPLACE); 117 expectError(GL_INVALID_ENUM); 118 glStencilOp(GL_KEEP, GL_ZERO, -1); 119 expectError(GL_INVALID_ENUM); 120 m_log << TestLog::EndSection; 121 }); 122 ES3F_ADD_API_CASE(stencil_op_separate, "Invalid glStencilOpSeparate() usage", 123 { 124 m_log << TestLog::Section("", "GL_INVALID_ENUM is generated if face is any value other than GL_FRONT, GL_BACK, or GL_FRONT_AND_BACK."); 125 glStencilOpSeparate(-1, GL_KEEP, GL_ZERO, GL_REPLACE); 126 expectError(GL_INVALID_ENUM); 127 m_log << TestLog::EndSection; 128 129 m_log << TestLog::Section("", "GL_INVALID_ENUM is generated if sfail, dpfail, or dppass is any value other than the eight defined symbolic constant values."); 130 glStencilOpSeparate(GL_FRONT, -1, GL_ZERO, GL_REPLACE); 131 expectError(GL_INVALID_ENUM); 132 glStencilOpSeparate(GL_FRONT, GL_KEEP, -1, GL_REPLACE); 133 expectError(GL_INVALID_ENUM); 134 glStencilOpSeparate(GL_FRONT, GL_KEEP, GL_ZERO, -1); 135 expectError(GL_INVALID_ENUM); 136 m_log << TestLog::EndSection; 137 }); 138 ES3F_ADD_API_CASE(stencil_mask_separate, "Invalid glStencilMaskSeparate() usage", 139 { 140 m_log << TestLog::Section("", "GL_INVALID_ENUM is generated if face is not GL_FRONT, GL_BACK, or GL_FRONT_AND_BACK."); 141 glStencilMaskSeparate(-1, 0); 142 expectError(GL_INVALID_ENUM); 143 m_log << TestLog::EndSection; 144 }); 145 146 // Blend functions 147 148 ES3F_ADD_API_CASE(blend_equation, "Invalid glBlendEquation() usage", 149 { 150 m_log << TestLog::Section("", "GL_INVALID_ENUM is generated if mode is not GL_FUNC_ADD, GL_FUNC_SUBTRACT, GL_FUNC_REVERSE_SUBTRACT, GL_MAX or GL_MIN."); 151 glBlendEquation(-1); 152 expectError(GL_INVALID_ENUM); 153 m_log << TestLog::EndSection; 154 }); 155 ES3F_ADD_API_CASE(blend_equation_separate, "Invalid glBlendEquationSeparate() usage", 156 { 157 m_log << TestLog::Section("", "GL_INVALID_ENUM is generated if modeRGB is not GL_FUNC_ADD, GL_FUNC_SUBTRACT, GL_FUNC_REVERSE_SUBTRACT, GL_MAX or GL_MIN."); 158 glBlendEquationSeparate(-1, GL_FUNC_ADD); 159 expectError(GL_INVALID_ENUM); 160 m_log << TestLog::EndSection; 161 m_log << TestLog::Section("", "GL_INVALID_ENUM is generated if modeAlpha is not GL_FUNC_ADD, GL_FUNC_SUBTRACT, GL_FUNC_REVERSE_SUBTRACT, GL_MAX or GL_MIN."); 162 glBlendEquationSeparate(GL_FUNC_ADD, -1); 163 expectError(GL_INVALID_ENUM); 164 m_log << TestLog::EndSection; 165 }); 166 ES3F_ADD_API_CASE(blend_func, "Invalid glBlendFunc() usage", 167 { 168 m_log << TestLog::Section("", "GL_INVALID_ENUM is generated if either sfactor or dfactor is not an accepted value."); 169 glBlendFunc(-1, GL_ONE); 170 expectError(GL_INVALID_ENUM); 171 glBlendFunc(GL_ONE, -1); 172 expectError(GL_INVALID_ENUM); 173 m_log << TestLog::EndSection; 174 }); 175 ES3F_ADD_API_CASE(blend_func_separate, "Invalid glBlendFuncSeparate() usage", 176 { 177 m_log << TestLog::Section("", "GL_INVALID_ENUM is generated if srcRGB, dstRGB, srcAlpha, or dstAlpha is not an accepted value."); 178 glBlendFuncSeparate(-1, GL_ONE, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR); 179 expectError(GL_INVALID_ENUM); 180 glBlendFuncSeparate(GL_ZERO, -1, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR); 181 expectError(GL_INVALID_ENUM); 182 glBlendFuncSeparate(GL_ZERO, GL_ONE, -1, GL_ONE_MINUS_SRC_COLOR); 183 expectError(GL_INVALID_ENUM); 184 glBlendFuncSeparate(GL_ZERO, GL_ONE, GL_SRC_COLOR, -1); 185 expectError(GL_INVALID_ENUM); 186 m_log << TestLog::EndSection; 187 }); 188 ES3F_ADD_API_CASE(blend_equationi, "Invalid glBlendEquationi() usage", 189 { 190 glw::GLint maxDrawBuffers = -1; 191 glGetIntegerv(GL_MAX_DRAW_BUFFERS, &maxDrawBuffers); 192 if (!checkDrawBuffersIndexedSupport(m_context)) 193 throw tcu::NotSupportedError("GL_EXT_draw_buffers_indexed is not supported", DE_NULL, __FILE__, __LINE__); 194 m_log << TestLog::Section("", "GL_INVALID_ENUM is generated if mode is not GL_FUNC_ADD, GL_FUNC_SUBTRACT, GL_FUNC_REVERSE_SUBTRACT, GL_MAX or GL_MIN."); 195 glBlendEquationi(0, -1); 196 expectError(GL_INVALID_ENUM); 197 m_log << TestLog::EndSection; 198 m_log << TestLog::Section("", "GL_INVALID_VALUE is generated if buf is not in the range zero to the value of MAX_DRAW_BUFFERS minus one."); 199 glBlendEquationi(-1, GL_FUNC_ADD); 200 expectError(GL_INVALID_VALUE); 201 glBlendEquationi(maxDrawBuffers, GL_FUNC_ADD); 202 expectError(GL_INVALID_VALUE); 203 m_log << TestLog::EndSection; 204 }); 205 ES3F_ADD_API_CASE(blend_equation_separatei, "Invalid glBlendEquationSeparatei() usage", 206 { 207 glw::GLint maxDrawBuffers = -1; 208 glGetIntegerv(GL_MAX_DRAW_BUFFERS, &maxDrawBuffers); 209 if (!checkDrawBuffersIndexedSupport(m_context)) 210 throw tcu::NotSupportedError("GL_EXT_draw_buffers_indexed is not supported", DE_NULL, __FILE__, __LINE__); 211 m_log << TestLog::Section("", "GL_INVALID_ENUM is generated if modeRGB is not GL_FUNC_ADD, GL_FUNC_SUBTRACT, GL_FUNC_REVERSE_SUBTRACT, GL_MAX or GL_MIN."); 212 glBlendEquationSeparatei(0, -1, GL_FUNC_ADD); 213 expectError(GL_INVALID_ENUM); 214 m_log << TestLog::EndSection; 215 m_log << TestLog::Section("", "GL_INVALID_ENUM is generated if modeAlpha is not GL_FUNC_ADD, GL_FUNC_SUBTRACT, GL_FUNC_REVERSE_SUBTRACT, GL_MAX or GL_MIN."); 216 glBlendEquationSeparatei(0, GL_FUNC_ADD, -1); 217 expectError(GL_INVALID_ENUM); 218 m_log << TestLog::EndSection; 219 m_log << TestLog::Section("", "GL_INVALID_VALUE is generated if buf is not in the range zero to the value of MAX_DRAW_BUFFERS minus one."); 220 glBlendEquationSeparatei(-1, GL_FUNC_ADD, GL_FUNC_ADD); 221 expectError(GL_INVALID_VALUE); 222 glBlendEquationSeparatei(maxDrawBuffers, GL_FUNC_ADD, GL_FUNC_ADD); 223 expectError(GL_INVALID_VALUE); 224 m_log << TestLog::EndSection; 225 }); 226 ES3F_ADD_API_CASE(blend_funci, "Invalid glBlendFunci() usage", 227 { 228 glw::GLint maxDrawBuffers = -1; 229 glGetIntegerv(GL_MAX_DRAW_BUFFERS, &maxDrawBuffers); 230 if (!checkDrawBuffersIndexedSupport(m_context)) 231 throw tcu::NotSupportedError("GL_EXT_draw_buffers_indexed is not supported", DE_NULL, __FILE__, __LINE__); 232 m_log << TestLog::Section("", "GL_INVALID_ENUM is generated if either sfactor or dfactor is not an accepted value."); 233 glBlendFunci(0, -1, GL_ONE); 234 expectError(GL_INVALID_ENUM); 235 glBlendFunci(0, GL_ONE, -1); 236 expectError(GL_INVALID_ENUM); 237 m_log << TestLog::EndSection; 238 m_log << TestLog::Section("", "GL_INVALID_VALUE is generated if buf is not in the range zero to the value of MAX_DRAW_BUFFERS minus one."); 239 glBlendFunci(-1, GL_ONE, GL_ONE); 240 expectError(GL_INVALID_VALUE); 241 glBlendFunci(maxDrawBuffers, GL_ONE, GL_ONE); 242 expectError(GL_INVALID_VALUE); 243 m_log << TestLog::EndSection; 244 }); 245 ES3F_ADD_API_CASE(blend_func_separatei, "Invalid glBlendFuncSeparatei() usage", 246 { 247 glw::GLint maxDrawBuffers = -1; 248 glGetIntegerv(GL_MAX_DRAW_BUFFERS, &maxDrawBuffers); 249 if (!checkDrawBuffersIndexedSupport(m_context)) 250 throw tcu::NotSupportedError("GL_EXT_draw_buffers_indexed is not supported", DE_NULL, __FILE__, __LINE__); 251 m_log << TestLog::Section("", "GL_INVALID_ENUM is generated if srcRGB, dstRGB, srcAlpha, or dstAlpha is not an accepted value."); 252 glBlendFuncSeparatei(0, -1, GL_ONE, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR); 253 expectError(GL_INVALID_ENUM); 254 glBlendFuncSeparatei(0, GL_ZERO, -1, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR); 255 expectError(GL_INVALID_ENUM); 256 glBlendFuncSeparatei(0, GL_ZERO, GL_ONE, -1, GL_ONE_MINUS_SRC_COLOR); 257 expectError(GL_INVALID_ENUM); 258 glBlendFuncSeparatei(0, GL_ZERO, GL_ONE, GL_SRC_COLOR, -1); 259 expectError(GL_INVALID_ENUM); 260 m_log << TestLog::EndSection; 261 m_log << TestLog::Section("", "GL_INVALID_VALUE is generated if buf is not in the range zero to the value of MAX_DRAW_BUFFERS minus one."); 262 glBlendFuncSeparatei(-1, GL_ONE, GL_ONE, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR); 263 expectError(GL_INVALID_VALUE); 264 glBlendFuncSeparatei(maxDrawBuffers, GL_ONE, GL_ONE, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR); 265 expectError(GL_INVALID_VALUE); 266 m_log << TestLog::EndSection; 267 }); 268 269 // Rasterization API functions 270 271 ES3F_ADD_API_CASE(cull_face, "Invalid glCullFace() usage", 272 { 273 m_log << TestLog::Section("", "GL_INVALID_ENUM is generated if mode is not an accepted value."); 274 glCullFace(-1); 275 expectError(GL_INVALID_ENUM); 276 m_log << TestLog::EndSection; 277 }); 278 ES3F_ADD_API_CASE(front_face, "Invalid glFrontFace() usage", 279 { 280 m_log << TestLog::Section("", "GL_INVALID_ENUM is generated if mode is not an accepted value."); 281 glFrontFace(-1); 282 expectError(GL_INVALID_ENUM); 283 m_log << TestLog::EndSection; 284 }); 285 ES3F_ADD_API_CASE(line_width, "Invalid glLineWidth() usage", 286 { 287 m_log << TestLog::Section("", "GL_INVALID_VALUE is generated if width is less than or equal to 0."); 288 glLineWidth(0); 289 expectError(GL_INVALID_VALUE); 290 glLineWidth(-1); 291 expectError(GL_INVALID_VALUE); 292 m_log << TestLog::EndSection; 293 }); 294 295 // Asynchronous queries 296 297 ES3F_ADD_API_CASE(gen_queries, "Invalid glGenQueries() usage", 298 { 299 m_log << TestLog::Section("", "GL_INVALID_VALUE is generated if n is negative."); 300 GLuint ids; 301 glGenQueries (-1, &ids); 302 expectError (GL_INVALID_VALUE); 303 m_log << TestLog::EndSection; 304 }); 305 ES3F_ADD_API_CASE(begin_query, "Invalid glBeginQuery() usage", 306 { 307 GLuint ids[3]; 308 glGenQueries (3, ids); 309 310 m_log << TestLog::Section("", "GL_INVALID_ENUM is generated if target is not one of the accepted tokens."); 311 glBeginQuery (-1, ids[0]); 312 expectError (GL_INVALID_ENUM); 313 m_log << TestLog::EndSection; 314 315 m_log << TestLog::Section("", "GL_INVALID_OPERATION is generated if glBeginQuery is executed while a query object of the same target is already active."); 316 glBeginQuery (GL_ANY_SAMPLES_PASSED, ids[0]); 317 expectError (GL_NO_ERROR); 318 glBeginQuery (GL_ANY_SAMPLES_PASSED, ids[1]); 319 expectError (GL_INVALID_OPERATION); 320 // \note GL_ANY_SAMPLES_PASSED and GL_ANY_SAMPLES_PASSED_CONSERVATIVE alias to the same target for the purposes of this error. 321 glBeginQuery (GL_ANY_SAMPLES_PASSED_CONSERVATIVE, ids[1]); 322 expectError (GL_INVALID_OPERATION); 323 glBeginQuery (GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, ids[1]); 324 expectError (GL_NO_ERROR); 325 glBeginQuery (GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, ids[2]); 326 expectError (GL_INVALID_OPERATION); 327 glEndQuery (GL_ANY_SAMPLES_PASSED); 328 glEndQuery (GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN); 329 expectError (GL_NO_ERROR); 330 m_log << TestLog::EndSection; 331 332 m_log << TestLog::Section("", "GL_INVALID_OPERATION is generated if id is 0."); 333 glBeginQuery (GL_ANY_SAMPLES_PASSED, 0); 334 expectError (GL_INVALID_OPERATION); 335 m_log << TestLog::EndSection; 336 337 m_log << TestLog::Section("", "GL_INVALID_OPERATION is generated if id not a name returned from a previous call to glGenQueries, or if such a name has since been deleted with glDeleteQueries."); 338 glBeginQuery (GL_ANY_SAMPLES_PASSED, -1); 339 expectError (GL_INVALID_OPERATION); 340 glDeleteQueries (1, &ids[2]); 341 expectError (GL_NO_ERROR); 342 glBeginQuery (GL_ANY_SAMPLES_PASSED, ids[2]); 343 expectError (GL_INVALID_OPERATION); 344 m_log << TestLog::EndSection; 345 346 m_log << TestLog::Section("", "GL_INVALID_OPERATION is generated if id is the name of an already active query object."); 347 glBeginQuery (GL_ANY_SAMPLES_PASSED, ids[0]); 348 expectError (GL_NO_ERROR); 349 glBeginQuery (GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, ids[0]); 350 expectError (GL_INVALID_OPERATION); 351 m_log << TestLog::EndSection; 352 353 m_log << TestLog::Section("", "GL_INVALID_OPERATION is generated if id refers to an existing query object whose type does not does not match target."); 354 glEndQuery (GL_ANY_SAMPLES_PASSED); 355 expectError (GL_NO_ERROR); 356 glBeginQuery (GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, ids[0]); 357 expectError (GL_INVALID_OPERATION); 358 m_log << TestLog::EndSection; 359 360 glDeleteQueries (2, &ids[0]); 361 expectError (GL_NO_ERROR); 362 }); 363 ES3F_ADD_API_CASE(end_query, "Invalid glEndQuery() usage", 364 { 365 GLuint id; 366 glGenQueries (1, &id); 367 368 m_log << TestLog::Section("", "GL_INVALID_ENUM is generated if target is not one of the accepted tokens."); 369 glEndQuery (-1); 370 expectError (GL_INVALID_ENUM); 371 m_log << TestLog::EndSection; 372 373 m_log << TestLog::Section("", "GL_INVALID_OPERATION is generated if glEndQuery is executed when a query object of the same target is not active."); 374 glEndQuery (GL_ANY_SAMPLES_PASSED); 375 expectError (GL_INVALID_OPERATION); 376 glBeginQuery (GL_ANY_SAMPLES_PASSED, id); 377 expectError (GL_NO_ERROR); 378 glEndQuery (GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN); 379 expectError (GL_INVALID_OPERATION); 380 glEndQuery (GL_ANY_SAMPLES_PASSED); 381 expectError (GL_NO_ERROR); 382 m_log << TestLog::EndSection; 383 384 glDeleteQueries (1, &id); 385 expectError (GL_NO_ERROR); 386 }); 387 ES3F_ADD_API_CASE(delete_queries, "Invalid glDeleteQueries() usage", 388 { 389 GLuint id; 390 glGenQueries (1, &id); 391 392 m_log << TestLog::Section("", "GL_INVALID_VALUE is generated if n is negative."); 393 glDeleteQueries (-1, &id); 394 expectError (GL_INVALID_VALUE); 395 m_log << TestLog::EndSection; 396 397 glDeleteQueries (1, &id); 398 }); 399 400 // Sync objects 401 402 ES3F_ADD_API_CASE(fence_sync, "Invalid glFenceSync() usage", 403 { 404 m_log << TestLog::Section("", "GL_INVALID_ENUM is generated if condition is not GL_SYNC_GPU_COMMANDS_COMPLETE."); 405 glFenceSync(-1, 0); 406 expectError(GL_INVALID_ENUM); 407 m_log << TestLog::EndSection; 408 409 m_log << TestLog::Section("", "GL_INVALID_VALUE is generated if flags is not zero."); 410 glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0x0010); 411 expectError(GL_INVALID_VALUE); 412 m_log << TestLog::EndSection; 413 }); 414 ES3F_ADD_API_CASE(wait_sync, "Invalid glWaitSync() usage", 415 { 416 GLsync sync = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0); 417 418 m_log << TestLog::Section("", "GL_INVALID_VALUE is generated if sync is not the name of a sync object."); 419 glWaitSync(0, 0, GL_TIMEOUT_IGNORED); 420 expectError(GL_INVALID_VALUE); 421 m_log << TestLog::EndSection; 422 423 m_log << TestLog::Section("", "GL_INVALID_VALUE is generated if flags is not zero."); 424 glWaitSync(sync, 0x0010, GL_TIMEOUT_IGNORED); 425 expectError(GL_INVALID_VALUE); 426 m_log << TestLog::EndSection; 427 428 m_log << TestLog::Section("", "GL_INVALID_VALUE is generated if timeout is not GL_TIMEOUT_IGNORED."); 429 glWaitSync(sync, 0, 0); 430 expectError(GL_INVALID_VALUE); 431 m_log << TestLog::EndSection; 432 433 glDeleteSync(sync); 434 }); 435 ES3F_ADD_API_CASE(client_wait_sync, "Invalid glClientWaitSync() usage", 436 { 437 GLsync sync = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0); 438 439 m_log << TestLog::Section("", "GL_INVALID_VALUE is generated if sync is not the name of an existing sync object."); 440 glClientWaitSync (0, 0, 10000); 441 expectError(GL_INVALID_VALUE); 442 m_log << TestLog::EndSection; 443 444 m_log << TestLog::Section("", "GL_INVALID_VALUE is generated if flags contains any unsupported flag."); 445 glClientWaitSync(sync, 0x00000004, 10000); 446 expectError(GL_INVALID_VALUE); 447 m_log << TestLog::EndSection; 448 449 glDeleteSync(sync); 450 }); 451 ES3F_ADD_API_CASE(delete_sync, "Invalid glDeleteSync() usage", 452 { 453 m_log << TestLog::Section("", "GL_INVALID_VALUE is generated if sync is neither zero or the name of a sync object."); 454 glDeleteSync((GLsync)1); 455 expectError(GL_INVALID_VALUE); 456 glDeleteSync(0); 457 expectError(GL_NO_ERROR); 458 m_log << TestLog::EndSection; 459 }); 460} 461 462 463} // Functional 464} // gles3 465} // deqp 466