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

Unified Diff: components/drive/file_cache_unittest.cc

Issue 1546143002: Switch to standard integer types in components/, part 1 of 4. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « components/drive/file_cache.cc ('k') | components/drive/file_change.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/drive/file_cache_unittest.cc
diff --git a/components/drive/file_cache_unittest.cc b/components/drive/file_cache_unittest.cc
index 749a8775fd9327f3c11f2971b35c760cd968610b..3db588adaff4d3bd341ffc1a832d773f194b9c50 100644
--- a/components/drive/file_cache_unittest.cc
+++ b/components/drive/file_cache_unittest.cc
@@ -4,6 +4,9 @@
#include "components/drive/file_cache.h"
+#include <stddef.h>
+#include <stdint.h>
+
#include <string>
#include <vector>
@@ -167,7 +170,7 @@ TEST_F(FileCacheTest, FreeDiskSpaceIfNeededFor) {
fake_free_disk_space_getter_->set_default_value(test_util::kLotsOfSpace);
fake_free_disk_space_getter_->PushFakeValue(0);
fake_free_disk_space_getter_->PushFakeValue(0);
- const int64 kNeededBytes = 1;
+ const int64_t kNeededBytes = 1;
EXPECT_TRUE(cache_->FreeDiskSpaceIfNeededFor(kNeededBytes));
// Only 'temporary' file gets removed.
@@ -218,7 +221,7 @@ TEST_F(FileCacheTest, EvictDriveCacheInLRU) {
fake_free_disk_space_getter_->set_default_value(test_util::kLotsOfSpace);
fake_free_disk_space_getter_->PushFakeValue(kMinFreeSpaceInBytes);
fake_free_disk_space_getter_->PushFakeValue(kMinFreeSpaceInBytes);
- const int64 kNeededBytes = kTemporaryFileSizeInBytes * 3 / 2;
+ const int64_t kNeededBytes = kTemporaryFileSizeInBytes * 3 / 2;
EXPECT_TRUE(cache_->FreeDiskSpaceIfNeededFor(kNeededBytes));
// Entry A is evicted.
@@ -269,7 +272,7 @@ TEST_F(FileCacheTest, EvictInvalidCacheFile) {
// Run FreeDiskSpaceIfNeededFor.
fake_free_disk_space_getter_->set_default_value(test_util::kLotsOfSpace);
fake_free_disk_space_getter_->PushFakeValue(kMinFreeSpaceInBytes);
- const int64 kNeededBytes = 1;
+ const int64_t kNeededBytes = 1;
EXPECT_TRUE(cache_->FreeDiskSpaceIfNeededFor(kNeededBytes));
// Entry A is not evicted.
@@ -295,7 +298,7 @@ TEST_F(FileCacheTest, TooManyCacheFiles) {
// Add kNumOfTestFiles=kMaxNumOfEvictedCacheFiles*2 entries.
std::vector<base::FilePath> paths;
- const int32 kNumOfTestFiles = kMaxNumOfEvictedCacheFiles * 2;
+ const int32_t kNumOfTestFiles = kMaxNumOfEvictedCacheFiles * 2;
for (int i = 0; i < kNumOfTestFiles; ++i) {
// Set last accessed in reverse order to the file name. i.e. If you sort
// files in name-asc order, they will be last access desc order.
@@ -316,11 +319,11 @@ TEST_F(FileCacheTest, TooManyCacheFiles) {
fake_free_disk_space_getter_->PushFakeValue(
kMinFreeSpaceInBytes +
(kMaxNumOfEvictedCacheFiles * kTemporaryFileSizeInBytes));
- const int64 kNeededBytes =
+ const int64_t kNeededBytes =
(kMaxNumOfEvictedCacheFiles * 3 / 2) * kTemporaryFileSizeInBytes;
EXPECT_FALSE(cache_->FreeDiskSpaceIfNeededFor(kNeededBytes));
- for (uint32 i = 0; i < kNumOfTestFiles; ++i) {
+ for (uint32_t i = 0; i < kNumOfTestFiles; ++i) {
// Assert that only first kMaxNumOfEvictedCacheFiles exist.
ASSERT_EQ(i < kMaxNumOfEvictedCacheFiles, base::PathExists(paths[i]));
}
« no previous file with comments | « components/drive/file_cache.cc ('k') | components/drive/file_change.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698