summaryrefslogtreecommitdiffstats
path: root/net/proxy
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-20 06:53:28 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-20 06:53:28 +0000
commit34b2b007db875a6acb853c5cd2a247fbb32c0f88 (patch)
tree6dc39bc9f10d6e8eedcdf14821ba9e96b5ccab51 /net/proxy
parent24b857793e27aded8d804a112a5fe6c77e28b081 (diff)
downloadchromium_src-34b2b007db875a6acb853c5cd2a247fbb32c0f88.zip
chromium_src-34b2b007db875a6acb853c5cd2a247fbb32c0f88.tar.gz
chromium_src-34b2b007db875a6acb853c5cd2a247fbb32c0f88.tar.bz2
Add compiler-specific "examine printf format" attributes to printfs.
Functions that take a printf-style format get a new annotation, which produces a bunch of compiler warnings when you use printf impoperly. This change adds the annotations and fixes the warnings. We now must use PRId64 for 64-bit numbers and the PRIsz for size_t. Review URL: http://codereview.chromium.org/339059 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32600 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/proxy')
-rw-r--r--net/proxy/proxy_config_service_linux_unittest.cc15
-rw-r--r--net/proxy/proxy_service_unittest.cc6
2 files changed, 13 insertions, 8 deletions
diff --git a/net/proxy/proxy_config_service_linux_unittest.cc b/net/proxy/proxy_config_service_linux_unittest.cc
index 26149e5..2ffe081 100644
--- a/net/proxy/proxy_config_service_linux_unittest.cc
+++ b/net/proxy/proxy_config_service_linux_unittest.cc
@@ -2,14 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "net/proxy/proxy_config_service_linux.h"
+
#include <map>
#include <string>
#include <vector>
-#include "net/proxy/proxy_config_service_linux.h"
-
#include "base/file_path.h"
#include "base/file_util.h"
+#include "base/format_macros.h"
#include "base/logging.h"
#include "base/string_util.h"
#include "base/task.h"
@@ -17,7 +18,6 @@
#include "base/waitable_event.h"
#include "net/proxy/proxy_config.h"
#include "net/proxy/proxy_config_service_common_unittest.h"
-
#include "testing/gtest/include/gtest/gtest.h"
#include "testing/platform_test.h"
@@ -585,7 +585,8 @@ TEST_F(ProxyConfigServiceLinuxTest, BasicGConfTest) {
};
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) {
- SCOPED_TRACE(StringPrintf("Test[%d] %s", i, tests[i].description.c_str()));
+ SCOPED_TRACE(StringPrintf("Test[%" PRIuS "] %s", i,
+ tests[i].description.c_str()));
MockEnvironmentVariableGetter* env_getter =
new MockEnvironmentVariableGetter;
MockGConfSettingGetter* gconf_getter = new MockGConfSettingGetter;
@@ -864,7 +865,8 @@ TEST_F(ProxyConfigServiceLinuxTest, BasicEnvTest) {
};
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) {
- SCOPED_TRACE(StringPrintf("Test[%d] %s", i, tests[i].description.c_str()));
+ SCOPED_TRACE(StringPrintf("Test[%" PRIuS "] %s", i,
+ tests[i].description.c_str()));
MockEnvironmentVariableGetter* env_getter =
new MockEnvironmentVariableGetter;
MockGConfSettingGetter* gconf_getter = new MockGConfSettingGetter;
@@ -1185,7 +1187,8 @@ TEST_F(ProxyConfigServiceLinuxTest, KDEConfigParser) {
};
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) {
- SCOPED_TRACE(StringPrintf("Test[%d] %s", i, tests[i].description.c_str()));
+ SCOPED_TRACE(StringPrintf("Test[%" PRIuS "] %s", i,
+ tests[i].description.c_str()));
MockEnvironmentVariableGetter* env_getter =
new MockEnvironmentVariableGetter;
// Force the KDE getter to be used and tell it where the test is.
diff --git a/net/proxy/proxy_service_unittest.cc b/net/proxy/proxy_service_unittest.cc
index b7c7d00..6dbee99 100644
--- a/net/proxy/proxy_service_unittest.cc
+++ b/net/proxy/proxy_service_unittest.cc
@@ -2,8 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "net/proxy/proxy_service.h"
+
#include <vector>
+#include "base/format_macros.h"
#include "base/logging.h"
#include "base/string_util.h"
#include "googleurl/src/gurl.h"
@@ -15,7 +18,6 @@
#include "net/proxy/proxy_config_service.h"
#include "net/proxy/proxy_resolver.h"
#include "net/proxy/proxy_script_fetcher.h"
-#include "net/proxy/proxy_service.h"
#include "testing/gtest/include/gtest/gtest.h"
// TODO(eroman): Write a test which exercises
@@ -1474,7 +1476,7 @@ TEST(ProxyServiceTest, IsLocalName) {
};
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) {
- SCOPED_TRACE(StringPrintf("Test[%d]: %s", i, tests[i].url));
+ SCOPED_TRACE(StringPrintf("Test[%" PRIuS "]: %s", i, tests[i].url));
bool is_local = ProxyService::IsLocalName(GURL(tests[i].url));
EXPECT_EQ(tests[i].expected_is_local, is_local);
}