summaryrefslogtreecommitdiff
path: root/core/fxcrt/widestring_unittest.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-04-18 19:04:20 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-04-18 19:04:20 +0000
commit7439517516a0bb3833ee95ddb9d71051f981347c (patch)
tree85dd6db5c3955fe8aebe0278bf20bd9cc6ca0d0b /core/fxcrt/widestring_unittest.cpp
parent51a41ea222eeb852be4f372165d2d9bc9094b2a4 (diff)
downloadpdfium-7439517516a0bb3833ee95ddb9d71051f981347c.tar.xz
Add AsRawSpan() to ByteString.
Also tidy AsSpan() for Byte/Wide strings. Change-Id: I1853d31a59bc7f46de81295cde2e1062b91badec Reviewed-on: https://pdfium-review.googlesource.com/30911 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fxcrt/widestring_unittest.cpp')
-rw-r--r--core/fxcrt/widestring_unittest.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/fxcrt/widestring_unittest.cpp b/core/fxcrt/widestring_unittest.cpp
index ec0a55fc1e..4572305530 100644
--- a/core/fxcrt/widestring_unittest.cpp
+++ b/core/fxcrt/widestring_unittest.cpp
@@ -1353,8 +1353,14 @@ TEST(WideString, Empty) {
WideString empty_str;
EXPECT_TRUE(empty_str.IsEmpty());
EXPECT_EQ(0u, empty_str.GetLength());
+
const wchar_t* cstr = empty_str.c_str();
+ EXPECT_NE(nullptr, cstr);
EXPECT_EQ(0u, wcslen(cstr));
+
+ pdfium::span<const wchar_t> cspan = empty_str.AsSpan();
+ EXPECT_TRUE(cspan.empty());
+ EXPECT_EQ(nullptr, cspan.data());
}
TEST(CFX_WidString, InitializerList) {