Chromium Code Reviews

Side by Side Diff: gpu/command_buffer/service/gles2_cmd_decoder_unittest_1_autogen.h

Issue 660229: "/b/slave/chromium-rel-linux/build/src/gpu/command_buffer/client/gles2_demo_c... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file is auto-generated. DO NOT EDIT! 5 // This file is auto-generated. DO NOT EDIT!
6 6
7 // It is included by gles2_cmd_decoder_unittest_1.cc 7 // It is included by gles2_cmd_decoder_unittest_1.cc
8 #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_1_AUTOGEN_H_ 8 #ifndef GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_1_AUTOGEN_H_
9 #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_1_AUTOGEN_H_ 9 #define GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_1_AUTOGEN_H_
10 10
11 11
12 TEST_F(GLES2DecoderTest1, ActiveTextureValidArgs) { 12 TEST_F(GLES2DecoderTest1, ActiveTextureValidArgs) {
13 EXPECT_CALL(*gl_, ActiveTexture(1));
13 SpecializedSetup<ActiveTexture, 0>(); 14 SpecializedSetup<ActiveTexture, 0>();
14 ActiveTexture cmd; 15 ActiveTexture cmd;
15 cmd.Init(1); 16 cmd.Init(1);
16 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd)); 17 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
17 } 18 }
18 19
19 TEST_F(GLES2DecoderTest1, AttachShaderValidArgs) { 20 TEST_F(GLES2DecoderTest1, AttachShaderValidArgs) {
20 EXPECT_CALL(*gl_, AttachShader(kServiceProgramId, kServiceShaderId)); 21 EXPECT_CALL(*gl_, AttachShader(kServiceProgramId, kServiceShaderId));
21 SpecializedSetup<AttachShader, 0>(); 22 SpecializedSetup<AttachShader, 0>();
22 AttachShader cmd; 23 AttachShader cmd;
(...skipping 1082 matching lines...)
1105 1106
1106 TEST_F(GLES2DecoderTest1, GetProgramivInvalidArgs2_1) { 1107 TEST_F(GLES2DecoderTest1, GetProgramivInvalidArgs2_1) {
1107 EXPECT_CALL(*gl_, GetProgramiv(_, _, _)).Times(0); 1108 EXPECT_CALL(*gl_, GetProgramiv(_, _, _)).Times(0);
1108 SpecializedSetup<GetProgramiv, 0>(); 1109 SpecializedSetup<GetProgramiv, 0>();
1109 GetProgramiv cmd; 1110 GetProgramiv cmd;
1110 cmd.Init( 1111 cmd.Init(
1111 client_program_id_, GL_DELETE_STATUS, shared_memory_id_, 1112 client_program_id_, GL_DELETE_STATUS, shared_memory_id_,
1112 kInvalidSharedMemoryOffset); 1113 kInvalidSharedMemoryOffset);
1113 EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); 1114 EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd));
1114 } 1115 }
1116 // TODO(gman): GetProgramInfoLog
1115 1117
1116 TEST_F(GLES2DecoderTest1, GetProgramInfoLogValidArgs) {
1117 const char* kInfo = "hello";
1118 const uint32 kBucketId = 123;
1119 SpecializedSetup<GetProgramInfoLog, 0>();
1120 EXPECT_CALL(
1121 *gl_, GetProgramiv(
1122 kServiceProgramId, GL_INFO_LOG_LENGTH, _)) .WillOnce(
1123 SetArgumentPointee<2>(strlen(kInfo)));
1124 EXPECT_CALL(
1125 *gl_, GetProgramInfoLog(kServiceProgramId, strlen(kInfo) + 1, _, _))
1126 .WillOnce(DoAll(SetArgumentPointee<2>(strlen(kInfo)),
1127 SetArrayArgument<3>(kInfo, kInfo + strlen(kInfo) + 1)));
1128 GetProgramInfoLog cmd;
1129 cmd.Init(client_program_id_, kBucketId);
1130 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
1131 CommonDecoder::Bucket* bucket = decoder_->GetBucket(kBucketId);
1132 ASSERT_TRUE(bucket != NULL);
1133 EXPECT_EQ(strlen(kInfo) + 1, bucket->size());
1134 EXPECT_EQ(0, memcmp(bucket->GetData(0, bucket->size()), kInfo,
1135 bucket->size()));
1136 }
1137
1138 TEST_F(GLES2DecoderTest1, GetProgramInfoLogInvalidArgs) {
1139 const uint32 kBucketId = 123;
1140 EXPECT_CALL(*gl_, GetProgramInfoLog(_, _, _, _))
1141 .Times(0);
1142 GetProgramInfoLog cmd;
1143 cmd.Init(kInvalidClientId, kBucketId);
1144 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
1145 EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
1146 }
1147 1118
1148 TEST_F(GLES2DecoderTest1, GetRenderbufferParameterivValidArgs) { 1119 TEST_F(GLES2DecoderTest1, GetRenderbufferParameterivValidArgs) {
1149 EXPECT_CALL( 1120 EXPECT_CALL(
1150 *gl_, GetRenderbufferParameterivEXT( 1121 *gl_, GetRenderbufferParameterivEXT(
1151 GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, reinterpret_cast<GLint*>( 1122 GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, reinterpret_cast<GLint*>(
1152 shared_memory_address_))); 1123 shared_memory_address_)));
1153 SpecializedSetup<GetRenderbufferParameteriv, 0>(); 1124 SpecializedSetup<GetRenderbufferParameteriv, 0>();
1154 GetRenderbufferParameteriv cmd; 1125 GetRenderbufferParameteriv cmd;
1155 cmd.Init( 1126 cmd.Init(
1156 GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, shared_memory_id_, 1127 GL_RENDERBUFFER, GL_RENDERBUFFER_WIDTH, shared_memory_id_,
(...skipping 42 matching lines...)
1199 1170
1200 TEST_F(GLES2DecoderTest1, GetShaderivInvalidArgs2_1) { 1171 TEST_F(GLES2DecoderTest1, GetShaderivInvalidArgs2_1) {
1201 EXPECT_CALL(*gl_, GetShaderiv(_, _, _)).Times(0); 1172 EXPECT_CALL(*gl_, GetShaderiv(_, _, _)).Times(0);
1202 SpecializedSetup<GetShaderiv, 0>(); 1173 SpecializedSetup<GetShaderiv, 0>();
1203 GetShaderiv cmd; 1174 GetShaderiv cmd;
1204 cmd.Init( 1175 cmd.Init(
1205 client_shader_id_, GL_SHADER_TYPE, shared_memory_id_, 1176 client_shader_id_, GL_SHADER_TYPE, shared_memory_id_,
1206 kInvalidSharedMemoryOffset); 1177 kInvalidSharedMemoryOffset);
1207 EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); 1178 EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd));
1208 } 1179 }
1180 // TODO(gman): GetShaderInfoLog
1209 1181
1210 TEST_F(GLES2DecoderTest1, GetShaderInfoLogValidArgs) {
1211 const char* kInfo = "hello";
1212 const uint32 kBucketId = 123;
1213 SpecializedSetup<GetShaderInfoLog, 0>();
1214 EXPECT_CALL(
1215 *gl_, GetShaderiv(
1216 kServiceShaderId, GL_INFO_LOG_LENGTH, _)) .WillOnce(
1217 SetArgumentPointee<2>(strlen(kInfo)));
1218 EXPECT_CALL(
1219 *gl_, GetShaderInfoLog(kServiceShaderId, strlen(kInfo) + 1, _, _))
1220 .WillOnce(DoAll(SetArgumentPointee<2>(strlen(kInfo)),
1221 SetArrayArgument<3>(kInfo, kInfo + strlen(kInfo) + 1)));
1222 GetShaderInfoLog cmd;
1223 cmd.Init(client_shader_id_, kBucketId);
1224 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
1225 CommonDecoder::Bucket* bucket = decoder_->GetBucket(kBucketId);
1226 ASSERT_TRUE(bucket != NULL);
1227 EXPECT_EQ(strlen(kInfo) + 1, bucket->size());
1228 EXPECT_EQ(0, memcmp(bucket->GetData(0, bucket->size()), kInfo,
1229 bucket->size()));
1230 }
1231
1232 TEST_F(GLES2DecoderTest1, GetShaderInfoLogInvalidArgs) {
1233 const uint32 kBucketId = 123;
1234 EXPECT_CALL(*gl_, GetShaderInfoLog(_, _, _, _))
1235 .Times(0);
1236 GetShaderInfoLog cmd;
1237 cmd.Init(kInvalidClientId, kBucketId);
1238 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
1239 EXPECT_EQ(GL_INVALID_VALUE, GetGLError());
1240 }
1241 // TODO(gman): GetShaderPrecisionFormat 1182 // TODO(gman): GetShaderPrecisionFormat
1242 1183
1243 // TODO(gman): GetShaderSource 1184 // TODO(gman): GetShaderSource
1244 // TODO(gman): GetString
1245 1185
1246 1186
1187 TEST_F(GLES2DecoderTest1, GetStringValidArgs) {
1188 EXPECT_CALL(*gl_, GetString(GL_VENDOR));
1189 SpecializedSetup<GetString, 0>();
1190 GetString cmd;
1191 cmd.Init(GL_VENDOR);
1192 EXPECT_EQ(error::kNoError, ExecuteCmd(cmd));
1193 }
1194
1247 TEST_F(GLES2DecoderTest1, GetTexParameterfvValidArgs) { 1195 TEST_F(GLES2DecoderTest1, GetTexParameterfvValidArgs) {
1248 EXPECT_CALL( 1196 EXPECT_CALL(
1249 *gl_, GetTexParameterfv( 1197 *gl_, GetTexParameterfv(
1250 GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, reinterpret_cast<GLfloat*>( 1198 GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, reinterpret_cast<GLfloat*>(
1251 shared_memory_address_))); 1199 shared_memory_address_)));
1252 SpecializedSetup<GetTexParameterfv, 0>(); 1200 SpecializedSetup<GetTexParameterfv, 0>();
1253 GetTexParameterfv cmd; 1201 GetTexParameterfv cmd;
1254 cmd.Init( 1202 cmd.Init(
1255 GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, shared_memory_id_, 1203 GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, shared_memory_id_,
1256 shared_memory_offset_); 1204 shared_memory_offset_);
(...skipping 87 matching lines...)
1344 EXPECT_CALL(*gl_, GetTexParameteriv(_, _, _)).Times(0); 1292 EXPECT_CALL(*gl_, GetTexParameteriv(_, _, _)).Times(0);
1345 SpecializedSetup<GetTexParameteriv, 0>(); 1293 SpecializedSetup<GetTexParameteriv, 0>();
1346 GetTexParameteriv cmd; 1294 GetTexParameteriv cmd;
1347 cmd.Init( 1295 cmd.Init(
1348 GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, shared_memory_id_, 1296 GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, shared_memory_id_,
1349 kInvalidSharedMemoryOffset); 1297 kInvalidSharedMemoryOffset);
1350 EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd)); 1298 EXPECT_EQ(error::kOutOfBounds, ExecuteCmd(cmd));
1351 } 1299 }
1352 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_1_AUTOGEN_H_ 1300 #endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_1_AUTOGEN_H_
1353 1301
OLDNEW

Powered by Google App Engine