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

Side by Side Diff: cc/resources/resource_util_unittest.cc

Issue 1539203002: Switch to standard integer types in cc/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: more includes Created 4 years, 12 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 unified diff | Download patch
« no previous file with comments | « cc/resources/resource_util.h ('k') | cc/resources/returned_resource.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #include <stddef.h>
6
5 #include "base/logging.h" 7 #include "base/logging.h"
6 #include "cc/resources/resource_util.h" 8 #include "cc/resources/resource_util.h"
7 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
8 10
9 namespace cc { 11 namespace cc {
10 namespace { 12 namespace {
11 13
12 struct TestFormat { 14 struct TestFormat {
13 ResourceFormat format; 15 ResourceFormat format;
14 size_t expected_bytes; 16 size_t expected_bytes;
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 160
159 TEST_F(ResourceUtilTest, SizeInBytesOverflow) { 161 TEST_F(ResourceUtilTest, SizeInBytesOverflow) {
160 gfx::Size size(10, 10); 162 gfx::Size size(10, 10);
161 // 10 * 16 * 10 = 1600 bits, overflows in char, but fits in int. 163 // 10 * 16 * 10 = 1600 bits, overflows in char, but fits in int.
162 EXPECT_FALSE(ResourceUtil::VerifySizeInBytes<signed char>(size, RGBA_4444)); 164 EXPECT_FALSE(ResourceUtil::VerifySizeInBytes<signed char>(size, RGBA_4444));
163 EXPECT_TRUE(ResourceUtil::VerifySizeInBytes<int>(size, RGBA_4444)); 165 EXPECT_TRUE(ResourceUtil::VerifySizeInBytes<int>(size, RGBA_4444));
164 } 166 }
165 167
166 } // namespace 168 } // namespace
167 } // namespace cc 169 } // namespace cc
OLDNEW
« no previous file with comments | « cc/resources/resource_util.h ('k') | cc/resources/returned_resource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698