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

Unified Diff: net/disk_cache/simple/simple_util_unittest.cc

Issue 2004913002: SimpleCache: open with fewer seeks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 years, 7 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 | « net/disk_cache/simple/simple_util.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/disk_cache/simple/simple_util_unittest.cc
diff --git a/net/disk_cache/simple/simple_util_unittest.cc b/net/disk_cache/simple/simple_util_unittest.cc
index 2956f27f17d2ce9bc49c08f09331b80bf2119125..442dc425f8c0d91f9235d46e59a5753980395ad6 100644
--- a/net/disk_cache/simple/simple_util_unittest.cc
+++ b/net/disk_cache/simple/simple_util_unittest.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include <stdint.h>
+#include <string>
#include "base/logging.h"
#include "net/disk_cache/simple/simple_util.h"
@@ -12,8 +13,8 @@ using disk_cache::simple_util::ConvertEntryHashKeyToHexString;
using disk_cache::simple_util::GetEntryHashKeyAsHexString;
using disk_cache::simple_util::GetEntryHashKeyFromHexString;
using disk_cache::simple_util::GetEntryHashKey;
-using disk_cache::simple_util::GetFileSizeFromKeyAndDataSize;
-using disk_cache::simple_util::GetDataSizeFromKeyAndFileSize;
+using disk_cache::simple_util::GetFileSizeFromDataSize;
+using disk_cache::simple_util::GetDataSizeFromFileSize;
class SimpleUtilTest : public testing::Test {};
@@ -70,8 +71,8 @@ TEST_F(SimpleUtilTest, GetEntryHashKeyFromHexString) {
}
TEST_F(SimpleUtilTest, SizesAndOffsets) {
- const char key[] = "This is an example key";
+ const std::string key("This is an example key");
const int data_size = 1000;
- const int file_size = GetFileSizeFromKeyAndDataSize(key, data_size);
- EXPECT_EQ(data_size, GetDataSizeFromKeyAndFileSize(key, file_size));
+ const int file_size = GetFileSizeFromDataSize(key.size(), data_size);
+ EXPECT_EQ(data_size, GetDataSizeFromFileSize(key.size(), file_size));
}
« no previous file with comments | « net/disk_cache/simple/simple_util.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698