summaryrefslogtreecommitdiffstats
path: root/base/string_util_unittest.cc
diff options
context:
space:
mode:
authorevanm@google.com <evanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-15 01:04:11 +0000
committerevanm@google.com <evanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-15 01:04:11 +0000
commit4c0040c49331c5cb5b88960ecec04ce8a5f0756a (patch)
treeeb20f932e07a7c3fcb5bf144cba675d48ca791af /base/string_util_unittest.cc
parent1b3deed79fc638d3755ba5159108712238d8beb7 (diff)
downloadchromium_src-4c0040c49331c5cb5b88960ecec04ce8a5f0756a.zip
chromium_src-4c0040c49331c5cb5b88960ecec04ce8a5f0756a.tar.gz
chromium_src-4c0040c49331c5cb5b88960ecec04ce8a5f0756a.tar.bz2
To pass string_util_unittest, we need the ICU data file. To get the ICU data file, we need some of PathService, which brings along with it a bunch of other needed functions. So here are a bunch of stubs, along with another file's worth of passing tests. (Based on a patch from Dean.)
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@921 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/string_util_unittest.cc')
-rw-r--r--base/string_util_unittest.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/base/string_util_unittest.cc b/base/string_util_unittest.cc
index 05ba0a1..01fac05 100644
--- a/base/string_util_unittest.cc
+++ b/base/string_util_unittest.cc
@@ -607,11 +607,11 @@ TEST(StringUtilTest, FormatBytes) {
TEST(StringUtilTest, ReplaceSubstringsAfterOffset) {
static const struct {
- wchar_t* str;
+ const wchar_t* str;
std::wstring::size_type start_offset;
- wchar_t* find_this;
- wchar_t* replace_with;
- wchar_t* expected;
+ const wchar_t* find_this;
+ const wchar_t* replace_with;
+ const wchar_t* expected;
} cases[] = {
{L"aaa", 0, L"a", L"b", L"bbb"},
{L"abb", 0, L"ab", L"a", L"ab"},
@@ -1053,7 +1053,7 @@ TEST(StringUtilTest, Grow) {
src[i] = 'A';
src[1025] = 0;
- char* fmt = "%sB%sB%sB%sB%sB%sB%s";
+ const char* fmt = "%sB%sB%sB%sB%sB%sB%s";
std::string out;
SStringPrintf(&out, fmt, src, src, src, src, src, src, src);
@@ -1087,6 +1087,8 @@ TEST(StringUtilTest, 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(StringUtilTest, Invalid) {
@@ -1098,6 +1100,7 @@ TEST(StringUtilTest, Invalid) {
SStringPrintf(&out, L"%ls", invalid);
EXPECT_STREQ(L"", out.c_str());
}
+#endif
// Test for SplitString
TEST(StringUtilTest, SplitString) {