From 528c56de01bbbd38788ed6cf8d2eea4c56cbe19e Mon Sep 17 00:00:00 2001 From: "brettw@chromium.org" Date: Fri, 30 Jul 2010 19:28:44 +0000 Subject: Move the number conversions from string_util to a new file. Use the base namespace in the new file. Update callers. I removed all wstring variants and also the string->number ones that ignore the return value. That encourages people to write code and forget about error handling. TEST=included unit tests BUG=none Review URL: http://codereview.chromium.org/3056029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54355 0039d316-1c4b-4281-b951-d872f2087c98 --- net/ftp/ftp_auth_cache_unittest.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'net/ftp') diff --git a/net/ftp/ftp_auth_cache_unittest.cc b/net/ftp/ftp_auth_cache_unittest.cc index 005de89..3971b32 100644 --- a/net/ftp/ftp_auth_cache_unittest.cc +++ b/net/ftp/ftp_auth_cache_unittest.cc @@ -4,6 +4,7 @@ #include "net/ftp/ftp_auth_cache.h" +#include "base/string_number_conversions.h" #include "base/string_util.h" #include "googleurl/src/gurl.h" #include "testing/gtest/include/gtest/gtest.h" @@ -132,12 +133,14 @@ TEST(FtpAuthCacheTest, OnlyRemoveMatching) { TEST(FtpAuthCacheTest, EvictOldEntries) { FtpAuthCache cache; - for (size_t i = 0; i < FtpAuthCache::kMaxEntries; i++) - cache.Add(GURL("ftp://host" + IntToString(i)), kUsername, kPassword); + for (size_t i = 0; i < FtpAuthCache::kMaxEntries; i++) { + cache.Add(GURL("ftp://host" + base::IntToString(i)), + kUsername, kPassword); + } // No entries should be evicted before reaching the limit. for (size_t i = 0; i < FtpAuthCache::kMaxEntries; i++) { - EXPECT_TRUE(cache.Lookup(GURL("ftp://host" + IntToString(i)))); + EXPECT_TRUE(cache.Lookup(GURL("ftp://host" + base::IntToString(i)))); } // Adding one entry should cause eviction of the first entry. @@ -146,7 +149,7 @@ TEST(FtpAuthCacheTest, EvictOldEntries) { // Remaining entries should not get evicted. for (size_t i = 1; i < FtpAuthCache::kMaxEntries; i++) { - EXPECT_TRUE(cache.Lookup(GURL("ftp://host" + IntToString(i)))); + EXPECT_TRUE(cache.Lookup(GURL("ftp://host" + base::IntToString(i)))); } EXPECT_TRUE(cache.Lookup(GURL("ftp://last_host"))); } -- cgit v1.1