summaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-11-17 17:26:02 -0800
committerLei Zhang <thestig@chromium.org>2015-11-17 17:26:02 -0800
commitc57e236578f923007fbcdac953625d46a569f213 (patch)
tree98e9599557e55cdcb51b3dac1f5afc56c976fb9b /core/src
parent614d951f165497c7736481dc610216c8b93d4359 (diff)
downloadpdfium-c57e236578f923007fbcdac953625d46a569f213.tar.xz
Merge to XFA: Add more fxcrt string sanity tests.
Sadly I've gotten these to fail with Chromium debug builds. TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1447163004 . (cherry picked from commit 191333dbc8889a60ff43a10176cc0ae87dc11d89) Review URL: https://codereview.chromium.org/1453403002 .
Diffstat (limited to 'core/src')
-rw-r--r--core/src/fxcrt/fx_basic_bstring_unittest.cpp8
-rw-r--r--core/src/fxcrt/fx_basic_wstring_unittest.cpp8
2 files changed, 16 insertions, 0 deletions
diff --git a/core/src/fxcrt/fx_basic_bstring_unittest.cpp b/core/src/fxcrt/fx_basic_bstring_unittest.cpp
index 614206bb60..337775d9af 100644
--- a/core/src/fxcrt/fx_basic_bstring_unittest.cpp
+++ b/core/src/fxcrt/fx_basic_bstring_unittest.cpp
@@ -679,3 +679,11 @@ TEST(fxcrt, ByteStringFormatPrecision) {
EXPECT_EQ("Bad precision", str);
}
}
+
+TEST(fxcrt, EmptyByteString) {
+ CFX_ByteString empty_str;
+ EXPECT_TRUE(empty_str.IsEmpty());
+ EXPECT_EQ(0, empty_str.GetLength());
+ const FX_CHAR* cstr = empty_str.c_str();
+ EXPECT_EQ(0, FXSYS_strlen(cstr));
+}
diff --git a/core/src/fxcrt/fx_basic_wstring_unittest.cpp b/core/src/fxcrt/fx_basic_wstring_unittest.cpp
index 8ce778920f..74410ddda3 100644
--- a/core/src/fxcrt/fx_basic_wstring_unittest.cpp
+++ b/core/src/fxcrt/fx_basic_wstring_unittest.cpp
@@ -516,3 +516,11 @@ TEST(fxcrt, WideStringFormatPrecision) {
EXPECT_EQ(L"Bad precision", str);
}
}
+
+TEST(fxcrt, EmptyWideString) {
+ CFX_WideString empty_str;
+ EXPECT_TRUE(empty_str.IsEmpty());
+ EXPECT_EQ(0, empty_str.GetLength());
+ const FX_WCHAR* cstr = empty_str.c_str();
+ EXPECT_EQ(0, FXSYS_wcslen(cstr));
+}