Chromium Code Reviews| Index: base/mac/foundation_util_unittest.mm |
| diff --git a/base/mac/foundation_util_unittest.mm b/base/mac/foundation_util_unittest.mm |
| index 3b72b1225a84e1ab78c9ccd7d27f63004274e297..28a1c264a9b97e23a3cf9230dd2aef57a14149c1 100644 |
| --- a/base/mac/foundation_util_unittest.mm |
| +++ b/base/mac/foundation_util_unittest.mm |
| @@ -6,8 +6,10 @@ |
| #include "base/basictypes.h" |
| #include "base/files/file_path.h" |
| +#include "base/format_macros.h" |
| #include "base/mac/scoped_cftyperef.h" |
| #include "base/mac/scoped_nsautorelease_pool.h" |
| +#include "base/strings/stringprintf.h" |
| #include "testing/gtest/include/gtest/gtest.h" |
| #import "testing/gtest_mac.h" |
| @@ -314,5 +316,13 @@ TEST(FoundationUtilTest, NSStringToFilePath) { |
| EXPECT_EQ(FilePath("/a/b"), NSStringToFilePath(@"/a/b")); |
| } |
| +TEST(StringNumberConversionsTest, FormatNSInteger) { |
| + const NSInteger kNSInteger = 12345678; |
| + const NSUInteger kNSUInteger = 12345678u; |
| + EXPECT_EQ("12345678", StringPrintf("%" PRIdNS, kNSInteger)); |
|
Mark Mentovai
2014/03/06 14:44:57
Test that PRIdNS formats negative signed numbers p
sdefresne
2014/03/06 16:27:05
Done.
|
| + EXPECT_EQ("12345678", StringPrintf("%" PRIuNS, kNSUInteger)); |
| + EXPECT_EQ("bc614e", StringPrintf("%" PRIxNS, kNSInteger)); |
| +} |
|
Mark Mentovai
2014/03/06 14:44:57
#ifdef __LP64__, do a couple of tests with things
sdefresne
2014/03/06 16:27:05
Done.
|
| + |
| } // namespace mac |
| } // namespace base |