xref: /aosp_15_r20/external/deqp/modules/gles2/functional/es2fNegativeBufferApiTests.cpp (revision 35238bce31c2a825756842865a792f8cf7f89930)
1 /*-------------------------------------------------------------------------
2  * drawElements Quality Program OpenGL ES 2.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 Buffer API tests.
22  *//*--------------------------------------------------------------------*/
23 
24 #include "es2fNegativeBufferApiTests.hpp"
25 #include "es2fApiCase.hpp"
26 #include "gluContextInfo.hpp"
27 
28 #include "glwEnums.hpp"
29 #include "glwDefs.hpp"
30 
31 using namespace glw; // GL types
32 
33 namespace deqp
34 {
35 namespace gles2
36 {
37 namespace Functional
38 {
39 
40 using tcu::TestLog;
41 
NegativeBufferApiTests(Context & context)42 NegativeBufferApiTests::NegativeBufferApiTests(Context &context)
43     : TestCaseGroup(context, "buffer", "Negative Buffer API Cases")
44 {
45 }
46 
~NegativeBufferApiTests(void)47 NegativeBufferApiTests::~NegativeBufferApiTests(void)
48 {
49 }
50 
init(void)51 void NegativeBufferApiTests::init(void)
52 {
53     ES2F_ADD_API_CASE(bind_buffer, "Invalid glBindBuffer() usage", {
54         m_log << TestLog::Section("", "GL_INVALID_ENUM is generated if target is not one of the allowable values.");
55         glBindBuffer(-1, 0);
56         expectError(GL_INVALID_ENUM);
57         m_log << TestLog::EndSection;
58     });
59     ES2F_ADD_API_CASE(delete_buffers, "Invalid glDeleteBuffers() usage", {
60         m_log << TestLog::Section("", "GL_INVALID_VALUE is generated if n is negative.");
61         glDeleteBuffers(-1, 0);
62         expectError(GL_INVALID_VALUE);
63         m_log << TestLog::EndSection;
64     });
65     ES2F_ADD_API_CASE(gen_buffers, "Invalid glGenBuffers() usage", {
66         m_log << TestLog::Section("", "GL_INVALID_VALUE is generated if n is negative.");
67         glGenBuffers(-1, 0);
68         expectError(GL_INVALID_VALUE);
69         m_log << TestLog::EndSection;
70     });
71     ES2F_ADD_API_CASE(buffer_data, "Invalid glBufferData() usage", {
72         GLuint buffer;
73         glGenBuffers(1, &buffer);
74         glBindBuffer(GL_ARRAY_BUFFER, buffer);
75 
76         m_log << TestLog::Section(
77             "", "GL_INVALID_ENUM is generated if target is not GL_ARRAY_BUFFER or GL_ELEMENT_ARRAY_BUFFER.");
78         glBufferData(-1, 0, NULL, GL_STREAM_DRAW);
79         expectError(GL_INVALID_ENUM);
80         m_log << TestLog::EndSection;
81 
82         m_log << TestLog::Section(
83             "", "GL_INVALID_ENUM is generated if usage is not GL_STREAM_DRAW, GL_STATIC_DRAW, or GL_DYNAMIC_DRAW.");
84         glBufferData(GL_ARRAY_BUFFER, 0, NULL, -1);
85         expectError(GL_INVALID_ENUM);
86         m_log << TestLog::EndSection;
87 
88         m_log << TestLog::Section("", "GL_INVALID_VALUE is generated if size is negative.");
89         glBufferData(GL_ARRAY_BUFFER, -1, NULL, GL_STREAM_DRAW);
90         expectError(GL_INVALID_VALUE);
91         m_log << TestLog::EndSection;
92 
93         m_log << TestLog::Section(
94             "", "GL_INVALID_OPERATION is generated if the reserved buffer object name 0 is bound to target.");
95         glBindBuffer(GL_ARRAY_BUFFER, 0);
96         glBufferData(GL_ARRAY_BUFFER, 0, NULL, GL_STREAM_DRAW);
97         expectError(GL_INVALID_OPERATION);
98         m_log << TestLog::EndSection;
99 
100         glDeleteBuffers(1, &buffer);
101     });
102     ES2F_ADD_API_CASE(buffer_sub_data, "Invalid glBufferSubData() usage", {
103         GLuint buffer;
104         glGenBuffers(1, &buffer);
105         glBindBuffer(GL_ARRAY_BUFFER, buffer);
106         glBufferData(GL_ARRAY_BUFFER, 10, 0, GL_STREAM_DRAW);
107 
108         m_log << TestLog::Section(
109             "", "GL_INVALID_ENUM is generated if target is not GL_ARRAY_BUFFER or GL_ELEMENT_ARRAY_BUFFER.");
110         glBufferSubData(-1, 1, 1, 0);
111         expectError(GL_INVALID_ENUM);
112         m_log << TestLog::EndSection;
113 
114         m_log << TestLog::Section(
115             "", "GL_INVALID_OPERATION is generated if the reserved buffer object name 0 is bound to target.");
116         glBindBuffer(GL_ARRAY_BUFFER, 0);
117         glBufferSubData(GL_ARRAY_BUFFER, 1, 1, 0);
118         expectError(GL_INVALID_OPERATION);
119         m_log << TestLog::EndSection;
120 
121         glDeleteBuffers(1, &buffer);
122     });
123     ES2F_ADD_API_CASE(buffer_sub_data_size_offset, "Invalid glBufferSubData() usage", {
124         GLuint buffer;
125         glGenBuffers(1, &buffer);
126         glBindBuffer(GL_ARRAY_BUFFER, buffer);
127         glBufferData(GL_ARRAY_BUFFER, 10, 0, GL_STREAM_DRAW);
128 
129         m_log << TestLog::Section(
130             "", "GL_INVALID_VALUE is generated if offset or size is negative, or if together they define a region of "
131                 "memory that extends beyond the buffer object's allocated data store.");
132         glBufferSubData(GL_ARRAY_BUFFER, -1, 1, 0);
133         expectError(GL_INVALID_VALUE);
134         glBufferSubData(GL_ARRAY_BUFFER, -1, -1, 0);
135         expectError(GL_INVALID_VALUE);
136         glBufferSubData(GL_ARRAY_BUFFER, 1, -1, 0);
137         expectError(GL_INVALID_VALUE);
138         glBufferSubData(GL_ARRAY_BUFFER, 15, 1, 0);
139         expectError(GL_INVALID_VALUE);
140         glBufferSubData(GL_ARRAY_BUFFER, 1, 15, 0);
141         expectError(GL_INVALID_VALUE);
142         glBufferSubData(GL_ARRAY_BUFFER, 8, 8, 0);
143         expectError(GL_INVALID_VALUE);
144         m_log << TestLog::EndSection;
145 
146         glDeleteBuffers(1, &buffer);
147     });
148     ES2F_ADD_API_CASE(clear, "Invalid glClear() usage", {
149         m_log << TestLog::Section(
150             "", "GL_INVALID_VALUE is generated if any bit other than the three defined bits is set in mask.");
151         glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
152         expectError(GL_NO_ERROR);
153         glClear(0x00000200);
154         expectError(GL_INVALID_VALUE);
155         glClear(0x00001000);
156         expectError(GL_INVALID_VALUE);
157         glClear(0x00000010);
158         expectError(GL_INVALID_VALUE);
159         m_log << TestLog::EndSection;
160     });
161     ES2F_ADD_API_CASE(read_pixels, "Invalid glReadPixels() usage", {
162         std::vector<GLubyte> ubyteData(4);
163 
164         m_log << TestLog::Section(
165             "", "GL_INVALID_OPERATION is generated if the combination of format and type is unsupported.");
166         glReadPixels(0, 0, 1, 1, GL_LUMINANCE_ALPHA, GL_UNSIGNED_SHORT_4_4_4_4, &ubyteData[0]);
167         expectError(GL_INVALID_OPERATION);
168         m_log << TestLog::EndSection;
169 
170         m_log << TestLog::Section("", "GL_INVALID_VALUE is generated if either width or height is negative.");
171         glReadPixels(0, 0, -1, 1, GL_RGBA, GL_UNSIGNED_BYTE, &ubyteData[0]);
172         expectError(GL_INVALID_VALUE);
173         glReadPixels(0, 0, 1, -1, GL_RGBA, GL_UNSIGNED_BYTE, &ubyteData[0]);
174         expectError(GL_INVALID_VALUE);
175         glReadPixels(0, 0, -1, -1, GL_RGBA, GL_UNSIGNED_BYTE, &ubyteData[0]);
176         expectError(GL_INVALID_VALUE);
177         m_log << TestLog::EndSection;
178 
179         m_log << TestLog::Section("", "GL_INVALID_FRAMEBUFFER_OPERATION is generated if the currently bound "
180                                       "framebuffer is not framebuffer complete.");
181         GLuint fbo;
182         glGenFramebuffers(1, &fbo);
183         glBindFramebuffer(GL_FRAMEBUFFER, fbo);
184         glCheckFramebufferStatus(GL_FRAMEBUFFER);
185         glReadPixels(0, 0, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, &ubyteData[0]);
186         expectError(GL_INVALID_FRAMEBUFFER_OPERATION);
187         m_log << TestLog::EndSection;
188     });
189     ES2F_ADD_API_CASE(read_pixels_format_mismatch, "Invalid glReadPixels() usage", {
190         std::vector<GLubyte> ubyteData(4);
191         std::vector<GLushort> ushortData(4);
192 
193         m_log << TestLog::Section(
194             "", "Unsupported combinations of format and type will generate an INVALID_OPERATION error.");
195         glReadPixels(0, 0, 1, 1, GL_RGBA, GL_UNSIGNED_SHORT_5_6_5, &ushortData[0]);
196         expectError(GL_INVALID_OPERATION);
197         glReadPixels(0, 0, 1, 1, GL_ALPHA, GL_UNSIGNED_SHORT_5_6_5, &ushortData[0]);
198         expectError(GL_INVALID_OPERATION);
199         glReadPixels(0, 0, 1, 1, GL_RGB, GL_UNSIGNED_SHORT_4_4_4_4, &ushortData[0]);
200         expectError(GL_INVALID_OPERATION);
201         glReadPixels(0, 0, 1, 1, GL_ALPHA, GL_UNSIGNED_SHORT_4_4_4_4, &ushortData[0]);
202         expectError(GL_INVALID_OPERATION);
203         glReadPixels(0, 0, 1, 1, GL_RGB, GL_UNSIGNED_SHORT_5_5_5_1, &ushortData[0]);
204         expectError(GL_INVALID_OPERATION);
205         glReadPixels(0, 0, 1, 1, GL_ALPHA, GL_UNSIGNED_SHORT_5_5_5_1, &ushortData[0]);
206         expectError(GL_INVALID_OPERATION);
207         m_log << TestLog::EndSection;
208 
209         m_log << TestLog::Section(
210             "", "GL_RGBA/GL_UNSIGNED_BYTE is always accepted and the other acceptable pair can be discovered by "
211                 "querying GL_IMPLEMENTATION_COLOR_READ_FORMAT and GL_IMPLEMENTATION_COLOR_READ_TYPE.");
212         glReadPixels(0, 0, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, &ubyteData[0]);
213         expectError(GL_NO_ERROR);
214         GLint readFormat;
215         GLint readType;
216         glGetIntegerv(GL_IMPLEMENTATION_COLOR_READ_FORMAT, &readFormat);
217         glGetIntegerv(GL_IMPLEMENTATION_COLOR_READ_TYPE, &readType);
218         glReadPixels(0, 0, 1, 1, readFormat, readType, &ubyteData[0]);
219         expectError(GL_NO_ERROR);
220         m_log << TestLog::EndSection;
221     });
222 
223     // Framebuffer Objects
224 
225     ES2F_ADD_API_CASE(bind_framebuffer, "Invalid glBindFramebuffer() usage", {
226         m_log << TestLog::Section("", "GL_INVALID_ENUM is generated if target is not GL_FRAMEBUFFER.");
227         glBindFramebuffer(-1, 0);
228         expectError(GL_INVALID_ENUM);
229         glBindFramebuffer(GL_RENDERBUFFER, 0);
230         expectError(GL_INVALID_ENUM);
231         m_log << TestLog::EndSection;
232     });
233     ES2F_ADD_API_CASE(bind_renderbuffer, "Invalid glBindRenderbuffer() usage", {
234         m_log << TestLog::Section("", "GL_INVALID_ENUM is generated if target is not GL_RENDERBUFFER.");
235         glBindRenderbuffer(-1, 0);
236         expectError(GL_INVALID_ENUM);
237         glBindRenderbuffer(GL_FRAMEBUFFER, 0);
238         expectError(GL_INVALID_ENUM);
239         m_log << TestLog::EndSection;
240     });
241     ES2F_ADD_API_CASE(check_framebuffer_status, "Invalid glCheckFramebufferStatus() usage", {
242         m_log << TestLog::Section("", "GL_INVALID_ENUM is generated if target is not GL_FRAMEBUFFER.");
243         glCheckFramebufferStatus(-1);
244         expectError(GL_INVALID_ENUM);
245         glCheckFramebufferStatus(GL_RENDERBUFFER);
246         expectError(GL_INVALID_ENUM);
247         m_log << TestLog::EndSection;
248     });
249     ES2F_ADD_API_CASE(gen_framebuffers, "Invalid glGenFramebuffers() usage", {
250         m_log << TestLog::Section("", "GL_INVALID_VALUE is generated if n is negative.");
251         glGenFramebuffers(-1, 0);
252         expectError(GL_INVALID_VALUE);
253         m_log << TestLog::EndSection;
254     });
255     ES2F_ADD_API_CASE(gen_renderbuffers, "Invalid glGenRenderbuffers() usage", {
256         m_log << TestLog::Section("", "GL_INVALID_VALUE is generated if n is negative.");
257         glGenRenderbuffers(-1, 0);
258         expectError(GL_INVALID_VALUE);
259         m_log << TestLog::EndSection;
260     });
261     ES2F_ADD_API_CASE(delete_framebuffers, "Invalid glDeleteFramebuffers() usage", {
262         m_log << TestLog::Section("", "GL_INVALID_VALUE is generated if n is negative.");
263         glDeleteFramebuffers(-1, 0);
264         expectError(GL_INVALID_VALUE);
265         m_log << TestLog::EndSection;
266     });
267     ES2F_ADD_API_CASE(delete_renderbuffers, "Invalid glDeleteRenderbuffers() usage", {
268         ;
269         m_log << TestLog::Section("", "GL_INVALID_VALUE is generated if n is negative.");
270         glDeleteRenderbuffers(-1, 0);
271         expectError(GL_INVALID_VALUE);
272         m_log << TestLog::EndSection;
273     });
274     ES2F_ADD_API_CASE(framebuffer_renderbuffer, "Invalid glFramebufferRenderbuffer() usage", {
275         GLuint fbo;
276         GLuint rbo;
277         glGenFramebuffers(1, &fbo);
278         glBindFramebuffer(GL_FRAMEBUFFER, fbo);
279         glGenRenderbuffers(1, &rbo);
280 
281         m_log << TestLog::Section("", "GL_INVALID_ENUM is generated if target is not GL_FRAMEBUFFER.");
282         glFramebufferRenderbuffer(-1, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, 0);
283         expectError(GL_INVALID_ENUM);
284         m_log << TestLog::EndSection;
285 
286         m_log << TestLog::Section("",
287                                   "GL_INVALID_ENUM is generated if attachment is not an accepted attachment point.");
288         glFramebufferRenderbuffer(GL_FRAMEBUFFER, -1, GL_RENDERBUFFER, 0);
289         expectError(GL_INVALID_ENUM);
290         m_log << TestLog::EndSection;
291 
292         m_log << TestLog::Section("", "GL_INVALID_ENUM is generated if renderbuffertarget is not GL_RENDERBUFFER.");
293         glBindRenderbuffer(GL_RENDERBUFFER, rbo);
294         glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, -1, rbo);
295         expectError(GL_INVALID_ENUM);
296         glBindRenderbuffer(GL_RENDERBUFFER, 0);
297         m_log << TestLog::EndSection;
298 
299         m_log << TestLog::Section("", "GL_INVALID_OPERATION is generated if renderbuffer is neither 0 nor the name of "
300                                       "an existing renderbuffer object.");
301         glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, -1);
302         expectError(GL_INVALID_OPERATION);
303         m_log << TestLog::EndSection;
304 
305         m_log << TestLog::Section(
306             "", "GL_INVALID_OPERATION is generated if the default framebuffer object name 0 is bound.");
307         glBindFramebuffer(GL_FRAMEBUFFER, 0);
308         glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, 0);
309         expectError(GL_INVALID_OPERATION);
310         m_log << TestLog::EndSection;
311 
312         glDeleteRenderbuffers(1, &rbo);
313         glDeleteFramebuffers(1, &fbo);
314     });
315     ES2F_ADD_API_CASE(framebuffer_texture2d, "Invalid glFramebufferTexture2D() usage", {
316         GLuint fbo;
317         GLuint tex2D;
318         GLuint texCube;
319         glGenFramebuffers(1, &fbo);
320         glBindFramebuffer(GL_FRAMEBUFFER, fbo);
321         glGenTextures(1, &tex2D);
322         glBindTexture(GL_TEXTURE_2D, tex2D);
323         glGenTextures(1, &texCube);
324         glBindTexture(GL_TEXTURE_CUBE_MAP, texCube);
325         expectError(GL_NO_ERROR);
326 
327         m_log << TestLog::Section("", "GL_INVALID_ENUM is generated if target is not GL_FRAMEBUFFER.");
328         glFramebufferTexture2D(-1, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 0, 0);
329         expectError(GL_INVALID_ENUM);
330         m_log << TestLog::EndSection;
331 
332         m_log << TestLog::Section("", "GL_INVALID_ENUM is generated if textarget is not an accepted texture target.");
333         glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, -1, tex2D, 0);
334         expectError(GL_INVALID_ENUM);
335         m_log << TestLog::EndSection;
336 
337         m_log << TestLog::Section("",
338                                   "GL_INVALID_ENUM is generated if attachment is not an accepted attachment point.");
339         glFramebufferTexture2D(GL_FRAMEBUFFER, -1, GL_TEXTURE_2D, 0, 0);
340         expectError(GL_INVALID_ENUM);
341         m_log << TestLog::EndSection;
342 
343         if (!(m_context.getContextInfo().isExtensionSupported("GL_OES_fbo_render_mipmap") ||
344               m_context.getContextInfo().isES3Compatible()))
345         {
346             m_log << TestLog::Section("", "GL_INVALID_VALUE is generated if level is not 0.");
347             glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, tex2D, 3);
348             expectError(GL_INVALID_VALUE);
349             m_log << TestLog::EndSection;
350         }
351 
352         m_log << TestLog::Section(
353             "",
354             "GL_INVALID_OPERATION is generated if texture is neither 0 nor the name of an existing texture object.");
355         glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, -1, 0);
356         expectError(GL_INVALID_OPERATION);
357         m_log << TestLog::EndSection;
358 
359         m_log << TestLog::Section("", "GL_INVALID_OPERATION is generated if texture is the name of an existing "
360                                       "two-dimensional texture object but textarget is not GL_TEXTURE_2D.");
361 
362         expectError(GL_NO_ERROR);
363         glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_CUBE_MAP_POSITIVE_X, tex2D, 0);
364         expectError(GL_INVALID_OPERATION);
365         glDeleteTextures(1, &tex2D);
366         m_log << TestLog::EndSection;
367 
368         m_log << TestLog::Section("", "GL_INVALID_OPERATION is generated if texture is the name of an existing cube "
369                                       "map texture object but textarget is GL_TEXTURE_2D.");
370         glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, texCube, 0);
371         expectError(GL_INVALID_OPERATION);
372         glDeleteTextures(1, &texCube);
373         m_log << TestLog::EndSection;
374 
375         m_log << TestLog::Section(
376             "", "GL_INVALID_OPERATION is generated if the default framebuffer object name 0 is bound.");
377         glBindFramebuffer(GL_FRAMEBUFFER, 0);
378         glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, 0, 0);
379         expectError(GL_INVALID_OPERATION);
380         m_log << TestLog::EndSection;
381 
382         glDeleteFramebuffers(1, &fbo);
383     });
384     ES2F_ADD_API_CASE(renderbuffer_storage, "Invalid glRenderbufferStorage() usage", {
385         GLuint rbo;
386         glGenRenderbuffers(1, &rbo);
387         glBindRenderbuffer(GL_RENDERBUFFER, rbo);
388 
389         m_log << TestLog::Section("", "GL_INVALID_ENUM is generated if target is not GL_RENDERBUFFER.");
390         glRenderbufferStorage(-1, GL_RGBA4, 1, 1);
391         expectError(GL_INVALID_ENUM);
392         glRenderbufferStorage(GL_FRAMEBUFFER, GL_RGBA4, 1, 1);
393         expectError(GL_INVALID_ENUM);
394         m_log << TestLog::EndSection;
395 
396         m_log << TestLog::Section("", "GL_INVALID_ENUM is generated if internalformat is not an accepted format.");
397         glRenderbufferStorage(GL_RENDERBUFFER, -1, 1, 1);
398         expectError(GL_INVALID_ENUM);
399         glRenderbufferStorage(GL_RENDERBUFFER, GL_RGBA, 1, 1);
400         expectError(GL_INVALID_ENUM);
401         glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT, 1, 1);
402         expectError(GL_INVALID_ENUM);
403         m_log << TestLog::EndSection;
404 
405         m_log << TestLog::Section("", "GL_INVALID_VALUE is generated if width or height is less than zero.");
406         glRenderbufferStorage(GL_RENDERBUFFER, GL_RGBA4, -1, 1);
407         expectError(GL_INVALID_VALUE);
408         glRenderbufferStorage(GL_RENDERBUFFER, GL_RGBA4, 1, -1);
409         expectError(GL_INVALID_VALUE);
410         glRenderbufferStorage(GL_RENDERBUFFER, GL_RGBA4, -1, -1);
411         expectError(GL_INVALID_VALUE);
412         m_log << TestLog::EndSection;
413 
414         m_log << TestLog::Section(
415             "", "GL_INVALID_VALUE is generated if width or height is greater than GL_MAX_RENDERBUFFER_SIZE.");
416         GLint maxSize;
417         glGetIntegerv(GL_MAX_RENDERBUFFER_SIZE, &maxSize);
418         glRenderbufferStorage(GL_RENDERBUFFER, GL_RGBA4, 1, maxSize + 1);
419         expectError(GL_INVALID_VALUE);
420         glRenderbufferStorage(GL_RENDERBUFFER, GL_RGBA4, maxSize + 1, 1);
421         expectError(GL_INVALID_VALUE);
422         glRenderbufferStorage(GL_RENDERBUFFER, GL_RGBA4, maxSize + 1, maxSize + 1);
423         expectError(GL_INVALID_VALUE);
424         m_log << TestLog::EndSection;
425 
426         m_log << TestLog::Section(
427             "", "GL_INVALID_OPERATION is generated if the reserved renderbuffer object name 0 is bound.");
428         glBindRenderbuffer(GL_RENDERBUFFER, 0);
429         glRenderbufferStorage(GL_RENDERBUFFER, GL_RGBA4, 1, 1);
430         expectError(GL_INVALID_OPERATION);
431         m_log << TestLog::EndSection;
432 
433         glDeleteRenderbuffers(1, &rbo);
434     });
435 }
436 
437 } // namespace Functional
438 } // namespace gles2
439 } // namespace deqp
440