1 /*-------------------------------------------------------------------------
2 * drawElements Quality Program OpenGL ES 3.0 Module
3 * -------------------------------------------------
5 * Copyright 2014 The Android Open Source Project
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
21 * \brief Negative GL State API tests.
22 *//*--------------------------------------------------------------------*/
24 #include "es31fNegativeStateApiTests.hpp"
26 #include "gluCallLogWrapper.hpp"
27 #include "gluContextInfo.hpp"
28 #include "gluShaderProgram.hpp"
30 #include "glwDefs.hpp"
31 #include "glwEnums.hpp"
33 #include "tcuStringTemplate.hpp"
46 namespace NegativeTestShared
50 using glu::CallLogWrapper;
53 static const char* uniformTestVertSource = "${GLSL_VERSION_DECL}\n"
54 "uniform mediump vec4 vUnif_vec4;\n"
55 "in mediump vec4 attr;"
56 "layout(shared) uniform Block { mediump vec4 blockVar; };\n"
59 " gl_Position = vUnif_vec4 + blockVar + attr;\n"
62 static const char* uniformTestFragSource = "${GLSL_VERSION_DECL}\n"
63 "uniform mediump ivec4 fUnif_ivec4;\n"
64 "uniform mediump uvec4 fUnif_uvec4;\n"
65 "layout(location = 0) out mediump vec4 fragColor;"
68 " fragColor = vec4(vec4(fUnif_ivec4) + vec4(fUnif_uvec4));\n"
71 static std::string getVtxFragVersionSources (const std::string source, NegativeTestContext& ctx)
73 const bool isES32 = glu::contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2));
75 std::map<std::string, std::string> args;
77 args["GLSL_VERSION_DECL"] = isES32 ? getGLSLVersionDeclaration(glu::GLSL_VERSION_320_ES) : getGLSLVersionDeclaration(glu::GLSL_VERSION_300_ES);
79 return tcu::StringTemplate(source).specialize(args);
82 // Enabling & disabling states
83 void enable (NegativeTestContext& ctx)
85 ctx.beginSection("GL_INVALID_ENUM is generated if cap is not one of the allowed values.");
87 ctx.expectError(GL_INVALID_ENUM);
91 // Enabling & disabling states
92 void enablei (NegativeTestContext& ctx)
94 TCU_CHECK_AND_THROW(NotSupportedError, contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)), "This test requires a higher context version.");
96 ctx.beginSection("GL_INVALID_ENUM is generated if cap is not one of the allowed values.");
97 ctx.glEnablei(-1, -1);
98 ctx.expectError(GL_INVALID_ENUM);
101 ctx.beginSection("GL_INVALID_VALUE is generated if index is greater than or equal to the number of indexed capabilities for cap.");
102 ctx.glEnablei(GL_BLEND, -1);
103 ctx.expectError(GL_INVALID_VALUE);
107 void disable (NegativeTestContext& ctx)
109 ctx.beginSection("GL_INVALID_ENUM is generated if cap is not one of the allowed values.");
111 ctx.expectError(GL_INVALID_ENUM);
115 void disablei (NegativeTestContext& ctx)
117 TCU_CHECK_AND_THROW(NotSupportedError, contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)), "This test requires a higher context version.");
119 ctx.beginSection("GL_INVALID_ENUM is generated if cap is not one of the allowed values.");
120 ctx.glDisablei(-1,-1);
121 ctx.expectError(GL_INVALID_ENUM);
124 ctx.beginSection("GL_INVALID_VALUE is generated if index is greater than or equal to the number of indexed capabilities for cap.");
125 ctx.glDisablei(GL_BLEND, -1);
126 ctx.expectError(GL_INVALID_VALUE);
130 // Simple state queries
131 void get_booleanv (NegativeTestContext& ctx)
133 ctx.beginSection("GL_INVALID_ENUM is generated if pname is not one of the allowed values.");
134 GLboolean params = GL_FALSE;
135 ctx.glGetBooleanv(-1, ¶ms);
136 ctx.expectError(GL_INVALID_ENUM);
140 void get_booleani_v (NegativeTestContext& ctx)
143 GLint maxUniformBufferBindings = 0;
145 ctx.beginSection("GL_INVALID_ENUM is generated if target is not indexed state queriable with these commands.");
146 ctx.glGetBooleani_v(-1, 0, &data);
147 ctx.expectError(GL_INVALID_ENUM);
150 ctx.beginSection("GL_INVALID_VALUE is generated if index is outside of the valid range for the indexed state target.");
151 ctx.glGetIntegerv(GL_MAX_UNIFORM_BUFFER_BINDINGS, &maxUniformBufferBindings);
152 ctx.expectError(GL_NO_ERROR);
153 ctx.glGetBooleani_v(GL_UNIFORM_BUFFER_BINDING, maxUniformBufferBindings, &data);
154 ctx.expectError(GL_INVALID_VALUE);
158 void get_floatv (NegativeTestContext& ctx)
160 ctx.beginSection("GL_INVALID_ENUM is generated if pname is not one of the allowed values.");
161 GLfloat params = 0.0f;
162 ctx.glGetFloatv(-1, ¶ms);
163 ctx.expectError(GL_INVALID_ENUM);
167 void get_integerv (NegativeTestContext& ctx)
170 ctx.beginSection("GL_INVALID_ENUM is generated if pname is not one of the allowed values.");
171 ctx.glGetIntegerv(-1, ¶ms);
172 ctx.expectError(GL_INVALID_ENUM);
176 void get_integer64v (NegativeTestContext& ctx)
179 ctx.beginSection("GL_INVALID_ENUM is generated if pname is not one of the allowed values.");
180 ctx.glGetInteger64v(-1, ¶ms);
181 ctx.expectError(GL_INVALID_ENUM);
185 void get_integeri_v (NegativeTestContext& ctx)
188 GLint maxUniformBufferBindings = 0;
190 ctx.beginSection("GL_INVALID_ENUM is generated if name is not an accepted value.");
191 ctx.glGetIntegeri_v(-1, 0, &data);
192 ctx.expectError(GL_INVALID_ENUM);
195 ctx.beginSection("GL_INVALID_VALUE is generated if index is outside of the valid range for the indexed state target.");
196 ctx.glGetIntegerv(GL_MAX_UNIFORM_BUFFER_BINDINGS, &maxUniformBufferBindings);
197 ctx.expectError(GL_NO_ERROR);
198 ctx.glGetIntegeri_v(GL_UNIFORM_BUFFER_BINDING, maxUniformBufferBindings, &data);
199 ctx.expectError(GL_INVALID_VALUE);
203 void get_integer64i_v (NegativeTestContext& ctx)
205 GLint64 data = (GLint64)-1;
206 GLint maxUniformBufferBindings = 0;
208 ctx.beginSection("GL_INVALID_ENUM is generated if name is not an accepted value.");
209 ctx.glGetInteger64i_v(-1, 0, &data);
210 ctx.expectError(GL_INVALID_ENUM);
213 ctx.beginSection("GL_INVALID_VALUE is generated if index is outside of the valid range for the indexed state target.");
214 ctx.glGetIntegerv(GL_MAX_UNIFORM_BUFFER_BINDINGS, &maxUniformBufferBindings);
215 ctx.expectError(GL_NO_ERROR);
216 ctx.glGetInteger64i_v(GL_UNIFORM_BUFFER_START, maxUniformBufferBindings, &data);
217 ctx.expectError(GL_INVALID_VALUE);
221 void get_string (NegativeTestContext& ctx)
223 ctx.beginSection("GL_INVALID_ENUM is generated if name is not an accepted value.");
225 ctx.expectError(GL_INVALID_ENUM);
229 void get_stringi (NegativeTestContext& ctx)
231 GLint numExtensions = 0;
233 ctx.beginSection("GL_INVALID_ENUM is generated if name is not an accepted value.");
234 ctx.glGetStringi(-1, 0);
235 ctx.expectError(GL_INVALID_ENUM);
238 ctx.beginSection("GL_INVALID_VALUE is generated if index is outside the valid range for indexed state name.");
239 ctx.glGetIntegerv(GL_NUM_EXTENSIONS, &numExtensions);
240 ctx.glGetStringi(GL_EXTENSIONS, numExtensions);
241 ctx.expectError(GL_INVALID_VALUE);
245 // Enumerated state queries: Shaders
247 void get_attached_shaders (NegativeTestContext& ctx)
249 GLuint shaders[1] = { 0 };
250 GLuint shaderObject = ctx.glCreateShader(GL_VERTEX_SHADER);
251 GLuint program = ctx.glCreateProgram();
252 GLsizei count[1] = { 0 };
254 ctx.beginSection("GL_INVALID_VALUE is generated if program is not a value generated by OpenGL.");
255 ctx.glGetAttachedShaders(-1, 1, &count[0], &shaders[0]);
256 ctx.expectError(GL_INVALID_VALUE);
259 ctx.beginSection("GL_INVALID_OPERATION is generated if program is not a program object.");
260 ctx.glGetAttachedShaders(shaderObject, 1, &count[0], &shaders[0]);
261 ctx.expectError(GL_INVALID_OPERATION);
264 ctx.beginSection("GL_INVALID_VALUE is generated if maxCount is less than 0.");
265 ctx.glGetAttachedShaders(program, -1, &count[0], &shaders[0]);
266 ctx.expectError(GL_INVALID_VALUE);
269 ctx.glDeleteShader(shaderObject);
270 ctx.glDeleteProgram(program);
273 void get_shaderiv (NegativeTestContext& ctx)
275 GLboolean shaderCompilerSupported;
276 GLuint shader = ctx.glCreateShader(GL_VERTEX_SHADER);
277 GLuint program = ctx.glCreateProgram();
278 GLint param[1] = { -1 };
280 ctx.glGetBooleanv(GL_SHADER_COMPILER, &shaderCompilerSupported);
281 ctx.getLog() << TestLog::Message << "// GL_SHADER_COMPILER = " << (shaderCompilerSupported ? "GL_TRUE" : "GL_FALSE") << TestLog::EndMessage;
283 ctx.beginSection("GL_INVALID_ENUM is generated if pname is not an accepted value.");
284 ctx.glGetShaderiv(shader, -1, ¶m[0]);
285 ctx.expectError(GL_INVALID_ENUM);
288 ctx.beginSection("GL_INVALID_VALUE is generated if shader is not a value generated by OpenGL.");
289 ctx.glGetShaderiv(-1, GL_SHADER_TYPE, ¶m[0]);
290 ctx.expectError(GL_INVALID_VALUE);
293 ctx.beginSection("GL_INVALID_OPERATION is generated if shader does not refer to a shader object.");
294 ctx.glGetShaderiv(program, GL_SHADER_TYPE, ¶m[0]);
295 ctx.expectError(GL_INVALID_OPERATION);
298 ctx.glDeleteShader(shader);
299 ctx.glDeleteProgram(program);
302 void get_shader_info_log (NegativeTestContext& ctx)
304 GLuint shader = ctx.glCreateShader(GL_VERTEX_SHADER);
305 GLuint program = ctx.glCreateProgram();
306 GLsizei length[1] = { -1 };
307 char infoLog[128] = { 0 };
309 ctx.beginSection("GL_INVALID_VALUE is generated if shader is not a value generated by OpenGL.");
310 ctx.glGetShaderInfoLog(-1, 128, &length[0], &infoLog[0]);
311 ctx.expectError(GL_INVALID_VALUE);
314 ctx.beginSection("GL_INVALID_OPERATION is generated if shader is not a shader object.");
315 ctx.glGetShaderInfoLog(program, 128, &length[0], &infoLog[0]);
316 ctx.expectError(GL_INVALID_OPERATION);
319 ctx.beginSection("GL_INVALID_VALUE is generated if maxLength is less than 0.");
320 ctx.glGetShaderInfoLog(shader, -1, &length[0], &infoLog[0]);
321 ctx.expectError(GL_INVALID_VALUE);
324 ctx.glDeleteShader(shader);
325 ctx.glDeleteProgram(program);
328 void get_shader_precision_format (NegativeTestContext& ctx)
330 GLboolean shaderCompilerSupported;
334 ctx.glGetBooleanv(GL_SHADER_COMPILER, &shaderCompilerSupported);
335 ctx.getLog() << TestLog::Message << "// GL_SHADER_COMPILER = " << (shaderCompilerSupported ? "GL_TRUE" : "GL_FALSE") << TestLog::EndMessage;
337 deMemset(&range[0], 0xcd, sizeof(range));
338 deMemset(&precision[0], 0xcd, sizeof(precision));
340 ctx.beginSection("GL_INVALID_ENUM is generated if shaderType or precisionType is not an accepted value.");
341 ctx.glGetShaderPrecisionFormat (-1, GL_MEDIUM_FLOAT, &range[0], &precision[0]);
342 ctx.expectError(GL_INVALID_ENUM);
343 ctx.glGetShaderPrecisionFormat (GL_VERTEX_SHADER, -1, &range[0], &precision[0]);
344 ctx.expectError(GL_INVALID_ENUM);
345 ctx.glGetShaderPrecisionFormat (-1, -1, &range[0], &precision[0]);
346 ctx.expectError(GL_INVALID_ENUM);
350 void get_shader_source (NegativeTestContext& ctx)
352 GLsizei length[1] = { 0 };
353 char source[1] = { 0 };
354 GLuint program = ctx.glCreateProgram();
355 GLuint shader = ctx.glCreateShader(GL_VERTEX_SHADER);
357 ctx.beginSection("GL_INVALID_VALUE is generated if shader is not a value generated by OpenGL.");
358 ctx.glGetShaderSource(-1, 1, &length[0], &source[0]);
359 ctx.expectError(GL_INVALID_VALUE);
362 ctx.beginSection("GL_INVALID_OPERATION is generated if shader is not a shader object.");
363 ctx.glGetShaderSource(program, 1, &length[0], &source[0]);
364 ctx.expectError(GL_INVALID_OPERATION);
367 ctx.beginSection("GL_INVALID_VALUE is generated if bufSize is less than 0.");
368 ctx.glGetShaderSource(shader, -1, &length[0], &source[0]);
369 ctx.expectError(GL_INVALID_VALUE);
372 ctx.glDeleteProgram(program);
373 ctx.glDeleteShader(shader);
376 // Enumerated state queries: Programs
378 void get_programiv (NegativeTestContext& ctx)
380 GLuint program = ctx.glCreateProgram();
381 GLuint shader = ctx.glCreateShader(GL_VERTEX_SHADER);
382 GLint params[1] = { 0 };
384 ctx.beginSection("GL_INVALID_ENUM is generated if pname is not an accepted value.");
385 ctx.glGetProgramiv(program, -1, ¶ms[0]);
386 ctx.expectError(GL_INVALID_ENUM);
389 ctx.beginSection("GL_INVALID_VALUE is generated if program is not a value generated by OpenGL.");
390 ctx.glGetProgramiv(-1, GL_LINK_STATUS, ¶ms[0]);
391 ctx.expectError(GL_INVALID_VALUE);
394 ctx.beginSection("GL_INVALID_OPERATION is generated if program does not refer to a program object.");
395 ctx.glGetProgramiv(shader, GL_LINK_STATUS, ¶ms[0]);
396 ctx.expectError(GL_INVALID_OPERATION);
399 ctx.glDeleteProgram(program);
400 ctx.glDeleteShader(shader);
403 void get_program_info_log (NegativeTestContext& ctx)
405 GLuint program = ctx.glCreateProgram();
406 GLuint shader = ctx.glCreateShader(GL_VERTEX_SHADER);
407 GLsizei length[1] = { 0 };
408 char infoLog[1] = { 'x' };
410 ctx.beginSection("GL_INVALID_VALUE is generated if program is not a value generated by OpenGL.");
411 ctx.glGetProgramInfoLog (-1, 1, &length[0], &infoLog[0]);
412 ctx.expectError(GL_INVALID_VALUE);
415 ctx.beginSection("GL_INVALID_OPERATION is generated if program is not a program object.");
416 ctx.glGetProgramInfoLog (shader, 1, &length[0], &infoLog[0]);
417 ctx.expectError(GL_INVALID_OPERATION);
420 ctx.beginSection("GL_INVALID_VALUE is generated if maxLength is less than 0.");
421 ctx.glGetProgramInfoLog (program, -1, &length[0], &infoLog[0]);
422 ctx.expectError(GL_INVALID_VALUE);
425 ctx.glDeleteProgram(program);
426 ctx.glDeleteShader(shader);
429 // Enumerated state queries: Shader variables
431 void get_tex_parameterfv (NegativeTestContext& ctx)
433 GLfloat params[1] = { 0 };
435 ctx.beginSection("GL_INVALID_ENUM is generated if target or pname is not an accepted value.");
436 ctx.glGetTexParameterfv (-1, GL_TEXTURE_MAG_FILTER, ¶ms[0]);
437 ctx.expectError(GL_INVALID_ENUM);
438 ctx.glGetTexParameterfv (GL_TEXTURE_2D, -1, ¶ms[0]);
439 ctx.expectError(GL_INVALID_ENUM);
440 ctx.glGetTexParameterfv (-1, -1, ¶ms[0]);
441 ctx.expectError(GL_INVALID_ENUM);
445 void get_tex_parameteriv (NegativeTestContext& ctx)
447 GLint params[1] = { 0 };
449 ctx.beginSection("GL_INVALID_ENUM is generated if target or pname is not an accepted value.");
450 ctx.glGetTexParameteriv (-1, GL_TEXTURE_MAG_FILTER, ¶ms[0]);
451 ctx.expectError(GL_INVALID_ENUM);
452 ctx.glGetTexParameteriv (GL_TEXTURE_2D, -1, ¶ms[0]);
453 ctx.expectError(GL_INVALID_ENUM);
454 ctx.glGetTexParameteriv (-1, -1, ¶ms[0]);
455 ctx.expectError(GL_INVALID_ENUM);
459 void get_tex_parameteriiv (NegativeTestContext& ctx)
461 TCU_CHECK_AND_THROW(NotSupportedError, contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)), "This test requires a higher context version.");
463 GLint params[1] = { 0 };
465 ctx.beginSection("GL_INVALID_ENUM is generated if target or pname is not an accepted value.");
466 ctx.glGetTexParameterIiv(-1, GL_TEXTURE_MAG_FILTER, ¶ms[0]);
467 ctx.expectError(GL_INVALID_ENUM);
468 ctx.glGetTexParameterIiv(GL_TEXTURE_2D, -1, ¶ms[0]);
469 ctx.expectError(GL_INVALID_ENUM);
470 ctx.glGetTexParameterIiv(-1, -1, ¶ms[0]);
471 ctx.expectError(GL_INVALID_ENUM);
475 void get_tex_parameteriuiv (NegativeTestContext& ctx)
477 TCU_CHECK_AND_THROW(NotSupportedError, contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)), "This test requires a higher context version.");
479 GLuint params[1] = { 0 };
481 ctx.beginSection("GL_INVALID_ENUM is generated if target or pname is not an accepted value.");
482 ctx.glGetTexParameterIuiv(-1, GL_TEXTURE_MAG_FILTER, ¶ms[0]);
483 ctx.expectError(GL_INVALID_ENUM);
484 ctx.glGetTexParameterIuiv(GL_TEXTURE_2D, -1, ¶ms[0]);
485 ctx.expectError(GL_INVALID_ENUM);
486 ctx.glGetTexParameterIuiv(-1, -1, ¶ms[0]);
487 ctx.expectError(GL_INVALID_ENUM);
491 void get_uniformfv (NegativeTestContext& ctx)
493 glu::ShaderProgram program (ctx.getRenderContext(), glu::makeVtxFragSources(getVtxFragVersionSources(uniformTestVertSource, ctx), getVtxFragVersionSources(uniformTestFragSource, ctx)));
494 GLfloat params[4] = { 0.f };
499 ctx.glUseProgram(program.getProgram());
501 unif = ctx.glGetUniformLocation(program.getProgram(), "vUnif_vec4"); // vec4
503 ctx.fail("Failed to retrieve uniform location");
505 shader = ctx.glCreateShader(GL_VERTEX_SHADER);
506 programEmpty = ctx.glCreateProgram();
508 ctx.beginSection("GL_INVALID_VALUE is generated if program is not a value generated by OpenGL.");
509 ctx.glGetUniformfv (-1, unif, ¶ms[0]);
510 ctx.expectError(GL_INVALID_VALUE);
513 ctx.beginSection("GL_INVALID_OPERATION is generated if program is not a program object.");
514 ctx.glGetUniformfv (shader, unif, ¶ms[0]);
515 ctx.expectError(GL_INVALID_OPERATION);
518 ctx.beginSection("GL_INVALID_OPERATION is generated if program has not been successfully linked.");
519 ctx.glGetUniformfv (programEmpty, unif, ¶ms[0]);
520 ctx.expectError(GL_INVALID_OPERATION);
523 ctx.beginSection("GL_INVALID_OPERATION is generated if location does not correspond to a valid uniform variable location for the specified program object.");
524 ctx.glGetUniformfv (program.getProgram(), -1, ¶ms[0]);
525 ctx.expectError(GL_INVALID_OPERATION);
528 ctx.glDeleteShader(shader);
529 ctx.glDeleteProgram(programEmpty);
532 void get_nuniformfv (NegativeTestContext& ctx)
534 TCU_CHECK_AND_THROW(NotSupportedError, contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)), "This test requires a higher context version.");
536 glu::ShaderProgram program (ctx.getRenderContext(), glu::makeVtxFragSources(getVtxFragVersionSources(uniformTestVertSource, ctx), getVtxFragVersionSources(uniformTestFragSource, ctx)));
537 GLint unif = ctx.glGetUniformLocation(program.getProgram(), "vUnif_vec4");
538 GLfloat params[4] = { 0.0f, 0.0f, 0.0f, 0.0f };
543 ctx.glUseProgram(program.getProgram());
546 ctx.fail("Failed to retrieve uniform location");
548 shader = ctx.glCreateShader(GL_VERTEX_SHADER);
549 programEmpty = ctx.glCreateProgram();
551 ctx.glGetIntegerv(GL_MAX_COMBINED_UNIFORM_BLOCKS, &bufferSize);
553 ctx.beginSection("GL_INVALID_VALUE is generated if program is not a value generated by OpenGL.");
554 ctx.glGetnUniformfv(-1, unif, bufferSize, ¶ms[0]);
555 ctx.expectError(GL_INVALID_VALUE);
558 ctx.beginSection("GL_INVALID_OPERATION is generated if program is not a program object.");
559 ctx.glGetnUniformfv(shader, unif, bufferSize, ¶ms[0]);
560 ctx.expectError(GL_INVALID_OPERATION);
563 ctx.beginSection("GL_INVALID_OPERATION is generated if program has not been successfully linked.");
564 ctx.glGetnUniformfv(programEmpty, unif, bufferSize, ¶ms[0]);
565 ctx.expectError(GL_INVALID_OPERATION);
568 ctx.beginSection("GL_INVALID_OPERATION is generated if location does not correspond to a valid uniform variable location for the specified program object.");
569 ctx.glGetnUniformfv(program.getProgram(), -1, bufferSize, ¶ms[0]);
570 ctx.expectError(GL_INVALID_OPERATION);
573 ctx.beginSection("GL_INVALID_OPERATION is generated if the buffer size required to store the requested data is greater than bufSize.");
574 ctx.glGetnUniformfv(program.getProgram(), unif, 0, ¶ms[0]);
575 ctx.expectError(GL_INVALID_OPERATION);
578 ctx.glDeleteShader(shader);
579 ctx.glDeleteProgram(programEmpty);
582 void get_uniformiv (NegativeTestContext& ctx)
584 glu::ShaderProgram program (ctx.getRenderContext(), glu::makeVtxFragSources(getVtxFragVersionSources(uniformTestVertSource, ctx), getVtxFragVersionSources(uniformTestFragSource, ctx)));
585 GLint unif = ctx.glGetUniformLocation(program.getProgram(), "fUnif_ivec4");
586 GLint params[4] = { 0, 0, 0, 0 };
590 ctx.glUseProgram(program.getProgram());
593 ctx.fail("Failed to retrieve uniform location");
595 shader = ctx.glCreateShader(GL_VERTEX_SHADER);
596 programEmpty = ctx.glCreateProgram();
598 ctx.beginSection("GL_INVALID_VALUE is generated if program is not a value generated by OpenGL.");
599 ctx.glGetUniformiv (-1, unif, ¶ms[0]);
600 ctx.expectError(GL_INVALID_VALUE);
603 ctx.beginSection("GL_INVALID_OPERATION is generated if program is not a program object.");
604 ctx.glGetUniformiv (shader, unif, ¶ms[0]);
605 ctx.expectError(GL_INVALID_OPERATION);
608 ctx.beginSection("GL_INVALID_OPERATION is generated if program has not been successfully linked.");
609 ctx.glGetUniformiv (programEmpty, unif, ¶ms[0]);
610 ctx.expectError(GL_INVALID_OPERATION);
613 ctx.beginSection("GL_INVALID_OPERATION is generated if location does not correspond to a valid uniform variable location for the specified program object.");
614 ctx.glGetUniformiv (program.getProgram(), -1, ¶ms[0]);
615 ctx.expectError(GL_INVALID_OPERATION);
618 ctx.glDeleteShader(shader);
619 ctx.glDeleteProgram(programEmpty);
622 void get_nuniformiv (NegativeTestContext& ctx)
624 TCU_CHECK_AND_THROW(NotSupportedError, contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)), "This test requires a higher context version.");
626 glu::ShaderProgram program (ctx.getRenderContext(), glu::makeVtxFragSources(getVtxFragVersionSources(uniformTestVertSource, ctx), getVtxFragVersionSources(uniformTestFragSource, ctx)));
627 GLint unif = ctx.glGetUniformLocation(program.getProgram(), "fUnif_ivec4");
628 GLint params[4] = { 0, 0, 0, 0 };
633 ctx.glUseProgram(program.getProgram());
636 ctx.fail("Failed to retrieve uniform location");
638 shader = ctx.glCreateShader(GL_VERTEX_SHADER);
639 programEmpty = ctx.glCreateProgram();
641 ctx.glGetIntegerv(GL_MAX_COMBINED_UNIFORM_BLOCKS, &bufferSize);
643 ctx.beginSection("GL_INVALID_VALUE is generated if program is not a value generated by OpenGL.");
644 ctx.glGetnUniformiv(-1, unif, bufferSize, ¶ms[0]);
645 ctx.expectError(GL_INVALID_VALUE);
648 ctx.beginSection("GL_INVALID_OPERATION is generated if program is not a program object.");
649 ctx.glGetnUniformiv(shader, unif, bufferSize, ¶ms[0]);
650 ctx.expectError(GL_INVALID_OPERATION);
653 ctx.beginSection("GL_INVALID_OPERATION is generated if program has not been successfully linked.");
654 ctx.glGetnUniformiv(programEmpty, unif, bufferSize, ¶ms[0]);
655 ctx.expectError(GL_INVALID_OPERATION);
658 ctx.beginSection("GL_INVALID_OPERATION is generated if location does not correspond to a valid uniform variable location for the specified program object.");
659 ctx.glGetnUniformiv(program.getProgram(), -1, bufferSize, ¶ms[0]);
660 ctx.expectError(GL_INVALID_OPERATION);
663 ctx.beginSection("GL_INVALID_OPERATION is generated if the buffer size required to store the requested data is greater than bufSize.");
664 ctx.glGetnUniformiv(program.getProgram(), unif, - 1, ¶ms[0]);
665 ctx.expectError(GL_INVALID_OPERATION);
668 ctx.glDeleteShader(shader);
669 ctx.glDeleteProgram(programEmpty);
672 void get_uniformuiv (NegativeTestContext& ctx)
674 glu::ShaderProgram program (ctx.getRenderContext(), glu::makeVtxFragSources(getVtxFragVersionSources(uniformTestVertSource, ctx), getVtxFragVersionSources(uniformTestFragSource, ctx)));
675 GLint unif = ctx.glGetUniformLocation(program.getProgram(), "fUnif_uvec4");
676 GLuint params[4] = { 0, 0, 0, 0 };
680 ctx.glUseProgram(program.getProgram());
683 ctx.fail("Failed to retrieve uniform location");
685 shader = ctx.glCreateShader(GL_VERTEX_SHADER);
686 programEmpty = ctx.glCreateProgram();
688 ctx.beginSection("GL_INVALID_VALUE is generated if program is not a value generated by OpenGL.");
689 ctx.glGetUniformuiv (-1, unif, ¶ms[0]);
690 ctx.expectError(GL_INVALID_VALUE);
693 ctx.beginSection("GL_INVALID_OPERATION is generated if program is not a program object.");
694 ctx.glGetUniformuiv (shader, unif, ¶ms[0]);
695 ctx.expectError(GL_INVALID_OPERATION);
698 ctx.beginSection("GL_INVALID_OPERATION is generated if program has not been successfully linked.");
699 ctx.glGetUniformuiv (programEmpty, unif, ¶ms[0]);
700 ctx.expectError(GL_INVALID_OPERATION);
703 ctx.beginSection("GL_INVALID_OPERATION is generated if location does not correspond to a valid uniform variable location for the specified program object.");
704 ctx.glGetUniformuiv (program.getProgram(), -1, ¶ms[0]);
705 ctx.expectError(GL_INVALID_OPERATION);
708 ctx.glDeleteShader(shader);
709 ctx.glDeleteProgram(programEmpty);
712 void get_nuniformuiv (NegativeTestContext& ctx)
714 TCU_CHECK_AND_THROW(NotSupportedError, contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)), "This test requires a higher context version.");
716 glu::ShaderProgram program (ctx.getRenderContext(), glu::makeVtxFragSources(getVtxFragVersionSources(uniformTestVertSource, ctx), getVtxFragVersionSources(uniformTestFragSource, ctx)));
717 GLint unif = ctx.glGetUniformLocation(program.getProgram(), "fUnif_ivec4");
718 GLuint params[4] = { 0, 0, 0, 0 };
723 ctx.glUseProgram(program.getProgram());
726 ctx.fail("Failed to retrieve uniform location");
728 shader = ctx.glCreateShader(GL_VERTEX_SHADER);
729 programEmpty = ctx.glCreateProgram();
731 ctx.glGetIntegerv(GL_MAX_COMBINED_UNIFORM_BLOCKS, &bufferSize);
733 ctx.beginSection("GL_INVALID_VALUE is generated if program is not a value generated by OpenGL.");
734 ctx.glGetnUniformuiv(-1, unif, bufferSize, ¶ms[0]);
735 ctx.expectError(GL_INVALID_VALUE);
738 ctx.beginSection("GL_INVALID_OPERATION is generated if program is not a program object.");
739 ctx.glGetnUniformuiv(shader, unif, bufferSize, ¶ms[0]);
740 ctx.expectError(GL_INVALID_OPERATION);
743 ctx.beginSection("GL_INVALID_OPERATION is generated if program has not been successfully linked.");
744 ctx.glGetnUniformuiv(programEmpty, unif, bufferSize, ¶ms[0]);
745 ctx.expectError(GL_INVALID_OPERATION);
748 ctx.beginSection("GL_INVALID_OPERATION is generated if location does not correspond to a valid uniform variable location for the specified program object.");
749 ctx.glGetnUniformuiv(program.getProgram(), -1, bufferSize, ¶ms[0]);
750 ctx.expectError(GL_INVALID_OPERATION);
753 ctx.beginSection("GL_INVALID_OPERATION is generated if the buffer size required to store the requested data is greater than bufSize.");
754 ctx.glGetnUniformuiv(program.getProgram(), unif, -1, ¶ms[0]);
755 ctx.expectError(GL_INVALID_OPERATION);
758 ctx.glDeleteShader(shader);
759 ctx.glDeleteProgram(programEmpty);
762 void get_active_uniform (NegativeTestContext& ctx)
764 GLuint shader = ctx.glCreateShader(GL_VERTEX_SHADER);
765 glu::ShaderProgram program (ctx.getRenderContext(), glu::makeVtxFragSources(getVtxFragVersionSources(uniformTestVertSource, ctx), getVtxFragVersionSources(uniformTestFragSource, ctx)));
766 GLint numActiveUniforms = -1;
768 ctx.glGetProgramiv (program.getProgram(), GL_ACTIVE_UNIFORMS, &numActiveUniforms);
769 ctx.getLog() << TestLog::Message << "// GL_ACTIVE_UNIFORMS = " << numActiveUniforms << " (expected 4)." << TestLog::EndMessage;
771 ctx.beginSection("GL_INVALID_VALUE is generated if program is not a value generated by OpenGL.");
772 ctx.glGetActiveUniform(-1, 0, 0, 0, 0, 0, 0);
773 ctx.expectError(GL_INVALID_VALUE);
776 ctx.beginSection("GL_INVALID_OPERATION is generated if program is not a program object.");
777 ctx.glGetActiveUniform(shader, 0, 0, 0, 0, 0, 0);
778 ctx.expectError(GL_INVALID_OPERATION);
781 ctx.beginSection("GL_INVALID_VALUE is generated if index is greater than or equal to the number of active uniform variables in program.");
782 ctx.glUseProgram(program.getProgram());
783 ctx.glGetActiveUniform(program.getProgram(), numActiveUniforms, 0, 0, 0, 0, 0);
784 ctx.expectError(GL_INVALID_VALUE);
787 ctx.beginSection("GL_INVALID_VALUE is generated if bufSize is less than 0.");
788 ctx.glGetActiveUniform(program.getProgram(), 0, -1, 0, 0, 0, 0);
789 ctx.expectError(GL_INVALID_VALUE);
793 ctx.glDeleteShader(shader);
796 void get_active_uniformsiv (NegativeTestContext& ctx)
798 GLuint shader = ctx.glCreateShader(GL_VERTEX_SHADER);
799 glu::ShaderProgram program (ctx.getRenderContext(), glu::makeVtxFragSources(getVtxFragVersionSources(uniformTestVertSource, ctx), getVtxFragVersionSources(uniformTestFragSource, ctx)));
800 GLuint dummyUniformIndex = 1;
801 GLint dummyParamDst = -1;
802 GLint numActiveUniforms = -1;
804 ctx.glUseProgram(program.getProgram());
806 ctx.glGetProgramiv (program.getProgram(), GL_ACTIVE_UNIFORMS, &numActiveUniforms);
807 ctx.getLog() << TestLog::Message << "// GL_ACTIVE_UNIFORMS = " << numActiveUniforms << " (expected 4)." << TestLog::EndMessage;
809 ctx.beginSection("GL_INVALID_VALUE is generated if program is not a value generated by OpenGL.");
810 ctx.glGetActiveUniformsiv(-1, 1, &dummyUniformIndex, GL_UNIFORM_TYPE, &dummyParamDst);
811 ctx.expectError(GL_INVALID_VALUE);
814 ctx.beginSection("GL_INVALID_OPERATION is generated if program is not a program object.");
815 ctx.glGetActiveUniformsiv(shader, 1, &dummyUniformIndex, GL_UNIFORM_TYPE, &dummyParamDst);
816 ctx.expectError(GL_INVALID_OPERATION);
819 ctx.beginSection("GL_INVALID_VALUE is generated if any value in uniformIndices is greater than or equal to the value of GL_ACTIVE_UNIFORMS for program.");
820 for (int excess = 0; excess <= 2; excess++)
822 std::vector<GLuint> invalidUniformIndices;
823 invalidUniformIndices.push_back(1);
824 invalidUniformIndices.push_back(numActiveUniforms-1+excess);
825 invalidUniformIndices.push_back(1);
827 std::vector<GLint> dummyParamsDst(invalidUniformIndices.size());
828 ctx.glGetActiveUniformsiv(program.getProgram(), (GLsizei)invalidUniformIndices.size(), &invalidUniformIndices[0], GL_UNIFORM_TYPE, &dummyParamsDst[0]);
829 ctx.expectError(excess == 0 ? GL_NO_ERROR : GL_INVALID_VALUE);
833 ctx.beginSection("GL_INVALID_ENUM is generated if pname is not an accepted token.");
834 ctx.glGetActiveUniformsiv(program.getProgram(), 1, &dummyUniformIndex, -1, &dummyParamDst);
835 ctx.expectError(GL_INVALID_ENUM);
839 ctx.glDeleteShader(shader);
842 void get_active_uniform_blockiv (NegativeTestContext& ctx)
844 glu::ShaderProgram program (ctx.getRenderContext(), glu::makeVtxFragSources(getVtxFragVersionSources(uniformTestVertSource, ctx), getVtxFragVersionSources(uniformTestFragSource, ctx)));
845 GLuint shader = ctx.glCreateShader(GL_VERTEX_SHADER);
847 GLint numActiveBlocks = -1;
849 ctx.glGetProgramiv(program.getProgram(), GL_ACTIVE_UNIFORM_BLOCKS, &numActiveBlocks);
850 ctx.getLog() << TestLog::Message << "// GL_ACTIVE_UNIFORM_BLOCKS = " << numActiveBlocks << " (expected 1)." << TestLog::EndMessage;
851 ctx.expectError(GL_NO_ERROR);
853 ctx.beginSection("GL_INVALID_VALUE is generated if program is not the name of either a program or shader object.");
854 ctx.glGetActiveUniformBlockiv(-1, 0, GL_UNIFORM_BLOCK_BINDING, ¶ms);
855 ctx.expectError(GL_INVALID_VALUE);
858 ctx.beginSection("GL_INVALID_OPERATION is generated if program is the name of a shader object");
859 ctx.glGetActiveUniformBlockiv(shader, 0, GL_UNIFORM_BLOCK_BINDING, ¶ms);
860 ctx.expectError(GL_INVALID_OPERATION);
863 ctx.beginSection("GL_INVALID_VALUE is generated if uniformBlockIndex is greater than or equal to the value of GL_ACTIVE_UNIFORM_BLOCKS or is not the index of an active uniform block in program.");
864 ctx.glUseProgram(program.getProgram());
865 ctx.expectError(GL_NO_ERROR);
866 ctx.glGetActiveUniformBlockiv(program.getProgram(), numActiveBlocks, GL_UNIFORM_BLOCK_BINDING, ¶ms);
867 ctx.expectError(GL_INVALID_VALUE);
870 ctx.beginSection("GL_INVALID_ENUM is generated if pname is not one of the accepted tokens.");
871 ctx.glGetActiveUniformBlockiv(program.getProgram(), 0, -1, ¶ms);
872 ctx.expectError(GL_INVALID_ENUM);
878 void get_active_uniform_block_name (NegativeTestContext& ctx)
880 glu::ShaderProgram program (ctx.getRenderContext(), glu::makeVtxFragSources(getVtxFragVersionSources(uniformTestVertSource, ctx), getVtxFragVersionSources(uniformTestFragSource, ctx)));
881 GLuint shader = ctx.glCreateShader(GL_VERTEX_SHADER);
883 GLint numActiveBlocks = -1;
884 GLchar uniformBlockName[128];
886 deMemset(&uniformBlockName[0], 0, sizeof(uniformBlockName));
888 ctx.glGetProgramiv(program.getProgram(), GL_ACTIVE_UNIFORM_BLOCKS, &numActiveBlocks);
889 ctx.getLog() << TestLog::Message << "// GL_ACTIVE_UNIFORM_BLOCKS = " << numActiveBlocks << " (expected 1)." << TestLog::EndMessage;
890 ctx.expectError(GL_NO_ERROR);
892 ctx.beginSection("GL_INVALID_OPERATION is generated if program is the name of a shader object.");
893 ctx.glGetActiveUniformBlockName(shader, numActiveBlocks, GL_UNIFORM_BLOCK_BINDING, &length, &uniformBlockName[0]);
894 ctx.expectError(GL_INVALID_OPERATION);
897 ctx.beginSection("GL_INVALID_VALUE is generated if program is not the name of either a program or shader object.");
898 ctx.glGetActiveUniformBlockName(-1, numActiveBlocks, GL_UNIFORM_BLOCK_BINDING, &length, &uniformBlockName[0]);
899 ctx.expectError(GL_INVALID_VALUE);
902 ctx.beginSection("GL_INVALID_VALUE is generated if uniformBlockIndex is greater than or equal to the value of GL_ACTIVE_UNIFORM_BLOCKS or is not the index of an active uniform block in program.");
903 ctx.glUseProgram(program.getProgram());
904 ctx.expectError(GL_NO_ERROR);
905 ctx.glGetActiveUniformBlockName(program.getProgram(), numActiveBlocks, (int)sizeof(uniformBlockName), &length, &uniformBlockName[0]);
906 ctx.expectError(GL_INVALID_VALUE);
912 void get_active_attrib (NegativeTestContext& ctx)
914 GLuint shader = ctx.glCreateShader(GL_VERTEX_SHADER);
915 glu::ShaderProgram program (ctx.getRenderContext(), glu::makeVtxFragSources(getVtxFragVersionSources(uniformTestVertSource, ctx), getVtxFragVersionSources(uniformTestFragSource, ctx)));
916 GLint numActiveAttributes = -1;
922 deMemset(&name[0], 0, sizeof(name));
924 ctx.glGetProgramiv (program.getProgram(), GL_ACTIVE_ATTRIBUTES, &numActiveAttributes);
925 ctx.getLog() << TestLog::Message << "// GL_ACTIVE_ATTRIBUTES = " << numActiveAttributes << " (expected 1)." << TestLog::EndMessage;
927 ctx.glUseProgram(program.getProgram());
929 ctx.beginSection("GL_INVALID_VALUE is generated if program is not a value generated by OpenGL.");
930 ctx.glGetActiveAttrib(-1, 0, 32, &length, &size, &type, &name[0]);
931 ctx.expectError(GL_INVALID_VALUE);
934 ctx.beginSection("GL_INVALID_OPERATION is generated if program is not a program object.");
935 ctx.glGetActiveAttrib(shader, 0, 32, &length, &size, &type, &name[0]);
936 ctx.expectError(GL_INVALID_OPERATION);
939 ctx.beginSection("GL_INVALID_VALUE is generated if index is greater than or equal to GL_ACTIVE_ATTRIBUTES.");
940 ctx.glGetActiveAttrib(program.getProgram(), numActiveAttributes, (int)sizeof(name), &length, &size, &type, &name[0]);
941 ctx.expectError(GL_INVALID_VALUE);
944 ctx.beginSection("GL_INVALID_VALUE is generated if bufSize is less than 0.");
945 ctx.glGetActiveAttrib(program.getProgram(), 0, -1, &length, &size, &type, &name[0]);
946 ctx.expectError(GL_INVALID_VALUE);
950 ctx.glDeleteShader(shader);
953 void get_uniform_indices (NegativeTestContext& ctx)
955 GLuint shader = ctx.glCreateShader(GL_VERTEX_SHADER);
956 glu::ShaderProgram program (ctx.getRenderContext(), glu::makeVtxFragSources(getVtxFragVersionSources(uniformTestVertSource, ctx), getVtxFragVersionSources(uniformTestFragSource, ctx)));
957 GLint numActiveBlocks = -1;
958 const GLchar* uniformName = "Block.blockVar";
959 GLuint uniformIndices = -1;
962 ctx.glGetProgramiv(program.getProgram(), GL_ACTIVE_UNIFORM_BLOCKS, &numActiveBlocks);
963 ctx.getLog() << TestLog::Message << "// GL_ACTIVE_UNIFORM_BLOCKS = " << numActiveBlocks << TestLog::EndMessage;
964 ctx.expectError(GL_NO_ERROR);
966 ctx.beginSection("GL_INVALID_OPERATION is generated if program is a name of shader object.");
967 ctx.glGetUniformIndices(shader, 1, &uniformName, &uniformIndices);
968 ctx.expectError(GL_INVALID_OPERATION);
971 ctx.beginSection("GL_INVALID_VALUE is generated if program is not name of program or shader object.");
972 ctx.glGetUniformIndices(invalid, 1, &uniformName, &uniformIndices);
973 ctx.expectError(GL_INVALID_VALUE);
977 ctx.glDeleteShader(shader);
980 void get_vertex_attribfv (NegativeTestContext& ctx)
982 GLfloat params = 0.0f;
983 GLint maxVertexAttribs;
985 ctx.beginSection("GL_INVALID_ENUM is generated if pname is not an accepted value.");
986 ctx.glGetVertexAttribfv(0, -1, ¶ms);
987 ctx.expectError(GL_INVALID_ENUM);
990 ctx.beginSection("GL_INVALID_VALUE is generated if index is greater than or equal to GL_MAX_VERTEX_ATTRIBS.");
991 ctx.glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &maxVertexAttribs);
992 ctx.glGetVertexAttribfv(maxVertexAttribs, GL_VERTEX_ATTRIB_ARRAY_ENABLED, ¶ms);
993 ctx.expectError(GL_INVALID_VALUE);
997 void get_vertex_attribiv (NegativeTestContext& ctx)
1000 GLint maxVertexAttribs;
1002 ctx.beginSection("GL_INVALID_ENUM is generated if pname is not an accepted value.");
1003 ctx.glGetVertexAttribiv(0, -1, ¶ms);
1004 ctx.expectError(GL_INVALID_ENUM);
1007 ctx.beginSection("GL_INVALID_VALUE is generated if index is greater than or equal to GL_MAX_VERTEX_ATTRIBS.");
1008 ctx.glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &maxVertexAttribs);
1009 ctx.glGetVertexAttribiv(maxVertexAttribs, GL_VERTEX_ATTRIB_ARRAY_ENABLED, ¶ms);
1010 ctx.expectError(GL_INVALID_VALUE);
1014 void get_vertex_attribi_iv (NegativeTestContext& ctx)
1017 GLint maxVertexAttribs;
1019 ctx.beginSection("GL_INVALID_ENUM is generated if pname is not an accepted value.");
1020 ctx.glGetVertexAttribIiv(0, -1, ¶ms);
1021 ctx.expectError(GL_INVALID_ENUM);
1024 ctx.beginSection("GL_INVALID_VALUE is generated if index is greater than or equal to GL_MAX_VERTEX_ATTRIBS.");
1025 ctx.glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &maxVertexAttribs);
1026 ctx.glGetVertexAttribIiv(maxVertexAttribs, GL_VERTEX_ATTRIB_ARRAY_ENABLED, ¶ms);
1027 ctx.expectError(GL_INVALID_VALUE);
1031 void get_vertex_attribi_uiv (NegativeTestContext& ctx)
1033 GLuint params = (GLuint)-1;
1034 GLint maxVertexAttribs;
1036 ctx.beginSection("GL_INVALID_ENUM is generated if pname is not an accepted value.");
1037 ctx.glGetVertexAttribIuiv(0, -1, ¶ms);
1038 ctx.expectError(GL_INVALID_ENUM);
1041 ctx.beginSection("GL_INVALID_VALUE is generated if index is greater than or equal to GL_MAX_VERTEX_ATTRIBS.");
1042 ctx.glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &maxVertexAttribs);
1043 ctx.glGetVertexAttribIuiv(maxVertexAttribs, GL_VERTEX_ATTRIB_ARRAY_ENABLED, ¶ms);
1044 ctx.expectError(GL_INVALID_VALUE);
1048 void get_vertex_attrib_pointerv (NegativeTestContext& ctx)
1050 GLvoid* ptr[1] = { DE_NULL };
1051 GLint maxVertexAttribs;
1053 ctx.beginSection("GL_INVALID_ENUM is generated if pname is not an accepted value.");
1054 ctx.glGetVertexAttribPointerv(0, -1, &ptr[0]);
1055 ctx.expectError(GL_INVALID_ENUM);
1058 ctx.beginSection("GL_INVALID_VALUE is generated if index is greater than or equal to GL_MAX_VERTEX_ATTRIBS.");
1059 ctx.glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &maxVertexAttribs);
1060 ctx.glGetVertexAttribPointerv(maxVertexAttribs, GL_VERTEX_ATTRIB_ARRAY_POINTER, &ptr[0]);
1061 ctx.expectError(GL_INVALID_VALUE);
1065 void get_frag_data_location (NegativeTestContext& ctx)
1067 GLuint shader = ctx.glCreateShader(GL_VERTEX_SHADER);
1068 GLuint program = ctx.glCreateProgram();
1070 ctx.beginSection("GL_INVALID_OPERATION is generated if program is the name of a shader object.");
1071 ctx.glGetFragDataLocation(shader, "gl_FragColor");
1072 ctx.expectError(GL_INVALID_OPERATION);
1075 ctx.beginSection("GL_INVALID_OPERATION is generated if program has not been linked.");
1076 ctx.glGetFragDataLocation(program, "gl_FragColor");
1077 ctx.expectError(GL_INVALID_OPERATION);
1080 ctx.glDeleteProgram(program);
1081 ctx.glDeleteShader(shader);
1084 // Enumerated state queries: Buffers
1086 void get_buffer_parameteriv (NegativeTestContext& ctx)
1090 ctx.glGenBuffers(1, &buf);
1091 ctx.glBindBuffer(GL_ARRAY_BUFFER, buf);
1093 ctx.beginSection("GL_INVALID_ENUM is generated if target or value is not an accepted value.");
1094 ctx.glGetBufferParameteriv(-1, GL_BUFFER_SIZE, ¶ms);
1095 ctx.expectError(GL_INVALID_ENUM);
1096 ctx.glGetBufferParameteriv(GL_ARRAY_BUFFER, -1, ¶ms);
1097 ctx.expectError(GL_INVALID_ENUM);
1098 ctx.glGetBufferParameteriv(-1, -1, ¶ms);
1099 ctx.expectError(GL_INVALID_ENUM);
1102 ctx.beginSection("GL_INVALID_OPERATION is generated if the reserved buffer object name 0 is bound to target.");
1103 ctx.glBindBuffer(GL_ARRAY_BUFFER, 0);
1104 ctx.glGetBufferParameteriv(GL_ARRAY_BUFFER, GL_BUFFER_SIZE, ¶ms);
1105 ctx.expectError(GL_INVALID_OPERATION);
1108 ctx.glDeleteBuffers(1, &buf);
1111 void get_buffer_parameteri64v (NegativeTestContext& ctx)
1113 GLint64 params = -1;
1115 ctx.glGenBuffers(1, &buf);
1116 ctx.glBindBuffer(GL_ARRAY_BUFFER, buf);
1118 ctx.beginSection("GL_INVALID_ENUM is generated if target or value is not an accepted value.");
1119 ctx.glGetBufferParameteri64v(-1, GL_BUFFER_SIZE, ¶ms);
1120 ctx.expectError(GL_INVALID_ENUM);
1121 ctx.glGetBufferParameteri64v(GL_ARRAY_BUFFER , -1, ¶ms);
1122 ctx.expectError(GL_INVALID_ENUM);
1123 ctx.glGetBufferParameteri64v(-1, -1, ¶ms);
1124 ctx.expectError(GL_INVALID_ENUM);
1127 ctx.beginSection("GL_INVALID_OPERATION is generated if the reserved buffer object name 0 is bound to target.");
1128 ctx.glBindBuffer(GL_ARRAY_BUFFER, 0);
1129 ctx.glGetBufferParameteri64v(GL_ARRAY_BUFFER, GL_BUFFER_SIZE, ¶ms);
1130 ctx.expectError(GL_INVALID_OPERATION);
1133 ctx.glDeleteBuffers(1, &buf);
1136 void get_buffer_pointerv (NegativeTestContext& ctx)
1138 GLvoid* params = DE_NULL;
1140 ctx.glGenBuffers(1, &buf);
1141 ctx.glBindBuffer(GL_ARRAY_BUFFER, buf);
1143 ctx.beginSection("GL_INVALID_ENUM is generated if target or pname is not an accepted value.");
1144 ctx.glGetBufferPointerv(GL_ARRAY_BUFFER, -1, ¶ms);
1145 ctx.expectError(GL_INVALID_ENUM);
1146 ctx.glGetBufferPointerv(-1, GL_BUFFER_MAP_POINTER, ¶ms);
1147 ctx.expectError(GL_INVALID_ENUM);
1150 ctx.beginSection("GL_INVALID_OPERATION is generated if the reserved buffer object name 0 is bound to target.");
1151 ctx.glBindBuffer(GL_ARRAY_BUFFER, 0);
1152 ctx.glGetBufferPointerv(GL_ARRAY_BUFFER, GL_BUFFER_MAP_POINTER, ¶ms);
1153 ctx.expectError(GL_INVALID_OPERATION);
1156 ctx.glDeleteBuffers(1, &buf);
1159 void get_framebuffer_attachment_parameteriv (NegativeTestContext& ctx)
1161 GLint params[1] = { -1 };
1165 ctx.glGenFramebuffers (1, &fbo);
1166 ctx.glGenRenderbuffers (2, rbo);
1168 ctx.glBindFramebuffer (GL_FRAMEBUFFER, fbo);
1169 ctx.glBindRenderbuffer (GL_RENDERBUFFER, rbo[0]);
1170 ctx.glRenderbufferStorage (GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, 16, 16);
1171 ctx.glFramebufferRenderbuffer (GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, rbo[0]);
1172 ctx.glBindRenderbuffer (GL_RENDERBUFFER, rbo[1]);
1173 ctx.glRenderbufferStorage (GL_RENDERBUFFER, GL_STENCIL_INDEX8, 16, 16);
1174 ctx.glFramebufferRenderbuffer (GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, GL_RENDERBUFFER, rbo[1]);
1175 ctx.glCheckFramebufferStatus (GL_FRAMEBUFFER);
1176 ctx.expectError (GL_NO_ERROR);
1178 ctx.beginSection("GL_INVALID_ENUM is generated if target is not one of the accepted tokens.");
1179 ctx.glGetFramebufferAttachmentParameteriv(-1, GL_DEPTH_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, ¶ms[0]); // TYPE is GL_RENDERBUFFER
1180 ctx.expectError(GL_INVALID_ENUM);
1183 ctx.beginSection("GL_INVALID_ENUM is generated if pname is not valid for the value of GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE.");
1184 ctx.glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL, ¶ms[0]); // TYPE is GL_RENDERBUFFER
1185 ctx.expectError(GL_INVALID_ENUM);
1186 ctx.glBindFramebuffer(GL_FRAMEBUFFER, 0);
1187 ctx.glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_BACK, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, ¶ms[0]); // TYPE is GL_FRAMEBUFFER_DEFAULT
1188 ctx.expectError(GL_INVALID_ENUM);
1189 ctx.glBindFramebuffer(GL_FRAMEBUFFER, fbo);
1192 ctx.beginSection("GL_INVALID_OPERATION is generated if attachment is GL_DEPTH_STENCIL_ATTACHMENT and different objects are bound to the depth and stencil attachment points of target.");
1193 ctx.glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, ¶ms[0]);
1194 ctx.expectError(GL_INVALID_OPERATION);
1197 ctx.beginSection("GL_INVALID_OPERATION is generated if the value of GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is GL_NONE and pname is not GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME.");
1198 ctx.glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, ¶ms[0]); // TYPE is GL_NONE
1199 ctx.expectError(GL_NO_ERROR);
1200 ctx.glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE, ¶ms[0]); // TYPE is GL_NONE
1201 ctx.expectError(GL_INVALID_OPERATION);
1204 ctx.beginSection("GL_INVALID_OPERATION or GL_INVALID_ENUM is generated if attachment is not one of the accepted values for the current binding of target.");
1205 ctx.glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_BACK, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, ¶ms[0]); // A FBO is bound so GL_BACK is invalid
1206 ctx.expectError(GL_INVALID_OPERATION, GL_INVALID_ENUM);
1207 ctx.glBindFramebuffer(GL_FRAMEBUFFER, 0);
1208 ctx.glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, ¶ms[0]); // Default framebuffer is bound so GL_COLOR_ATTACHMENT0 is invalid
1209 ctx.expectError(GL_INVALID_OPERATION, GL_INVALID_ENUM);
1212 ctx.glDeleteFramebuffers(1, &fbo);
1215 void get_renderbuffer_parameteriv (NegativeTestContext& ctx)
1217 GLint params[1] = { -1 };
1219 ctx.glGenRenderbuffers(1, &rbo);
1220 ctx.glBindRenderbuffer(GL_RENDERBUFFER, rbo);
1222 ctx.beginSection("GL_INVALID_ENUM is generated if target is not GL_RENDERBUFFER.");
1223 ctx.glGetRenderbufferParameteriv(-1, GL_RENDERBUFFER_WIDTH, ¶ms[0]);
1224 ctx.expectError(GL_INVALID_ENUM);
1227 ctx.beginSection("GL_INVALID_ENUM is generated if pname is not one of the accepted tokens.");
1228 ctx.glGetRenderbufferParameteriv(GL_RENDERBUFFER, -1, ¶ms[0]);
1229 ctx.expectError(GL_INVALID_ENUM);
1232 ctx.beginSection("GL_INVALID_OPERATION is generated if the renderbuffer currently bound to target is zero.");
1233 ctx.glBindRenderbuffer(GL_RENDERBUFFER, 0);
1234 ctx.expectError(GL_NO_ERROR);
1235 ctx.glGetRenderbufferParameteriv(GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, ¶ms[0]);
1236 ctx.expectError(GL_INVALID_OPERATION);
1239 ctx.glDeleteRenderbuffers(1, &rbo);
1240 ctx.glBindRenderbuffer(GL_RENDERBUFFER, 0);
1243 void get_internalformativ (NegativeTestContext& ctx)
1247 deMemset(¶ms[0], 0xcd, sizeof(params));
1249 ctx.beginSection("GL_INVALID_VALUE is generated if bufSize is negative.");
1250 ctx.glGetInternalformativ (GL_RENDERBUFFER, GL_RGBA8, GL_NUM_SAMPLE_COUNTS, -1, ¶ms[0]);
1251 ctx.expectError (GL_INVALID_VALUE);
1254 ctx.beginSection("GL_INVALID_ENUM is generated if pname is not GL_SAMPLES or GL_NUM_SAMPLE_COUNTS.");
1255 ctx.glGetInternalformativ (GL_RENDERBUFFER, GL_RGBA8, -1, 16, ¶ms[0]);
1256 ctx.expectError (GL_INVALID_ENUM);
1259 ctx.beginSection("GL_INVALID_ENUM is generated if internalformat is not color-, depth-, or stencil-renderable.");
1261 if (!ctx.getContextInfo().isExtensionSupported("GL_EXT_render_snorm"))
1263 ctx.glGetInternalformativ (GL_RENDERBUFFER, GL_RG8_SNORM, GL_NUM_SAMPLE_COUNTS, 16, ¶ms[0]);
1264 ctx.expectError (GL_INVALID_ENUM);
1267 ctx.glGetInternalformativ (GL_RENDERBUFFER, GL_COMPRESSED_RGB8_ETC2, GL_NUM_SAMPLE_COUNTS, 16, ¶ms[0]);
1268 ctx.expectError (GL_INVALID_ENUM);
1271 ctx.beginSection("GL_INVALID_ENUM is generated if target is not GL_RENDERBUFFER.");
1272 ctx.glGetInternalformativ (-1, GL_RGBA8, GL_NUM_SAMPLE_COUNTS, 16, ¶ms[0]);
1273 ctx.expectError (GL_INVALID_ENUM);
1274 ctx.glGetInternalformativ (GL_FRAMEBUFFER, GL_RGBA8, GL_NUM_SAMPLE_COUNTS, 16, ¶ms[0]);
1275 ctx.expectError (GL_INVALID_ENUM);
1277 if (!ctx.getContextInfo().isExtensionSupported("GL_EXT_sparse_texture"))
1279 ctx.glGetInternalformativ (GL_TEXTURE_2D, GL_RGBA8, GL_NUM_SAMPLE_COUNTS, 16, ¶ms[0]);
1280 ctx.expectError (GL_INVALID_ENUM);
1286 // Query object queries
1288 void get_queryiv (NegativeTestContext& ctx)
1292 ctx.beginSection("GL_INVALID_ENUM is generated if target or pname is not an accepted value.");
1293 ctx.glGetQueryiv (GL_ANY_SAMPLES_PASSED, -1, ¶ms);
1294 ctx.expectError (GL_INVALID_ENUM);
1295 ctx.glGetQueryiv (-1, GL_CURRENT_QUERY, ¶ms);
1296 ctx.expectError (GL_INVALID_ENUM);
1297 ctx.glGetQueryiv (-1, -1, ¶ms);
1298 ctx.expectError (GL_INVALID_ENUM);
1302 void get_query_objectuiv (NegativeTestContext& ctx)
1306 ctx.glGenQueries (1, &id);
1308 ctx.beginSection("GL_INVALID_OPERATION is generated if id is not the name of a query object.");
1309 ctx.glGetQueryObjectuiv (-1, GL_QUERY_RESULT_AVAILABLE, ¶ms);
1310 ctx.expectError (GL_INVALID_OPERATION);
1311 ctx.getLog() << TestLog::Message << "// Note: " << id << " is not a query object yet, since it hasn't been used by glBeginQuery" << TestLog::EndMessage;
1312 ctx.glGetQueryObjectuiv (id, GL_QUERY_RESULT_AVAILABLE, ¶ms);
1313 ctx.expectError (GL_INVALID_OPERATION);
1316 ctx.glBeginQuery (GL_ANY_SAMPLES_PASSED, id);
1317 ctx.glEndQuery (GL_ANY_SAMPLES_PASSED);
1319 ctx.beginSection("GL_INVALID_ENUM is generated if pname is not an accepted value.");
1320 ctx.glGetQueryObjectuiv (id, -1, ¶ms);
1321 ctx.expectError (GL_INVALID_ENUM);
1324 ctx.beginSection("GL_INVALID_OPERATION is generated if id is the name of a currently active query object.");
1325 ctx.glBeginQuery (GL_ANY_SAMPLES_PASSED, id);
1326 ctx.expectError (GL_NO_ERROR);
1327 ctx.glGetQueryObjectuiv (id, GL_QUERY_RESULT_AVAILABLE, ¶ms);
1328 ctx.expectError (GL_INVALID_OPERATION);
1329 ctx.glEndQuery (GL_ANY_SAMPLES_PASSED);
1330 ctx.expectError (GL_NO_ERROR);
1333 ctx.glDeleteQueries (1, &id);
1336 // Sync object queries
1338 void get_synciv (NegativeTestContext& ctx)
1340 GLsizei length = -1;
1344 deMemset(&values[0], 0xcd, sizeof(values));
1346 ctx.beginSection("GL_INVALID_VALUE is generated if sync is not the name of a sync object.");
1347 ctx.glGetSynciv(0, GL_OBJECT_TYPE, 32, &length, &values[0]);
1348 ctx.expectError(GL_INVALID_VALUE);
1351 ctx.beginSection("GL_INVALID_ENUM is generated if pname is not one of the accepted tokens.");
1352 sync = ctx.glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
1353 ctx.expectError(GL_NO_ERROR);
1354 ctx.glGetSynciv(sync, -1, 32, &length, &values[0]);
1355 ctx.expectError(GL_INVALID_ENUM);
1358 ctx.glDeleteSync(sync);
1360 ctx.beginSection("GL_INVALID_VALUE is generated if bufSize is negative.");
1361 sync = ctx.glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
1362 ctx.expectError(GL_NO_ERROR);
1363 ctx.glGetSynciv(sync, GL_OBJECT_TYPE, -1, &length, &values[0]);
1364 ctx.expectError(GL_INVALID_VALUE);
1367 ctx.glDeleteSync(sync);
1370 // Enumerated boolean state queries
1372 void is_enabled (NegativeTestContext& ctx)
1374 ctx.beginSection("GL_INVALID_ENUM is generated if cap is not an accepted value.");
1375 ctx.glIsEnabled(-1);
1376 ctx.expectError(GL_INVALID_ENUM);
1377 ctx.glIsEnabled(GL_TRIANGLES);
1378 ctx.expectError(GL_INVALID_ENUM);
1382 void is_enabledi (NegativeTestContext& ctx)
1384 TCU_CHECK_AND_THROW(NotSupportedError, contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)), "This test requires a higher context version.");
1386 ctx.beginSection("GL_INVALID_ENUM is generated if cap is not an accepted value.");
1387 ctx.glIsEnabledi(-1, 1);
1388 ctx.expectError(GL_INVALID_ENUM);
1389 ctx.glIsEnabledi(GL_TRIANGLES, 1);
1390 ctx.expectError(GL_INVALID_ENUM);
1393 ctx.beginSection("GL_INVALID_VALUE is generated if index is outside the valid range for the indexed state cap.");
1394 ctx.glIsEnabledi(GL_BLEND, -1);
1395 ctx.expectError(GL_INVALID_VALUE);
1401 void hint (NegativeTestContext& ctx)
1403 ctx.beginSection("GL_INVALID_ENUM is generated if either target or mode is not an accepted value.");
1404 ctx.glHint(GL_GENERATE_MIPMAP_HINT, -1);
1405 ctx.expectError(GL_INVALID_ENUM);
1406 ctx.glHint(-1, GL_FASTEST);
1407 ctx.expectError(GL_INVALID_ENUM);
1409 ctx.expectError(GL_INVALID_ENUM);
1413 std::vector<FunctionContainer> getNegativeStateApiTestFunctions ()
1415 const FunctionContainer funcs[] =
1417 {enable, "enable", "Invalid glEnable() usage" },
1418 {disable, "disable", "Invalid glDisable() usage" },
1419 {get_booleanv, "get_booleanv", "Invalid glGetBooleanv() usage" },
1420 {get_floatv, "get_floatv", "Invalid glGetFloatv() usage" },
1421 {get_integerv, "get_integerv", "Invalid glGetIntegerv() usage" },
1422 {get_integer64v, "get_integer64v", "Invalid glGetInteger64v() usage" },
1423 {get_integeri_v, "get_integeri_v", "Invalid glGetIntegeri_v() usage" },
1424 {get_booleani_v, "get_booleani_v", "Invalid glGetBooleani_v() usage" },
1425 {get_integer64i_v, "get_integer64i_v", "Invalid glGetInteger64i_v() usage" },
1426 {get_string, "get_string", "Invalid glGetString() usage" },
1427 {get_stringi, "get_stringi", "Invalid glGetStringi() usage" },
1428 {get_attached_shaders, "get_attached_shaders", "Invalid glGetAttachedShaders() usage" },
1429 {get_shaderiv, "get_shaderiv", "Invalid glGetShaderiv() usage" },
1430 {get_shader_info_log, "get_shader_info_log", "Invalid glGetShaderInfoLog() usage" },
1431 {get_shader_precision_format, "get_shader_precision_format", "Invalid glGetShaderPrecisionFormat() usage" },
1432 {get_shader_source, "get_shader_source", "Invalid glGetShaderSource() usage" },
1433 {get_programiv, "get_programiv", "Invalid glGetProgramiv() usage" },
1434 {get_program_info_log, "get_program_info_log", "Invalid glGetProgramInfoLog() usage" },
1435 {get_tex_parameterfv, "get_tex_parameterfv", "Invalid glGetTexParameterfv() usage" },
1436 {get_tex_parameteriv, "get_tex_parameteriv", "Invalid glGetTexParameteriv() usage" },
1437 {get_uniformfv, "get_uniformfv", "Invalid glGetUniformfv() usage" },
1438 {get_uniformiv, "get_uniformiv", "Invalid glGetUniformiv() usage" },
1439 {get_uniformuiv, "get_uniformuiv", "Invalid glGetUniformuiv() usage" },
1440 {get_active_uniform, "get_active_uniform", "Invalid glGetActiveUniform() usage" },
1441 {get_active_uniformsiv, "get_active_uniformsiv", "Invalid glGetActiveUniformsiv() usage" },
1442 {get_active_uniform_blockiv, "get_active_uniform_blockiv", "Invalid glGetActiveUniformBlockiv() usage" },
1443 {get_active_uniform_block_name, "get_active_uniform_block_name", "Invalid glGetActiveUniformBlockName() usage" },
1444 {get_active_attrib, "get_active_attrib", "Invalid glGetActiveAttrib() usage" },
1445 {get_uniform_indices, "get_uniform_indices", "Invalid glGetUniformIndices() usage" },
1446 {get_vertex_attribfv, "get_vertex_attribfv", "Invalid glGetVertexAttribfv() usage" },
1447 {get_vertex_attribiv, "get_vertex_attribiv", "Invalid glGetVertexAttribiv() usage" },
1448 {get_vertex_attribi_iv, "get_vertex_attribi_iv", "Invalid glGetVertexAttribIiv() usage" },
1449 {get_vertex_attribi_uiv, "get_vertex_attribi_uiv", "Invalid glGetVertexAttribIuiv() usage" },
1450 {get_vertex_attrib_pointerv, "get_vertex_attrib_pointerv", "Invalid glGetVertexAttribPointerv() usage" },
1451 {get_frag_data_location, "get_frag_data_location", "Invalid glGetFragDataLocation() usage" },
1452 {get_buffer_parameteriv, "get_buffer_parameteriv", "Invalid glGetBufferParameteriv() usage" },
1453 {get_buffer_parameteri64v, "get_buffer_parameteri64v", "Invalid glGetBufferParameteri64v() usage" },
1454 {get_buffer_pointerv, "get_buffer_pointerv", "Invalid glGetBufferPointerv() usage" },
1455 {get_framebuffer_attachment_parameteriv, "get_framebuffer_attachment_parameteriv", "Invalid glGetFramebufferAttachmentParameteriv() usage" },
1456 {get_renderbuffer_parameteriv, "get_renderbuffer_parameteriv", "Invalid glGetRenderbufferParameteriv() usage" },
1457 {get_internalformativ, "get_internalformativ", "Invalid glGetInternalformativ() usage" },
1458 {get_queryiv, "get_queryiv", "Invalid glGetQueryiv() usage" },
1459 {get_query_objectuiv, "get_query_objectuiv", "Invalid glGetQueryObjectuiv() usage" },
1460 {get_synciv, "get_synciv", "Invalid glGetSynciv() usage" },
1461 {is_enabled, "is_enabled", "Invalid glIsEnabled() usage" },
1462 {hint, "hint", "Invalid glHint() usage" },
1463 {enablei, "enablei", "Invalid glEnablei() usage" },
1464 {disablei, "disablei", "Invalid glDisablei() usage" },
1465 {get_tex_parameteriiv, "get_tex_parameteriiv", "Invalid glGetTexParameterIiv() usage" },
1466 {get_tex_parameteriuiv, "get_tex_parameteriuiv", "Invalid glGetTexParameterIuiv() usage" },
1467 {get_nuniformfv, "get_nuniformfv", "Invalid glGetnUniformfv() usage" },
1468 {get_nuniformiv, "get_nuniformiv", "Invalid glGetnUniformiv() usage" },
1469 {get_nuniformuiv, "get_nuniformuiv", "Invalid glGetnUniformuiv() usage" },
1470 {is_enabledi, "is_enabledi", "Invalid glIsEnabledi() usage" },
1473 return std::vector<FunctionContainer>(DE_ARRAY_BEGIN(funcs), DE_ARRAY_END(funcs));
1476 } // NegativeTestShared