Fix crash on app list start page keyboard navigation with <4 apps.
[chromium-blink-merge.git] / gpu / command_buffer / common / gles2_cmd_utils_unittest.cc
blob58a6c383bc0f9344515f8ad3aa43c531cdebd81c
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "gpu/command_buffer/common/gles2_cmd_utils.h"
7 #include <limits>
8 #include <GLES2/gl2.h>
9 #include <GLES2/gl2ext.h>
10 #include <GLES2/gl2extchromium.h>
11 #include <GLES3/gl3.h>
13 #include "testing/gtest/include/gtest/gtest.h"
15 namespace gpu {
16 namespace gles2 {
18 class GLES2UtilTest : public testing:: Test {
19 protected:
20 GLES2Util util_;
23 TEST_F(GLES2UtilTest, SafeMultiplyUint32) {
24 uint32_t result = 0;
25 EXPECT_TRUE(SafeMultiplyUint32(2u, 3u, &result));
26 EXPECT_EQ(6u, result);
27 EXPECT_FALSE(SafeMultiplyUint32(0x80000000u, 2u, &result));
28 EXPECT_EQ(0u, result);
29 EXPECT_TRUE(SafeMultiplyUint32(0x2u, 0x7FFFFFFFu, &result));
30 EXPECT_EQ(0xFFFFFFFEu, result);
31 EXPECT_FALSE(SafeMultiplyUint32(2u, 0x80000000u, &result));
32 EXPECT_EQ(0u, result);
35 TEST_F(GLES2UtilTest, SafeAddUint32) {
36 uint32_t result = 0;
37 EXPECT_TRUE(SafeAddUint32(2u, 3u, &result));
38 EXPECT_EQ(5u, result);
39 EXPECT_FALSE(SafeAddUint32(0x80000000u, 0x80000000u, &result));
40 EXPECT_EQ(0u, result);
41 EXPECT_TRUE(SafeAddUint32(0xFFFFFFFEu, 0x1u, &result));
42 EXPECT_EQ(0xFFFFFFFFu, result);
43 EXPECT_FALSE(SafeAddUint32(0xFFFFFFFEu, 0x2u, &result));
44 EXPECT_EQ(0u, result);
45 EXPECT_TRUE(SafeAddUint32(0x1u, 0xFFFFFFFEu, &result));
46 EXPECT_EQ(0xFFFFFFFFu, result);
47 EXPECT_FALSE(SafeAddUint32(0x2u, 0xFFFFFFFEu, &result));
48 EXPECT_EQ(0u, result);
51 TEST_F(GLES2UtilTest, SafeAddInt32) {
52 int32_t result = 0;
53 const int32_t kMax = std::numeric_limits<int32_t>::max();
54 const int32_t kMin = std::numeric_limits<int32_t>::min();
55 EXPECT_TRUE(SafeAddInt32(2, 3, &result));
56 EXPECT_EQ(5, result);
57 EXPECT_FALSE(SafeAddInt32(kMax, 1, &result));
58 EXPECT_EQ(0, result);
59 EXPECT_TRUE(SafeAddInt32(kMin + 1, -1, &result));
60 EXPECT_EQ(kMin, result);
61 EXPECT_FALSE(SafeAddInt32(kMin, -1, &result));
62 EXPECT_EQ(0, result);
63 EXPECT_TRUE(SafeAddInt32(kMax - 1, 1, &result));
64 EXPECT_EQ(kMax, result);
65 EXPECT_FALSE(SafeAddInt32(1, kMax, &result));
66 EXPECT_EQ(0, result);
67 EXPECT_TRUE(SafeAddInt32(-1, kMin + 1, &result));
68 EXPECT_EQ(kMin, result);
69 EXPECT_FALSE(SafeAddInt32(-1, kMin, &result));
70 EXPECT_EQ(0, result);
71 EXPECT_TRUE(SafeAddInt32(1, kMax - 1, &result));
72 EXPECT_EQ(kMax, result);
75 TEST_F(GLES2UtilTest, GLGetNumValuesReturned) {
76 EXPECT_EQ(0, util_.GLGetNumValuesReturned(GL_COMPRESSED_TEXTURE_FORMATS));
77 EXPECT_EQ(0, util_.GLGetNumValuesReturned(GL_SHADER_BINARY_FORMATS));
79 EXPECT_EQ(0, util_.num_compressed_texture_formats());
80 EXPECT_EQ(0, util_.num_shader_binary_formats());
82 util_.set_num_compressed_texture_formats(1);
83 util_.set_num_shader_binary_formats(2);
85 EXPECT_EQ(1, util_.GLGetNumValuesReturned(GL_COMPRESSED_TEXTURE_FORMATS));
86 EXPECT_EQ(2, util_.GLGetNumValuesReturned(GL_SHADER_BINARY_FORMATS));
88 EXPECT_EQ(1, util_.num_compressed_texture_formats());
89 EXPECT_EQ(2, util_.num_shader_binary_formats());
92 TEST_F(GLES2UtilTest, ComputeImageDataSizesFormats) {
93 const uint32_t kWidth = 16;
94 const uint32_t kHeight = 12;
95 uint32_t size;
96 uint32_t unpadded_row_size;
97 uint32_t padded_row_size;
98 EXPECT_TRUE(GLES2Util::ComputeImageDataSizes(
99 kWidth, kHeight, 1, GL_RGB, GL_UNSIGNED_BYTE, 1,
100 &size, &unpadded_row_size, &padded_row_size));
101 EXPECT_EQ(kWidth * kHeight * 3, size);
102 EXPECT_EQ(kWidth * 3, padded_row_size);
103 EXPECT_EQ(padded_row_size, unpadded_row_size);
104 EXPECT_TRUE(GLES2Util::ComputeImageDataSizes(
105 kWidth, kHeight, 1, GL_RGBA, GL_UNSIGNED_BYTE, 1, &size,
106 &unpadded_row_size, &padded_row_size));
107 EXPECT_EQ(kWidth * kHeight * 4, size);
108 EXPECT_EQ(kWidth * 4, padded_row_size);
109 EXPECT_EQ(padded_row_size, unpadded_row_size);
110 EXPECT_TRUE(GLES2Util::ComputeImageDataSizes(
111 kWidth, kHeight, 1, GL_LUMINANCE, GL_UNSIGNED_BYTE, 1, &size,
112 &unpadded_row_size, &padded_row_size));
113 EXPECT_EQ(kWidth * kHeight * 1, size);
114 EXPECT_EQ(kWidth * 1, padded_row_size);
115 EXPECT_EQ(padded_row_size, unpadded_row_size);
116 EXPECT_TRUE(GLES2Util::ComputeImageDataSizes(
117 kWidth, kHeight, 1, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, 1, &size,
118 &unpadded_row_size, &padded_row_size));
119 EXPECT_EQ(kWidth * kHeight * 2, size);
120 EXPECT_EQ(kWidth * 2, padded_row_size);
121 EXPECT_EQ(padded_row_size, unpadded_row_size);
122 EXPECT_TRUE(GLES2Util::ComputeImageDataSizes(
123 kWidth, kHeight, 1, GL_BGRA_EXT, GL_UNSIGNED_BYTE, 1, &size,
124 &unpadded_row_size, &padded_row_size));
125 EXPECT_EQ(kWidth * kHeight * 4, size);
126 EXPECT_EQ(kWidth * 4, padded_row_size);
127 EXPECT_EQ(padded_row_size, unpadded_row_size);
128 EXPECT_TRUE(GLES2Util::ComputeImageDataSizes(
129 kWidth, kHeight, 1, GL_ALPHA, GL_UNSIGNED_BYTE, 1, &size,
130 &unpadded_row_size, &padded_row_size));
131 EXPECT_EQ(kWidth * kHeight * 1, size);
132 EXPECT_EQ(kWidth * 1, padded_row_size);
133 EXPECT_EQ(padded_row_size, unpadded_row_size);
134 EXPECT_TRUE(GLES2Util::ComputeImageDataSizes(
135 kWidth, kHeight, 1, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, 1, &size,
136 &unpadded_row_size, &padded_row_size));
137 EXPECT_EQ(kWidth * kHeight * 2, size);
138 EXPECT_EQ(kWidth * 2, padded_row_size);
139 EXPECT_EQ(padded_row_size, unpadded_row_size);
140 EXPECT_TRUE(GLES2Util::ComputeImageDataSizes(
141 kWidth, kHeight, 1, GL_DEPTH_STENCIL_OES, GL_UNSIGNED_INT_24_8_OES, 1,
142 &size, &unpadded_row_size, &padded_row_size));
143 EXPECT_EQ(kWidth * kHeight * 4, size);
144 EXPECT_EQ(kWidth * 4, padded_row_size);
145 EXPECT_EQ(padded_row_size, unpadded_row_size);
146 EXPECT_TRUE(GLES2Util::ComputeImageDataSizes(
147 kWidth, kHeight, 1, GL_RGB_INTEGER, GL_UNSIGNED_BYTE, 1,
148 &size, &unpadded_row_size, &padded_row_size));
149 EXPECT_EQ(kWidth * kHeight * 3, size);
150 EXPECT_EQ(kWidth * 3, padded_row_size);
151 EXPECT_EQ(padded_row_size, unpadded_row_size);
152 EXPECT_TRUE(GLES2Util::ComputeImageDataSizes(
153 kWidth, kHeight, 1, GL_RG, GL_UNSIGNED_BYTE, 1,
154 &size, &unpadded_row_size, &padded_row_size));
155 EXPECT_EQ(kWidth * kHeight * 2, size);
156 EXPECT_EQ(kWidth * 2, padded_row_size);
157 EXPECT_EQ(padded_row_size, unpadded_row_size);
158 EXPECT_TRUE(GLES2Util::ComputeImageDataSizes(
159 kWidth, kHeight, 1, GL_RG_INTEGER, GL_UNSIGNED_BYTE, 1,
160 &size, &unpadded_row_size, &padded_row_size));
161 EXPECT_EQ(kWidth * kHeight * 2, size);
162 EXPECT_EQ(kWidth * 2, padded_row_size);
163 EXPECT_EQ(padded_row_size, unpadded_row_size);
164 EXPECT_TRUE(GLES2Util::ComputeImageDataSizes(
165 kWidth, kHeight, 1, GL_RED, GL_UNSIGNED_BYTE, 1,
166 &size, &unpadded_row_size, &padded_row_size));
167 EXPECT_EQ(kWidth * kHeight * 1, size);
168 EXPECT_EQ(kWidth * 1, padded_row_size);
169 EXPECT_EQ(padded_row_size, unpadded_row_size);
170 EXPECT_TRUE(GLES2Util::ComputeImageDataSizes(
171 kWidth, kHeight, 1, GL_RED_INTEGER, GL_UNSIGNED_BYTE, 1,
172 &size, &unpadded_row_size, &padded_row_size));
173 EXPECT_EQ(kWidth * kHeight * 1, size);
174 EXPECT_EQ(kWidth * 1, padded_row_size);
175 EXPECT_EQ(padded_row_size, unpadded_row_size);
178 TEST_F(GLES2UtilTest, ComputeImageDataSizeTypes) {
179 const uint32_t kWidth = 16;
180 const uint32_t kHeight = 12;
181 uint32_t size;
182 uint32_t unpadded_row_size;
183 uint32_t padded_row_size;
184 EXPECT_TRUE(GLES2Util::ComputeImageDataSizes(
185 kWidth, kHeight, 1, GL_RGBA, GL_UNSIGNED_BYTE, 1, &size,
186 &unpadded_row_size, &padded_row_size));
187 EXPECT_EQ(kWidth * kHeight * 4, size);
188 EXPECT_EQ(kWidth * 4, padded_row_size);
189 EXPECT_EQ(padded_row_size, unpadded_row_size);
190 EXPECT_TRUE(GLES2Util::ComputeImageDataSizes(
191 kWidth, kHeight, 1, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4, 1, &size,
192 &unpadded_row_size, &padded_row_size));
193 EXPECT_EQ(kWidth * kHeight * 2, size);
194 EXPECT_EQ(kWidth * 2, padded_row_size);
195 EXPECT_EQ(padded_row_size, unpadded_row_size);
196 EXPECT_TRUE(GLES2Util::ComputeImageDataSizes(
197 kWidth, kHeight, 1, GL_RGBA, GL_UNSIGNED_SHORT_5_5_5_1, 1, &size,
198 &unpadded_row_size, &padded_row_size));
199 EXPECT_EQ(kWidth * kHeight * 2, size);
200 EXPECT_EQ(kWidth * 2, padded_row_size);
201 EXPECT_EQ(padded_row_size, unpadded_row_size);
202 EXPECT_TRUE(GLES2Util::ComputeImageDataSizes(
203 kWidth, kHeight, 1, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, 1, &size,
204 &unpadded_row_size, &padded_row_size));
205 EXPECT_EQ(kWidth * kHeight * 2, size);
206 EXPECT_EQ(kWidth * 2, padded_row_size);
207 EXPECT_EQ(padded_row_size, unpadded_row_size);
208 EXPECT_TRUE(GLES2Util::ComputeImageDataSizes(
209 kWidth, kHeight, 1, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, 1, &size,
210 &unpadded_row_size, &padded_row_size));
211 EXPECT_EQ(kWidth * kHeight * 4, size);
212 EXPECT_EQ(kWidth * 4, padded_row_size);
213 EXPECT_EQ(padded_row_size, unpadded_row_size);
214 EXPECT_TRUE(GLES2Util::ComputeImageDataSizes(
215 kWidth, kHeight, 1, GL_RGBA, GL_UNSIGNED_INT_2_10_10_10_REV, 1, &size,
216 &unpadded_row_size, &padded_row_size));
217 EXPECT_EQ(kWidth * kHeight * 4, size);
218 EXPECT_EQ(kWidth * 4, padded_row_size);
219 EXPECT_EQ(padded_row_size, unpadded_row_size);
220 EXPECT_TRUE(GLES2Util::ComputeImageDataSizes(
221 kWidth, kHeight, 1, GL_RGB, GL_UNSIGNED_INT_10F_11F_11F_REV, 1, &size,
222 &unpadded_row_size, &padded_row_size));
223 EXPECT_EQ(kWidth * kHeight * 4, size);
224 EXPECT_EQ(kWidth * 4, padded_row_size);
225 EXPECT_EQ(padded_row_size, unpadded_row_size);
226 EXPECT_TRUE(GLES2Util::ComputeImageDataSizes(
227 kWidth, kHeight, 1, GL_RGBA, GL_UNSIGNED_INT_5_9_9_9_REV, 1, &size,
228 &unpadded_row_size, &padded_row_size));
229 EXPECT_EQ(kWidth * kHeight * 4, size);
230 EXPECT_EQ(kWidth * 4, padded_row_size);
231 EXPECT_EQ(padded_row_size, unpadded_row_size);
232 EXPECT_TRUE(GLES2Util::ComputeImageDataSizes(
233 kWidth, kHeight, 1, GL_DEPTH_STENCIL, GL_FLOAT_32_UNSIGNED_INT_24_8_REV,
234 1, &size, &unpadded_row_size, &padded_row_size));
235 EXPECT_EQ(kWidth * kHeight * 4, size);
236 EXPECT_EQ(kWidth * 4, padded_row_size);
237 EXPECT_EQ(padded_row_size, unpadded_row_size);
240 TEST_F(GLES2UtilTest, ComputeImageDataSizesUnpackAlignment) {
241 const uint32_t kWidth = 19;
242 const uint32_t kHeight = 12;
243 uint32_t size;
244 uint32_t unpadded_row_size;
245 uint32_t padded_row_size;
246 EXPECT_TRUE(GLES2Util::ComputeImageDataSizes(
247 kWidth, kHeight, 1, GL_RGB, GL_UNSIGNED_BYTE, 1, &size,
248 &unpadded_row_size, &padded_row_size));
249 EXPECT_EQ(kWidth * kHeight * 3, size);
250 EXPECT_EQ(kWidth * 3, unpadded_row_size);
251 EXPECT_EQ(kWidth * 3, padded_row_size);
252 EXPECT_TRUE(GLES2Util::ComputeImageDataSizes(
253 kWidth, kHeight, 1, GL_RGB, GL_UNSIGNED_BYTE, 2, &size,
254 &unpadded_row_size, &padded_row_size));
255 EXPECT_EQ((kWidth * 3 + 1) * (kHeight - 1) +
256 kWidth * 3, size);
257 EXPECT_EQ(kWidth * 3, unpadded_row_size);
258 EXPECT_EQ(kWidth * 3 + 1, padded_row_size);
259 EXPECT_TRUE(GLES2Util::ComputeImageDataSizes(
260 kWidth, kHeight, 1, GL_RGB, GL_UNSIGNED_BYTE, 4, &size,
261 &unpadded_row_size, &padded_row_size));
262 EXPECT_EQ((kWidth * 3 + 3) * (kHeight - 1) +
263 kWidth * 3, size);
264 EXPECT_EQ(kWidth * 3, unpadded_row_size);
265 EXPECT_EQ(kWidth * 3 + 3, padded_row_size);
266 EXPECT_TRUE(GLES2Util::ComputeImageDataSizes(
267 kWidth, kHeight, 1, GL_RGB, GL_UNSIGNED_BYTE, 8, &size,
268 &unpadded_row_size, &padded_row_size));
269 EXPECT_EQ((kWidth * 3 + 7) * (kHeight - 1) +
270 kWidth * 3, size);
271 EXPECT_EQ(kWidth * 3, unpadded_row_size);
272 EXPECT_EQ(kWidth * 3 + 7, padded_row_size);
275 TEST_F(GLES2UtilTest, ComputeImageDataSizeDepth) {
276 const uint32_t kWidth = 19;
277 const uint32_t kHeight = 12;
278 const uint32_t kDepth = 3;
279 uint32_t size;
280 uint32_t unpadded_row_size;
281 uint32_t padded_row_size;
282 EXPECT_TRUE(GLES2Util::ComputeImageDataSizes(
283 kWidth, kHeight, kDepth, GL_RGB, GL_UNSIGNED_BYTE, 1, &size,
284 &unpadded_row_size, &padded_row_size));
285 EXPECT_EQ(kWidth * kHeight * kDepth * 3, size);
286 EXPECT_EQ(kWidth * 3, padded_row_size);
287 EXPECT_EQ(padded_row_size, unpadded_row_size);
288 EXPECT_TRUE(GLES2Util::ComputeImageDataSizes(
289 kWidth, kHeight, kDepth, GL_RGB, GL_UNSIGNED_BYTE, 2, &size,
290 &unpadded_row_size, &padded_row_size));
291 EXPECT_EQ((kWidth * 3 + 1) * (kHeight * kDepth - 1) +
292 kWidth * 3, size);
293 EXPECT_EQ(kWidth * 3, unpadded_row_size);
294 EXPECT_EQ(kWidth * 3 + 1, padded_row_size);
295 EXPECT_TRUE(GLES2Util::ComputeImageDataSizes(
296 kWidth, kHeight, kDepth, GL_RGB, GL_UNSIGNED_BYTE, 4, &size,
297 &unpadded_row_size, &padded_row_size));
298 EXPECT_EQ((kWidth * 3 + 3) * (kHeight * kDepth - 1) +
299 kWidth * 3, size);
300 EXPECT_EQ(kWidth * 3, unpadded_row_size);
301 EXPECT_EQ(kWidth * 3 + 3, padded_row_size);
302 EXPECT_TRUE(GLES2Util::ComputeImageDataSizes(
303 kWidth, kHeight, kDepth, GL_RGB, GL_UNSIGNED_BYTE, 8, &size,
304 &unpadded_row_size, &padded_row_size));
305 EXPECT_EQ((kWidth * 3 + 7) * (kHeight * kDepth - 1) +
306 kWidth * 3, size);
307 EXPECT_EQ(kWidth * 3, unpadded_row_size);
308 EXPECT_EQ(kWidth * 3 + 7, padded_row_size);
311 TEST_F(GLES2UtilTest, RenderbufferBytesPerPixel) {
312 EXPECT_EQ(1u, GLES2Util::RenderbufferBytesPerPixel(GL_STENCIL_INDEX8));
313 EXPECT_EQ(2u, GLES2Util::RenderbufferBytesPerPixel(GL_RGBA4));
314 EXPECT_EQ(2u, GLES2Util::RenderbufferBytesPerPixel(GL_RGB565));
315 EXPECT_EQ(2u, GLES2Util::RenderbufferBytesPerPixel(GL_RGB5_A1));
316 EXPECT_EQ(2u, GLES2Util::RenderbufferBytesPerPixel(GL_DEPTH_COMPONENT16));
317 EXPECT_EQ(4u, GLES2Util::RenderbufferBytesPerPixel(GL_RGB));
318 EXPECT_EQ(4u, GLES2Util::RenderbufferBytesPerPixel(GL_RGBA));
319 EXPECT_EQ(
320 4u, GLES2Util::RenderbufferBytesPerPixel(GL_DEPTH24_STENCIL8_OES));
321 EXPECT_EQ(4u, GLES2Util::RenderbufferBytesPerPixel(GL_RGB8_OES));
322 EXPECT_EQ(4u, GLES2Util::RenderbufferBytesPerPixel(GL_RGBA8_OES));
323 EXPECT_EQ(
324 4u, GLES2Util::RenderbufferBytesPerPixel(GL_DEPTH_COMPONENT24_OES));
325 EXPECT_EQ(0u, GLES2Util::RenderbufferBytesPerPixel(-1));
328 TEST_F(GLES2UtilTest, GetChannelsForCompressedFormat) {
329 EXPECT_EQ(0u, GLES2Util::GetChannelsForFormat(GL_ETC1_RGB8_OES));
330 EXPECT_EQ(0u, GLES2Util::GetChannelsForFormat(
331 GL_COMPRESSED_RGB_S3TC_DXT1_EXT));
332 EXPECT_EQ(0u, GLES2Util::GetChannelsForFormat(
333 GL_COMPRESSED_RGBA_S3TC_DXT1_EXT));
334 EXPECT_EQ(0u, GLES2Util::GetChannelsForFormat(
335 GL_COMPRESSED_RGBA_S3TC_DXT3_EXT));
336 EXPECT_EQ(0u, GLES2Util::GetChannelsForFormat(
337 GL_COMPRESSED_RGBA_S3TC_DXT5_EXT));
338 EXPECT_EQ(0u, GLES2Util::GetChannelsForFormat(GL_ATC_RGB_AMD));
339 EXPECT_EQ(0u, GLES2Util::GetChannelsForFormat(
340 GL_ATC_RGBA_EXPLICIT_ALPHA_AMD));
341 EXPECT_EQ(0u, GLES2Util::GetChannelsForFormat(
342 GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD));
343 EXPECT_EQ(0u, GLES2Util::GetChannelsForFormat(
344 GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG));
345 EXPECT_EQ(0u, GLES2Util::GetChannelsForFormat(
346 GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG));
347 EXPECT_EQ(0u, GLES2Util::GetChannelsForFormat(
348 GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG));
349 EXPECT_EQ(0u, GLES2Util::GetChannelsForFormat(
350 GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG));
353 namespace {
355 void CheckParseUniformName(
356 const char* name,
357 bool expected_success,
358 size_t expected_array_pos,
359 int expected_index,
360 bool expected_getting_array) {
361 int index = 1234;
362 size_t array_pos = 1244;
363 bool getting_array = false;
364 bool success = GLES2Util::ParseUniformName(
365 name, &array_pos, &index, &getting_array);
366 EXPECT_EQ(expected_success, success);
367 if (success) {
368 EXPECT_EQ(expected_array_pos, array_pos);
369 EXPECT_EQ(expected_index, index);
370 EXPECT_EQ(expected_getting_array, getting_array);
374 } // anonymous namespace
376 TEST_F(GLES2UtilTest, ParseUniformName) {
377 CheckParseUniformName("u_name", true, std::string::npos, 0, false);
378 CheckParseUniformName("u_name[]", false, std::string::npos, 0, false);
379 CheckParseUniformName("u_name]", false, std::string::npos, 0, false);
380 CheckParseUniformName("u_name[0a]", false, std::string::npos, 0, false);
381 CheckParseUniformName("u_name[a0]", false, std::string::npos, 0, false);
382 CheckParseUniformName("u_name[0a0]", false, std::string::npos, 0, false);
383 CheckParseUniformName("u_name[0]", true, 6u, 0, true);
384 CheckParseUniformName("u_name[2]", true, 6u, 2, true);
385 CheckParseUniformName("u_name[02]", true, 6u, 2, true);
386 CheckParseUniformName("u_name[20]", true, 6u, 20, true);
387 CheckParseUniformName("u_name[020]", true, 6u, 20, true);
388 CheckParseUniformName("u_name[0][0]", true, 9u, 0, true);
389 CheckParseUniformName("u_name[3][2]", true, 9u, 2, true);
390 CheckParseUniformName("u_name[03][02]", true, 10u, 2, true);
391 CheckParseUniformName("u_name[30][20]", true, 10u, 20, true);
392 CheckParseUniformName("u_name[030][020]", true, 11u, 20, true);
393 CheckParseUniformName("", false, std::string::npos, 0, false);
396 } // namespace gles2
397 } // namespace gpu