Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(135)

Unified Diff: gpu/command_buffer/common/gles2_cmd_format_test_autogen.h

Issue 333303002: generate GetAttribLocation/GetUniformLocation by build_gles2_cmd_buffer.py (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/command_buffer/common/gles2_cmd_format_autogen.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/common/gles2_cmd_format_test_autogen.h
diff --git a/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h b/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h
index 071bde21a6eccb99e29a14c01538f45f450f38d5..d19c9c6e340316fe56a11d04db8e9038e7298065 100644
--- a/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h
+++ b/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h
@@ -877,7 +877,23 @@ TEST_F(GLES2FormatTest, GetAttachedShaders) {
CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
}
-// TODO(gman): Write test for GetAttribLocation
+TEST_F(GLES2FormatTest, GetAttribLocation) {
+ cmds::GetAttribLocation& cmd = *GetBufferAs<cmds::GetAttribLocation>();
+ void* next_cmd = cmd.Set(&cmd,
+ static_cast<GLuint>(11),
+ static_cast<uint32_t>(12),
+ static_cast<uint32_t>(13),
+ static_cast<uint32_t>(14));
+ EXPECT_EQ(static_cast<uint32_t>(cmds::GetAttribLocation::kCmdId),
+ cmd.header.command);
+ EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
+ EXPECT_EQ(static_cast<GLuint>(11), cmd.program);
+ EXPECT_EQ(static_cast<uint32_t>(12), cmd.name_bucket_id);
+ EXPECT_EQ(static_cast<uint32_t>(13), cmd.location_shm_id);
+ EXPECT_EQ(static_cast<uint32_t>(14), cmd.location_shm_offset);
+ CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
+}
+
TEST_F(GLES2FormatTest, GetBooleanv) {
cmds::GetBooleanv& cmd = *GetBufferAs<cmds::GetBooleanv>();
void* next_cmd = cmd.Set(&cmd,
@@ -1156,7 +1172,23 @@ TEST_F(GLES2FormatTest, GetUniformiv) {
CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
}
-// TODO(gman): Write test for GetUniformLocation
+TEST_F(GLES2FormatTest, GetUniformLocation) {
+ cmds::GetUniformLocation& cmd = *GetBufferAs<cmds::GetUniformLocation>();
+ void* next_cmd = cmd.Set(&cmd,
+ static_cast<GLuint>(11),
+ static_cast<uint32_t>(12),
+ static_cast<uint32_t>(13),
+ static_cast<uint32_t>(14));
+ EXPECT_EQ(static_cast<uint32_t>(cmds::GetUniformLocation::kCmdId),
+ cmd.header.command);
+ EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
+ EXPECT_EQ(static_cast<GLuint>(11), cmd.program);
+ EXPECT_EQ(static_cast<uint32_t>(12), cmd.name_bucket_id);
+ EXPECT_EQ(static_cast<uint32_t>(13), cmd.location_shm_id);
+ EXPECT_EQ(static_cast<uint32_t>(14), cmd.location_shm_offset);
+ CheckBytesWrittenMatchesExpectedSize(next_cmd, sizeof(cmd));
+}
+
TEST_F(GLES2FormatTest, GetVertexAttribfv) {
cmds::GetVertexAttribfv& cmd = *GetBufferAs<cmds::GetVertexAttribfv>();
void* next_cmd = cmd.Set(&cmd,
« no previous file with comments | « gpu/command_buffer/common/gles2_cmd_format_autogen.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698