1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
gpu / command_buffer / service / gles2_cmd_decoder_unittest_3_autogen.h [blame]
// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// This file is auto-generated from
// gpu/command_buffer/build_gles2_cmd_buffer.py
// It's formatted by clang-format using chromium coding style:
// clang-format -i -style=chromium filename
// DO NOT EDIT!
// It is included by gles2_cmd_decoder_unittest_3.cc
#ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_3_AUTOGEN_H_
#define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_3_AUTOGEN_H_
TEST_P(GLES2DecoderTest3, Uniform4fValidArgs) {
EXPECT_CALL(*gl_, Uniform4fv(1, 1, _));
SpecializedSetup<cmds::Uniform4f, 0>(true);
cmds::Uniform4f cmd;
cmd.Init(1, 2, 3, 4, 5);
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
EXPECT_EQ(GL_NO_ERROR, GetGLError());
}
TEST_P(GLES2DecoderTest3, Uniform4fvImmediateValidArgs) {
cmds::Uniform4fvImmediate& cmd = *GetImmediateAs<cmds::Uniform4fvImmediate>();
SpecializedSetup<cmds::Uniform4fvImmediate, 0>(true);
GLfloat temp[4 * 2] = {};
EXPECT_CALL(*gl_, Uniform4fv(1, 2, PointsToArray(temp, 4)));
cmd.Init(1, 2, &temp[0]);
EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
EXPECT_EQ(GL_NO_ERROR, GetGLError());
}
TEST_P(GLES2DecoderTest3, Uniform4iValidArgs) {
EXPECT_CALL(*gl_, Uniform4iv(1, 1, _));
SpecializedSetup<cmds::Uniform4i, 0>(true);
cmds::Uniform4i cmd;
cmd.Init(1, 2, 3, 4, 5);
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
EXPECT_EQ(GL_NO_ERROR, GetGLError());
}
TEST_P(GLES2DecoderTest3, Uniform4ivImmediateValidArgs) {
cmds::Uniform4ivImmediate& cmd = *GetImmediateAs<cmds::Uniform4ivImmediate>();
SpecializedSetup<cmds::Uniform4ivImmediate, 0>(true);
GLint temp[4 * 2] = {};
EXPECT_CALL(*gl_, Uniform4iv(1, 2, PointsToArray(temp, 4)));
cmd.Init(1, 2, &temp[0]);
EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
EXPECT_EQ(GL_NO_ERROR, GetGLError());
}
TEST_P(GLES3DecoderTest3, UniformMatrix2x3fvImmediateValidArgs) {
cmds::UniformMatrix2x3fvImmediate& cmd =
*GetImmediateAs<cmds::UniformMatrix2x3fvImmediate>();
SpecializedSetup<cmds::UniformMatrix2x3fvImmediate, 0>(true);
GLfloat temp[6 * 2] = {};
EXPECT_CALL(*gl_, UniformMatrix2x3fv(1, 2, true, PointsToArray(temp, 6)));
cmd.Init(1, 2, true, &temp[0]);
EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
EXPECT_EQ(GL_NO_ERROR, GetGLError());
}
TEST_P(GLES3DecoderTest3, UniformMatrix2x4fvImmediateValidArgs) {
cmds::UniformMatrix2x4fvImmediate& cmd =
*GetImmediateAs<cmds::UniformMatrix2x4fvImmediate>();
SpecializedSetup<cmds::UniformMatrix2x4fvImmediate, 0>(true);
GLfloat temp[8 * 2] = {};
EXPECT_CALL(*gl_, UniformMatrix2x4fv(1, 2, true, PointsToArray(temp, 8)));
cmd.Init(1, 2, true, &temp[0]);
EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
EXPECT_EQ(GL_NO_ERROR, GetGLError());
}
TEST_P(GLES3DecoderTest3, UniformMatrix3x2fvImmediateValidArgs) {
cmds::UniformMatrix3x2fvImmediate& cmd =
*GetImmediateAs<cmds::UniformMatrix3x2fvImmediate>();
SpecializedSetup<cmds::UniformMatrix3x2fvImmediate, 0>(true);
GLfloat temp[6 * 2] = {};
EXPECT_CALL(*gl_, UniformMatrix3x2fv(1, 2, true, PointsToArray(temp, 6)));
cmd.Init(1, 2, true, &temp[0]);
EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
EXPECT_EQ(GL_NO_ERROR, GetGLError());
}
TEST_P(GLES3DecoderTest3, UniformMatrix3x4fvImmediateValidArgs) {
cmds::UniformMatrix3x4fvImmediate& cmd =
*GetImmediateAs<cmds::UniformMatrix3x4fvImmediate>();
SpecializedSetup<cmds::UniformMatrix3x4fvImmediate, 0>(true);
GLfloat temp[12 * 2] = {};
EXPECT_CALL(*gl_, UniformMatrix3x4fv(1, 2, true, PointsToArray(temp, 12)));
cmd.Init(1, 2, true, &temp[0]);
EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
EXPECT_EQ(GL_NO_ERROR, GetGLError());
}
TEST_P(GLES3DecoderTest3, UniformMatrix4x2fvImmediateValidArgs) {
cmds::UniformMatrix4x2fvImmediate& cmd =
*GetImmediateAs<cmds::UniformMatrix4x2fvImmediate>();
SpecializedSetup<cmds::UniformMatrix4x2fvImmediate, 0>(true);
GLfloat temp[8 * 2] = {};
EXPECT_CALL(*gl_, UniformMatrix4x2fv(1, 2, true, PointsToArray(temp, 8)));
cmd.Init(1, 2, true, &temp[0]);
EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
EXPECT_EQ(GL_NO_ERROR, GetGLError());
}
TEST_P(GLES3DecoderTest3, UniformMatrix4x3fvImmediateValidArgs) {
cmds::UniformMatrix4x3fvImmediate& cmd =
*GetImmediateAs<cmds::UniformMatrix4x3fvImmediate>();
SpecializedSetup<cmds::UniformMatrix4x3fvImmediate, 0>(true);
GLfloat temp[12 * 2] = {};
EXPECT_CALL(*gl_, UniformMatrix4x3fv(1, 2, true, PointsToArray(temp, 12)));
cmd.Init(1, 2, true, &temp[0]);
EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
EXPECT_EQ(GL_NO_ERROR, GetGLError());
}
TEST_P(GLES2DecoderTest3, UseProgramValidArgs) {
EXPECT_CALL(*gl_, UseProgram(kServiceProgramId));
SpecializedSetup<cmds::UseProgram, 0>(true);
cmds::UseProgram cmd;
cmd.Init(client_program_id_);
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
EXPECT_EQ(GL_NO_ERROR, GetGLError());
}
TEST_P(GLES2DecoderTest3, UseProgramInvalidArgs0_0) {
EXPECT_CALL(*gl_, UseProgram(_)).Times(0);
SpecializedSetup<cmds::UseProgram, 0>(false);
cmds::UseProgram cmd;
cmd.Init(kInvalidClientId);
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
}
TEST_P(GLES2DecoderTest3, ValidateProgramValidArgs) {
EXPECT_CALL(*gl_, ValidateProgram(kServiceProgramId));
SpecializedSetup<cmds::ValidateProgram, 0>(true);
cmds::ValidateProgram cmd;
cmd.Init(client_program_id_);
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
EXPECT_EQ(GL_NO_ERROR, GetGLError());
}
TEST_P(GLES2DecoderTest3, VertexAttrib1fValidArgs) {
EXPECT_CALL(*gl_, VertexAttrib1f(1, 2));
SpecializedSetup<cmds::VertexAttrib1f, 0>(true);
cmds::VertexAttrib1f cmd;
cmd.Init(1, 2);
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
EXPECT_EQ(GL_NO_ERROR, GetGLError());
}
TEST_P(GLES2DecoderTest3, VertexAttrib1fvImmediateValidArgs) {
cmds::VertexAttrib1fvImmediate& cmd =
*GetImmediateAs<cmds::VertexAttrib1fvImmediate>();
SpecializedSetup<cmds::VertexAttrib1fvImmediate, 0>(true);
GLfloat temp[1] = {
0,
};
cmd.Init(1, &temp[0]);
EXPECT_CALL(*gl_, VertexAttrib1fv(1, PointsToArray(temp, 1)));
EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
EXPECT_EQ(GL_NO_ERROR, GetGLError());
}
TEST_P(GLES2DecoderTest3, VertexAttrib2fValidArgs) {
EXPECT_CALL(*gl_, VertexAttrib2f(1, 2, 3));
SpecializedSetup<cmds::VertexAttrib2f, 0>(true);
cmds::VertexAttrib2f cmd;
cmd.Init(1, 2, 3);
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
EXPECT_EQ(GL_NO_ERROR, GetGLError());
}
TEST_P(GLES2DecoderTest3, VertexAttrib2fvImmediateValidArgs) {
cmds::VertexAttrib2fvImmediate& cmd =
*GetImmediateAs<cmds::VertexAttrib2fvImmediate>();
SpecializedSetup<cmds::VertexAttrib2fvImmediate, 0>(true);
GLfloat temp[2] = {
0,
};
cmd.Init(1, &temp[0]);
EXPECT_CALL(*gl_, VertexAttrib2fv(1, PointsToArray(temp, 2)));
EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
EXPECT_EQ(GL_NO_ERROR, GetGLError());
}
TEST_P(GLES2DecoderTest3, VertexAttrib3fValidArgs) {
EXPECT_CALL(*gl_, VertexAttrib3f(1, 2, 3, 4));
SpecializedSetup<cmds::VertexAttrib3f, 0>(true);
cmds::VertexAttrib3f cmd;
cmd.Init(1, 2, 3, 4);
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
EXPECT_EQ(GL_NO_ERROR, GetGLError());
}
TEST_P(GLES2DecoderTest3, VertexAttrib3fvImmediateValidArgs) {
cmds::VertexAttrib3fvImmediate& cmd =
*GetImmediateAs<cmds::VertexAttrib3fvImmediate>();
SpecializedSetup<cmds::VertexAttrib3fvImmediate, 0>(true);
GLfloat temp[3] = {
0,
};
cmd.Init(1, &temp[0]);
EXPECT_CALL(*gl_, VertexAttrib3fv(1, PointsToArray(temp, 3)));
EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
EXPECT_EQ(GL_NO_ERROR, GetGLError());
}
TEST_P(GLES2DecoderTest3, VertexAttrib4fValidArgs) {
EXPECT_CALL(*gl_, VertexAttrib4f(1, 2, 3, 4, 5));
SpecializedSetup<cmds::VertexAttrib4f, 0>(true);
cmds::VertexAttrib4f cmd;
cmd.Init(1, 2, 3, 4, 5);
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
EXPECT_EQ(GL_NO_ERROR, GetGLError());
}
TEST_P(GLES2DecoderTest3, VertexAttrib4fvImmediateValidArgs) {
cmds::VertexAttrib4fvImmediate& cmd =
*GetImmediateAs<cmds::VertexAttrib4fvImmediate>();
SpecializedSetup<cmds::VertexAttrib4fvImmediate, 0>(true);
GLfloat temp[4] = {
0,
};
cmd.Init(1, &temp[0]);
EXPECT_CALL(*gl_, VertexAttrib4fv(1, PointsToArray(temp, 4)));
EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
EXPECT_EQ(GL_NO_ERROR, GetGLError());
}
TEST_P(GLES3DecoderTest3, VertexAttribI4iValidArgs) {
EXPECT_CALL(*gl_, VertexAttribI4i(1, 2, 3, 4, 5));
SpecializedSetup<cmds::VertexAttribI4i, 0>(true);
cmds::VertexAttribI4i cmd;
cmd.Init(1, 2, 3, 4, 5);
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
EXPECT_EQ(GL_NO_ERROR, GetGLError());
}
TEST_P(GLES3DecoderTest3, VertexAttribI4ivImmediateValidArgs) {
cmds::VertexAttribI4ivImmediate& cmd =
*GetImmediateAs<cmds::VertexAttribI4ivImmediate>();
SpecializedSetup<cmds::VertexAttribI4ivImmediate, 0>(true);
GLint temp[4] = {
0,
};
cmd.Init(1, &temp[0]);
EXPECT_CALL(*gl_, VertexAttribI4iv(1, PointsToArray(temp, 4)));
EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
EXPECT_EQ(GL_NO_ERROR, GetGLError());
}
TEST_P(GLES3DecoderTest3, VertexAttribI4uiValidArgs) {
EXPECT_CALL(*gl_, VertexAttribI4ui(1, 2, 3, 4, 5));
SpecializedSetup<cmds::VertexAttribI4ui, 0>(true);
cmds::VertexAttribI4ui cmd;
cmd.Init(1, 2, 3, 4, 5);
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
EXPECT_EQ(GL_NO_ERROR, GetGLError());
}
TEST_P(GLES3DecoderTest3, VertexAttribI4uivImmediateValidArgs) {
cmds::VertexAttribI4uivImmediate& cmd =
*GetImmediateAs<cmds::VertexAttribI4uivImmediate>();
SpecializedSetup<cmds::VertexAttribI4uivImmediate, 0>(true);
GLuint temp[4] = {
0,
};
cmd.Init(1, &temp[0]);
EXPECT_CALL(*gl_, VertexAttribI4uiv(1, PointsToArray(temp, 4)));
EXPECT_EQ(error::kNoError, ExecuteImmediateCmd(cmd, sizeof(temp)));
EXPECT_EQ(GL_NO_ERROR, GetGLError());
}
TEST_P(GLES2DecoderTest3, ViewportValidArgs) {
EXPECT_CALL(*gl_, Viewport(1, 2, 3, 4));
SpecializedSetup<cmds::Viewport, 0>(true);
cmds::Viewport cmd;
cmd.Init(1, 2, 3, 4);
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
EXPECT_EQ(GL_NO_ERROR, GetGLError());
}
TEST_P(GLES2DecoderTest3, ViewportInvalidArgs2_0) {
EXPECT_CALL(*gl_, Viewport(_, _, _, _)).Times(0);
SpecializedSetup<cmds::Viewport, 0>(false);
cmds::Viewport cmd;
cmd.Init(1, 2, -1, 4);
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
}
TEST_P(GLES2DecoderTest3, ViewportInvalidArgs3_0) {
EXPECT_CALL(*gl_, Viewport(_, _, _, _)).Times(0);
SpecializedSetup<cmds::Viewport, 0>(false);
cmds::Viewport cmd;
cmd.Init(1, 2, 3, -1);
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
}
TEST_P(GLES2DecoderTest3, PopGroupMarkerEXTValidArgs) {
SpecializedSetup<cmds::PopGroupMarkerEXT, 0>(true);
cmds::PopGroupMarkerEXT cmd;
cmd.Init();
EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
EXPECT_EQ(GL_NO_ERROR, GetGLError());
}
#endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_3_AUTOGEN_H_