Index: base/strings/stringprintf_unittest.cc |
diff --git a/base/strings/stringprintf_unittest.cc b/base/strings/stringprintf_unittest.cc |
index c49637c23f256fe321414576c9b6a4eaac45136c..8201db9c1ebbce62d7965211869f3c22d6ae79ed 100644 |
--- a/base/strings/stringprintf_unittest.cc |
+++ b/base/strings/stringprintf_unittest.cc |
@@ -31,45 +31,24 @@ TEST(StringPrintfTest, StringPrintfEmpty) { |
TEST(StringPrintfTest, StringPrintfMisc) { |
EXPECT_EQ("123hello w", StringPrintf("%3d%2s %1c", 123, "hello", 'w')); |
-#if defined(OS_WIN) |
- EXPECT_EQ(L"123hello w", StringPrintf(L"%3d%2ls %1lc", 123, L"hello", 'w')); |
-#endif |
} |
TEST(StringPrintfTest, StringAppendfEmptyString) { |
std::string value("Hello"); |
StringAppendF(&value, "%s", ""); |
EXPECT_EQ("Hello", value); |
- |
-#if defined(OS_WIN) |
- std::wstring valuew(L"Hello"); |
- StringAppendF(&valuew, L"%ls", L""); |
- EXPECT_EQ(L"Hello", valuew); |
-#endif |
} |
TEST(StringPrintfTest, StringAppendfString) { |
std::string value("Hello"); |
StringAppendF(&value, " %s", "World"); |
EXPECT_EQ("Hello World", value); |
- |
-#if defined(OS_WIN) |
- std::wstring valuew(L"Hello"); |
- StringAppendF(&valuew, L" %ls", L"World"); |
- EXPECT_EQ(L"Hello World", valuew); |
-#endif |
} |
TEST(StringPrintfTest, StringAppendfInt) { |
std::string value("Hello"); |
StringAppendF(&value, " %d", 123); |
EXPECT_EQ("Hello 123", value); |
- |
-#if defined(OS_WIN) |
- std::wstring valuew(L"Hello"); |
- StringAppendF(&valuew, L" %d", 123); |
- EXPECT_EQ(L"Hello 123", valuew); |
-#endif |
} |
// Make sure that lengths exactly around the initial buffer size are handled |
@@ -89,13 +68,6 @@ TEST(StringPrintfTest, StringPrintfBounds) { |
std::string out; |
SStringPrintf(&out, "%s", src); |
EXPECT_STREQ(src, out.c_str()); |
- |
-#if defined(OS_WIN) |
- srcw[kSrcLen - i] = 0; |
- std::wstring outw; |
- SStringPrintf(&outw, L"%ls", srcw); |
- EXPECT_STREQ(srcw, outw.c_str()); |
-#endif |
} |
} |
@@ -113,9 +85,7 @@ TEST(StringPrintfTest, Grow) { |
const int kRefSize = 320000; |
char* ref = new char[kRefSize]; |
-#if defined(OS_WIN) |
- sprintf_s(ref, kRefSize, fmt, src, src, src, src, src, src, src); |
-#elif defined(OS_POSIX) |
+#if defined(OS_POSIX) |
snprintf(ref, kRefSize, fmt, src, src, src, src, src, src, src); |
#endif |
@@ -148,21 +118,6 @@ TEST(StringPrintfTest, GrowBoundary) { |
EXPECT_STREQ(src, out.c_str()); |
} |
-// TODO(evanm): what's the proper cross-platform test here? |
-#if defined(OS_WIN) |
-// sprintf in Visual Studio fails when given U+FFFF. This tests that the |
-// failure case is gracefuly handled. |
-TEST(StringPrintfTest, Invalid) { |
- wchar_t invalid[2]; |
- invalid[0] = 0xffff; |
- invalid[1] = 0; |
- |
- std::wstring out; |
- SStringPrintf(&out, L"%ls", invalid); |
- EXPECT_STREQ(L"", out.c_str()); |
-} |
-#endif |
- |
// Test that StringPrintf and StringAppendV do not change errno. |
TEST(StringPrintfTest, StringPrintfErrno) { |
errno = 1; |