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

Unified Diff: chrome/common/extensions/extension_unittest.cc

Issue 339059: Add compiler-specific "examine printf format" attributes to printfs. (Closed)
Patch Set: cleanups Created 11 years, 1 month 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
Index: chrome/common/extensions/extension_unittest.cc
diff --git a/chrome/common/extensions/extension_unittest.cc b/chrome/common/extensions/extension_unittest.cc
index 6e1ad5e95cc543296379952954ff4680c2d76867..702bb558811515c461d431717eb3cc4a0464850f 100644
--- a/chrome/common/extensions/extension_unittest.cc
+++ b/chrome/common/extensions/extension_unittest.cc
@@ -2,12 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "chrome/common/extensions/extension.h"
+
+#include "base/format_macros.h"
#include "base/file_path.h"
#include "base/file_util.h"
#include "base/string_util.h"
#include "base/path_service.h"
#include "chrome/common/chrome_paths.h"
-#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_constants.h"
#include "chrome/common/extensions/extension_error_reporter.h"
#include "chrome/common/json_value_serializer.h"
@@ -461,9 +463,11 @@ TEST(ExtensionTest, UpdateUrls) {
DictionaryValue input_value;
#if defined(OS_WIN)
- FilePath path(StringPrintf(L"c:\\extension%i", i));
+ // (Why %d below? This is the single place in the whole code base that
+ // might make use of a WidePRIuS; let's not encourage any more.)
Mark Mentovai 2009/11/18 20:55:27 OK, that's fair enough. But wouldn't it be L"%Iu"
+ FilePath path(StringPrintf(L"c:\\extension%d", i));
#else
- FilePath path(StringPrintf("/extension%i", i));
+ FilePath path(StringPrintf("/extension%" PRIuS, i));
#endif
Extension extension(path);
std::string error;
@@ -483,9 +487,12 @@ TEST(ExtensionTest, UpdateUrls) {
for (size_t i = 0; i < invalid.size(); i++) {
DictionaryValue input_value;
#if defined(OS_WIN)
- FilePath path(StringPrintf(L"c:\\extension%i", i));
+ // We should use PRIuS here, but it's a wide string. This is the only
+ // instance of a wide string needing PRIuS in the entire code base, so
+ // let's just work around it here.
Mark Mentovai 2009/11/18 20:55:27 Same. Oh, I guess there are two locations...
+ FilePath path(StringPrintf(L"c:\\extension%d", i));
#else
- FilePath path(StringPrintf("/extension%i", i));
+ FilePath path(StringPrintf("/extension%" PRIuS, i));
#endif
Extension extension(path);
std::string error;

Powered by Google App Engine
This is Rietveld 408576698