summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-04-03 12:02:02 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-04-03 19:49:34 +0000
commit8c5e924ad1f048749e2a73fe444ea07bd99abb16 (patch)
tree422042ad8315235f5bd41152cedd0e7d56eeafbc
parent7e7c649237b9d537226e3026aa9b5831862eee5b (diff)
downloadpdfium-8c5e924ad1f048749e2a73fe444ea07bd99abb16.tar.xz
Add test case for bug_707479
We need to oversize the buffer and then fail to format. Use an invalid character conversion to trip this up. Bug: 707479 Change-Id: I7c1d97f0351d76af8fddf74a1cdf05f49c6b1cf7 Reviewed-on: https://pdfium-review.googlesource.com/3612 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
-rw-r--r--core/fxcrt/cfx_widestring_unittest.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/fxcrt/cfx_widestring_unittest.cpp b/core/fxcrt/cfx_widestring_unittest.cpp
index c1728af1b1..a0523b1804 100644
--- a/core/fxcrt/cfx_widestring_unittest.cpp
+++ b/core/fxcrt/cfx_widestring_unittest.cpp
@@ -933,6 +933,11 @@ TEST(fxcrt, WideStringFormatPrecision) {
}
}
+TEST(fxcrt, WideStringFormatOutOfRangeChar) {
+ CFX_WideString str;
+ str.Format(L"unsupported char '%c'", 0x00FF00FF);
+}
+
TEST(fxcrt, EmptyWideString) {
CFX_WideString empty_str;
EXPECT_TRUE(empty_str.IsEmpty());