summaryrefslogtreecommitdiffstats
path: root/gpu/command_buffer/service/shader_manager_unittest.cc
diff options
context:
space:
mode:
authorgman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-29 01:20:52 +0000
committergman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-29 01:20:52 +0000
commitdf6cf1addfa73b6955ef83a641d929f0be9387ab (patch)
tree4100a74dcf90033ea17311b48f8334757803728f /gpu/command_buffer/service/shader_manager_unittest.cc
parentec7db28ad27a4285b43fb53e63c2b932fe6c3a7d (diff)
downloadchromium_src-df6cf1addfa73b6955ef83a641d929f0be9387ab.zip
chromium_src-df6cf1addfa73b6955ef83a641d929f0be9387ab.tar.gz
chromium_src-df6cf1addfa73b6955ef83a641d929f0be9387ab.tar.bz2
Fix TexSubImage2D and CompressedTexSubImage2D to check that format and type
match the texture they are going to update. Also fix the info_log and source stuff so they handle NULL strings vs empty strings. TEST=unit tests and ran gles2 conformance tests BUG=71135,71073,71109 Review URL: http://codereview.chromium.org/6250036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@73056 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/command_buffer/service/shader_manager_unittest.cc')
-rw-r--r--gpu/command_buffer/service/shader_manager_unittest.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/gpu/command_buffer/service/shader_manager_unittest.cc b/gpu/command_buffer/service/shader_manager_unittest.cc
index 344cefd..c3c084d 100644
--- a/gpu/command_buffer/service/shader_manager_unittest.cc
+++ b/gpu/command_buffer/service/shader_manager_unittest.cc
@@ -79,7 +79,7 @@ TEST_F(ShaderManagerTest, ShaderInfo) {
const GLuint kClient1Id = 1;
const GLuint kService1Id = 11;
const GLenum kShader1Type = GL_VERTEX_SHADER;
- const std::string kClient1Source("hello world");
+ const char* kClient1Source = "hello world";
// Check we can create shader.
manager_.CreateShaderInfo(kClient1Id, kService1Id, kShader1Type);
// Check shader got created.
@@ -90,14 +90,15 @@ TEST_F(ShaderManagerTest, ShaderInfo) {
EXPECT_EQ(kShader1Type, info1->shader_type());
EXPECT_FALSE(info1->IsValid());
EXPECT_FALSE(info1->InUse());
- EXPECT_STREQ("", info1->log_info().c_str());
+ EXPECT_TRUE(info1->source() == NULL);
+ EXPECT_TRUE(info1->log_info() == NULL);
const char* kLog = "foo";
info1->SetStatus(true, kLog, NULL);
EXPECT_TRUE(info1->IsValid());
- EXPECT_STREQ(kLog, info1->log_info().c_str());
+ EXPECT_STREQ(kLog, info1->log_info()->c_str());
// Check we can set its source.
info1->Update(kClient1Source);
- EXPECT_STREQ(kClient1Source.c_str(), info1->source().c_str());
+ EXPECT_STREQ(kClient1Source, info1->source()->c_str());
}
TEST_F(ShaderManagerTest, GetInfo) {
@@ -155,7 +156,8 @@ TEST_F(ShaderManagerTest, GetInfo) {
EXPECT_EQ(it->second.size, variable_info->size);
}
// Check attrib and uniform get cleared.
- info1->SetStatus(true, "", NULL);
+ info1->SetStatus(true, NULL, NULL);
+ EXPECT_TRUE(info1->log_info() == NULL);
for (ShaderTranslator::VariableMap::const_iterator it = attrib_map.begin();
it != attrib_map.end(); ++it) {
const ShaderManager::ShaderInfo::VariableInfo* variable_info =