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

Unified Diff: gpu/command_buffer/service/program_manager_unittest.cc

Issue 1542513002: Switch to standard integer types in gpu/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 5 years 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/service/program_manager.cc ('k') | gpu/command_buffer/service/query_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/service/program_manager_unittest.cc
diff --git a/gpu/command_buffer/service/program_manager_unittest.cc b/gpu/command_buffer/service/program_manager_unittest.cc
index 8343e56ece9081acf9339057a5ad2945d46ffcaa..eafe75ddd11684f93c22b4a370ffa060734e41b8 100644
--- a/gpu/command_buffer/service/program_manager_unittest.cc
+++ b/gpu/command_buffer/service/program_manager_unittest.cc
@@ -4,6 +4,9 @@
#include "gpu/command_buffer/service/program_manager.h"
+#include <stddef.h>
+#include <stdint.h>
+
#include <algorithm>
#include "base/command_line.h"
@@ -38,15 +41,15 @@ namespace gpu {
namespace gles2 {
namespace {
-const uint32 kMaxVaryingVectors = 8;
-const uint32 kMaxDrawBuffers = 8;
-const uint32 kMaxDualSourceDrawBuffers = 8;
+const uint32_t kMaxVaryingVectors = 8;
+const uint32_t kMaxDrawBuffers = 8;
+const uint32_t kMaxDualSourceDrawBuffers = 8;
void ShaderCacheCb(const std::string& key, const std::string& shader) {}
-uint32 ComputeOffset(const void* start, const void* position) {
- return static_cast<const uint8*>(position) -
- static_cast<const uint8*>(start);
+uint32_t ComputeOffset(const void* start, const void* position) {
+ return static_cast<const uint8_t*>(position) -
+ static_cast<const uint8_t*>(start);
}
} // namespace anonymous
@@ -1062,12 +1065,12 @@ TEST_F(ProgramManagerWithShaderTest, ProgramInfoGetProgramInfo) {
ASSERT_TRUE(inputs != NULL);
const ProgramInput* input = inputs;
// TODO(gman): Don't assume these are in order.
- for (uint32 ii = 0; ii < header->num_attribs; ++ii) {
+ for (uint32_t ii = 0; ii < header->num_attribs; ++ii) {
const AttribInfo& expected = kAttribs[ii];
EXPECT_EQ(expected.size, input->size);
EXPECT_EQ(expected.type, input->type);
- const int32* location = bucket.GetDataAs<const int32*>(
- input->location_offset, sizeof(int32));
+ const int32_t* location = bucket.GetDataAs<const int32_t*>(
+ input->location_offset, sizeof(int32_t));
ASSERT_TRUE(location != NULL);
EXPECT_EQ(expected.location, *location);
const char* name_buf = bucket.GetDataAs<const char*>(
@@ -1078,14 +1081,14 @@ TEST_F(ProgramManagerWithShaderTest, ProgramInfoGetProgramInfo) {
++input;
}
// TODO(gman): Don't assume these are in order.
- for (uint32 ii = 0; ii < header->num_uniforms; ++ii) {
+ for (uint32_t ii = 0; ii < header->num_uniforms; ++ii) {
const UniformInfo& expected = kUniforms[ii];
EXPECT_EQ(expected.size, input->size);
EXPECT_EQ(expected.type, input->type);
- const int32* locations = bucket.GetDataAs<const int32*>(
- input->location_offset, sizeof(int32) * input->size);
+ const int32_t* locations = bucket.GetDataAs<const int32_t*>(
+ input->location_offset, sizeof(int32_t) * input->size);
ASSERT_TRUE(locations != NULL);
- for (int32 jj = 0; jj < input->size; ++jj) {
+ for (int32_t jj = 0; jj < input->size; ++jj) {
EXPECT_EQ(
ProgramManager::MakeFakeLocation(expected.fake_location, jj),
locations[jj]);
@@ -1098,7 +1101,7 @@ TEST_F(ProgramManagerWithShaderTest, ProgramInfoGetProgramInfo) {
++input;
}
EXPECT_EQ(header->num_attribs + header->num_uniforms,
- static_cast<uint32>(input - inputs));
+ static_cast<uint32_t>(input - inputs));
}
TEST_F(ProgramManagerWithShaderTest, ProgramInfoGetUniformBlocksNone) {
@@ -1494,16 +1497,16 @@ TEST_F(ProgramManagerWithShaderTest, UnusedUniformArrayElements) {
sizeof(ProgramInput) * (header->num_attribs + header->num_uniforms));
ASSERT_TRUE(inputs != NULL);
const ProgramInput* input = inputs + header->num_attribs;
- for (uint32 ii = 0; ii < header->num_uniforms; ++ii) {
+ for (uint32_t ii = 0; ii < header->num_uniforms; ++ii) {
const UniformInfo& expected = kUniforms[ii];
EXPECT_EQ(expected.size, input->size);
- const int32* locations = bucket.GetDataAs<const int32*>(
- input->location_offset, sizeof(int32) * input->size);
+ const int32_t* locations = bucket.GetDataAs<const int32_t*>(
+ input->location_offset, sizeof(int32_t) * input->size);
ASSERT_TRUE(locations != NULL);
EXPECT_EQ(
ProgramManager::MakeFakeLocation(expected.fake_location, 0),
locations[0]);
- for (int32 jj = 1; jj < input->size; ++jj)
+ for (int32_t jj = 1; jj < input->size; ++jj)
EXPECT_EQ(-1, locations[jj]);
++input;
}
@@ -1512,7 +1515,7 @@ TEST_F(ProgramManagerWithShaderTest, UnusedUniformArrayElements) {
TEST_F(ProgramManagerWithShaderTest, BindAttribLocationConflicts) {
// Set up shader
AttributeMap attrib_map;
- for (uint32 ii = 0; ii < kNumAttribs; ++ii) {
+ for (uint32_t ii = 0; ii < kNumAttribs; ++ii) {
attrib_map[kAttribs[ii].name] = TestHelper::ConstructAttribute(
kAttribs[ii].type,
kAttribs[ii].size,
« no previous file with comments | « gpu/command_buffer/service/program_manager.cc ('k') | gpu/command_buffer/service/query_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698