| OLD | NEW |
| 1 // This file is auto-generated. DO NOT EDIT! | 1 // This file is auto-generated. DO NOT EDIT! |
| 2 | 2 |
| 3 // This file contains unit tests for gles2 commmands | 3 // This file contains unit tests for gles2 commmands |
| 4 // It is included by gles2_cmd_format_test.cc | 4 // It is included by gles2_cmd_format_test.cc |
| 5 | 5 |
| 6 TEST(GLES2FormatTest, ActiveTexture) { | 6 TEST(GLES2FormatTest, ActiveTexture) { |
| 7 ActiveTexture cmd = { 0, }; | 7 ActiveTexture cmd = { 0, }; |
| 8 void* next_cmd = cmd.Set( | 8 void* next_cmd = cmd.Set( |
| 9 &cmd, | 9 &cmd, |
| 10 static_cast<GLenum>(11)); | 10 static_cast<GLenum>(11)); |
| (...skipping 946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 957 EXPECT_EQ(GetAttachedShaders::kCmdId, cmd.header.command); | 957 EXPECT_EQ(GetAttachedShaders::kCmdId, cmd.header.command); |
| 958 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4); // NOLINT | 958 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4); // NOLINT |
| 959 EXPECT_EQ(static_cast<GLuint>(11), cmd.program); | 959 EXPECT_EQ(static_cast<GLuint>(11), cmd.program); |
| 960 EXPECT_EQ(static_cast<GLsizei>(12), cmd.maxcount); | 960 EXPECT_EQ(static_cast<GLsizei>(12), cmd.maxcount); |
| 961 EXPECT_EQ(static_cast<uint32>(13), cmd.count_shm_id); | 961 EXPECT_EQ(static_cast<uint32>(13), cmd.count_shm_id); |
| 962 EXPECT_EQ(static_cast<uint32>(14), cmd.count_shm_offset); | 962 EXPECT_EQ(static_cast<uint32>(14), cmd.count_shm_offset); |
| 963 EXPECT_EQ(static_cast<uint32>(15), cmd.shaders_shm_id); | 963 EXPECT_EQ(static_cast<uint32>(15), cmd.shaders_shm_id); |
| 964 EXPECT_EQ(static_cast<uint32>(16), cmd.shaders_shm_offset); | 964 EXPECT_EQ(static_cast<uint32>(16), cmd.shaders_shm_offset); |
| 965 } | 965 } |
| 966 | 966 |
| 967 TEST(GLES2FormatTest, GetAttribLocation) { | 967 // TODO(gman): Write test for GetAttribLocation |
| 968 GetAttribLocation cmd = { 0, }; | 968 // TODO(gman): Write test for GetAttribLocationImmediate |
| 969 void* next_cmd = cmd.Set( | |
| 970 &cmd, | |
| 971 static_cast<GLuint>(11), | |
| 972 static_cast<uint32>(12), | |
| 973 static_cast<uint32>(13), | |
| 974 static_cast<uint32>(14)); | |
| 975 EXPECT_EQ(GetAttribLocation::kCmdId, cmd.header.command); | |
| 976 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4); // NOLINT | |
| 977 EXPECT_EQ(static_cast<GLuint>(11), cmd.program); | |
| 978 EXPECT_EQ(static_cast<uint32>(12), cmd.name_shm_id); | |
| 979 EXPECT_EQ(static_cast<uint32>(13), cmd.name_shm_offset); | |
| 980 EXPECT_EQ(static_cast<uint32>(14), cmd.data_size); | |
| 981 } | |
| 982 | |
| 983 TEST(GLES2FormatTest, GetAttribLocationImmediate) { | |
| 984 int8 buf[256] = { 0, }; | |
| 985 GetAttribLocationImmediate& cmd = | |
| 986 *static_cast<GetAttribLocationImmediate*>(static_cast<void*>(&buf)); | |
| 987 static const char* const test_str = "test string"; | |
| 988 void* next_cmd = cmd.Set( | |
| 989 &cmd, | |
| 990 static_cast<GLuint>(11), | |
| 991 test_str); | |
| 992 EXPECT_EQ(GetAttribLocationImmediate::kCmdId, cmd.header.command); | |
| 993 EXPECT_EQ(sizeof(cmd) + // NOLINT | |
| 994 RoundSizeToMultipleOfEntries(strlen(test_str)), | |
| 995 cmd.header.size * 4); | |
| 996 EXPECT_EQ(static_cast<GLuint>(11), cmd.program); | |
| 997 // TODO(gman): check that string got copied. | |
| 998 } | |
| 999 | |
| 1000 TEST(GLES2FormatTest, GetBooleanv) { | 969 TEST(GLES2FormatTest, GetBooleanv) { |
| 1001 GetBooleanv cmd = { 0, }; | 970 GetBooleanv cmd = { 0, }; |
| 1002 void* next_cmd = cmd.Set( | 971 void* next_cmd = cmd.Set( |
| 1003 &cmd, | 972 &cmd, |
| 1004 static_cast<GLenum>(11), | 973 static_cast<GLenum>(11), |
| 1005 static_cast<uint32>(12), | 974 static_cast<uint32>(12), |
| 1006 static_cast<uint32>(13)); | 975 static_cast<uint32>(13)); |
| 1007 EXPECT_EQ(GetBooleanv::kCmdId, cmd.header.command); | 976 EXPECT_EQ(GetBooleanv::kCmdId, cmd.header.command); |
| 1008 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4); // NOLINT | 977 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4); // NOLINT |
| 1009 EXPECT_EQ(static_cast<GLenum>(11), cmd.pname); | 978 EXPECT_EQ(static_cast<GLenum>(11), cmd.pname); |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1280 static_cast<uint32>(13), | 1249 static_cast<uint32>(13), |
| 1281 static_cast<uint32>(14)); | 1250 static_cast<uint32>(14)); |
| 1282 EXPECT_EQ(GetUniformiv::kCmdId, cmd.header.command); | 1251 EXPECT_EQ(GetUniformiv::kCmdId, cmd.header.command); |
| 1283 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4); // NOLINT | 1252 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4); // NOLINT |
| 1284 EXPECT_EQ(static_cast<GLuint>(11), cmd.program); | 1253 EXPECT_EQ(static_cast<GLuint>(11), cmd.program); |
| 1285 EXPECT_EQ(static_cast<GLint>(12), cmd.location); | 1254 EXPECT_EQ(static_cast<GLint>(12), cmd.location); |
| 1286 EXPECT_EQ(static_cast<uint32>(13), cmd.params_shm_id); | 1255 EXPECT_EQ(static_cast<uint32>(13), cmd.params_shm_id); |
| 1287 EXPECT_EQ(static_cast<uint32>(14), cmd.params_shm_offset); | 1256 EXPECT_EQ(static_cast<uint32>(14), cmd.params_shm_offset); |
| 1288 } | 1257 } |
| 1289 | 1258 |
| 1290 TEST(GLES2FormatTest, GetUniformLocation) { | 1259 // TODO(gman): Write test for GetUniformLocation |
| 1291 GetUniformLocation cmd = { 0, }; | 1260 // TODO(gman): Write test for GetUniformLocationImmediate |
| 1292 void* next_cmd = cmd.Set( | |
| 1293 &cmd, | |
| 1294 static_cast<GLuint>(11), | |
| 1295 static_cast<uint32>(12), | |
| 1296 static_cast<uint32>(13), | |
| 1297 static_cast<uint32>(14)); | |
| 1298 EXPECT_EQ(GetUniformLocation::kCmdId, cmd.header.command); | |
| 1299 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4); // NOLINT | |
| 1300 EXPECT_EQ(static_cast<GLuint>(11), cmd.program); | |
| 1301 EXPECT_EQ(static_cast<uint32>(12), cmd.name_shm_id); | |
| 1302 EXPECT_EQ(static_cast<uint32>(13), cmd.name_shm_offset); | |
| 1303 EXPECT_EQ(static_cast<uint32>(14), cmd.data_size); | |
| 1304 } | |
| 1305 | |
| 1306 TEST(GLES2FormatTest, GetUniformLocationImmediate) { | |
| 1307 int8 buf[256] = { 0, }; | |
| 1308 GetUniformLocationImmediate& cmd = | |
| 1309 *static_cast<GetUniformLocationImmediate*>(static_cast<void*>(&buf)); | |
| 1310 static const char* const test_str = "test string"; | |
| 1311 void* next_cmd = cmd.Set( | |
| 1312 &cmd, | |
| 1313 static_cast<GLuint>(11), | |
| 1314 test_str); | |
| 1315 EXPECT_EQ(GetUniformLocationImmediate::kCmdId, cmd.header.command); | |
| 1316 EXPECT_EQ(sizeof(cmd) + // NOLINT | |
| 1317 RoundSizeToMultipleOfEntries(strlen(test_str)), | |
| 1318 cmd.header.size * 4); | |
| 1319 EXPECT_EQ(static_cast<GLuint>(11), cmd.program); | |
| 1320 // TODO(gman): check that string got copied. | |
| 1321 } | |
| 1322 | |
| 1323 TEST(GLES2FormatTest, GetVertexAttribfv) { | 1261 TEST(GLES2FormatTest, GetVertexAttribfv) { |
| 1324 GetVertexAttribfv cmd = { 0, }; | 1262 GetVertexAttribfv cmd = { 0, }; |
| 1325 void* next_cmd = cmd.Set( | 1263 void* next_cmd = cmd.Set( |
| 1326 &cmd, | 1264 &cmd, |
| 1327 static_cast<GLuint>(11), | 1265 static_cast<GLuint>(11), |
| 1328 static_cast<GLenum>(12), | 1266 static_cast<GLenum>(12), |
| 1329 static_cast<uint32>(13), | 1267 static_cast<uint32>(13), |
| 1330 static_cast<uint32>(14)); | 1268 static_cast<uint32>(14)); |
| 1331 EXPECT_EQ(GetVertexAttribfv::kCmdId, cmd.header.command); | 1269 EXPECT_EQ(GetVertexAttribfv::kCmdId, cmd.header.command); |
| 1332 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4); // NOLINT | 1270 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4); // NOLINT |
| (...skipping 1416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2749 } | 2687 } |
| 2750 | 2688 |
| 2751 TEST(GLES2FormatTest, SwapBuffers) { | 2689 TEST(GLES2FormatTest, SwapBuffers) { |
| 2752 SwapBuffers cmd = { 0, }; | 2690 SwapBuffers cmd = { 0, }; |
| 2753 void* next_cmd = cmd.Set( | 2691 void* next_cmd = cmd.Set( |
| 2754 &cmd); | 2692 &cmd); |
| 2755 EXPECT_EQ(SwapBuffers::kCmdId, cmd.header.command); | 2693 EXPECT_EQ(SwapBuffers::kCmdId, cmd.header.command); |
| 2756 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4); // NOLINT | 2694 EXPECT_EQ(sizeof(cmd), cmd.header.size * 4); // NOLINT |
| 2757 } | 2695 } |
| 2758 | 2696 |
| OLD | NEW |