From 8c5e924ad1f048749e2a73fe444ea07bd99abb16 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Mon, 3 Apr 2017 12:02:02 -0700 Subject: 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 Commit-Queue: Tom Sepez --- core/fxcrt/cfx_widestring_unittest.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'core/fxcrt') 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()); -- cgit v1.2.3