diff options
-rw-r--r-- | DEPS | 2 | ||||
-rw-r--r-- | core/fxcrt/cfx_bytestring_unittest.cpp | 30 | ||||
-rw-r--r-- | core/fxcrt/cfx_widestring_unittest.cpp | 26 | ||||
-rw-r--r-- | xfa/fxfa/parser/cxfa_widgetdata.cpp | 2 |
4 files changed, 4 insertions, 56 deletions
@@ -5,7 +5,7 @@ vars = { 'pdfium_git': 'https://pdfium.googlesource.com', 'android_ndk_revision': '26d93ec07f3ce2ec2cdfeae1b21ee6f12ff868d8', - 'build_revision': 'bee933aa41e29016998f5fbdd05cc2ce457e28c5', + 'build_revision': 'a049c43089b67a96c57b69dafc91a9a640b6bd70', 'buildtools_revision': 'f90f6a5af3e8cf843395bfe6243cf606f71b5344', 'catapult_revision': '86352b966b0245d6883e5f7df27687856978b6d7', 'clang_revision': 'a1420b85586c1fa3eaf68808bbb095334d2d271d', diff --git a/core/fxcrt/cfx_bytestring_unittest.cpp b/core/fxcrt/cfx_bytestring_unittest.cpp index 415b4621a1..dcb8577b65 100644 --- a/core/fxcrt/cfx_bytestring_unittest.cpp +++ b/core/fxcrt/cfx_bytestring_unittest.cpp @@ -13,9 +13,6 @@ TEST(fxcrt, ByteStringElementAccess) { const CFX_ByteString abc("abc"); -#ifndef NDEBUG - EXPECT_DEATH({ abc[-1]; }, ".*"); -#endif EXPECT_EQ('a', abc[0]); EXPECT_EQ('b', abc[1]); EXPECT_EQ('c', abc[2]); @@ -29,11 +26,8 @@ TEST(fxcrt, ByteStringElementAccess) { EXPECT_EQ('b', mutable_abc[1]); EXPECT_EQ('c', mutable_abc[2]); EXPECT_EQ(abc.c_str(), mutable_abc.c_str()); - -#ifndef NDEBUG - EXPECT_DEATH({ mutable_abc.SetAt(-1, 'd'); }, ".*"); EXPECT_EQ("abc", abc); -#endif + const char* c_str = abc.c_str(); mutable_abc.SetAt(0, 'd'); EXPECT_EQ(c_str, abc.c_str()); @@ -414,8 +408,6 @@ TEST(fxcrt, ByteStringReplace) { TEST(fxcrt, ByteStringInsert) { CFX_ByteString fred("FRED"); - EXPECT_EQ(4u, fred.Insert(-1, 'X')); - EXPECT_EQ("FRED", fred); EXPECT_EQ(5u, fred.Insert(0, 'S')); EXPECT_EQ("SFRED", fred); EXPECT_EQ(6u, fred.Insert(1, 'T')); @@ -428,11 +420,6 @@ TEST(fxcrt, ByteStringInsert) { EXPECT_EQ("STFRUEDV", fred); { CFX_ByteString empty; - EXPECT_EQ(0u, empty.Insert(-1, 'X')); - EXPECT_NE("X", empty); - } - { - CFX_ByteString empty; EXPECT_EQ(1u, empty.Insert(0, 'X')); EXPECT_EQ("X", empty); } @@ -487,8 +474,6 @@ TEST(fxcrt, ByteStringDelete) { EXPECT_EQ("ED", fred); EXPECT_EQ(1u, fred.Delete(1)); EXPECT_EQ("E", fred); - EXPECT_EQ(1u, fred.Delete(-1)); - EXPECT_EQ("E", fred); EXPECT_EQ(0u, fred.Delete(0)); EXPECT_EQ("", fred); EXPECT_EQ(0u, fred.Delete(0)); @@ -497,8 +482,6 @@ TEST(fxcrt, ByteStringDelete) { CFX_ByteString empty; EXPECT_EQ(0u, empty.Delete(0)); EXPECT_EQ("", empty); - EXPECT_EQ(0u, empty.Delete(-1)); - EXPECT_EQ("", empty); EXPECT_EQ(0u, empty.Delete(1)); EXPECT_EQ("", empty); } @@ -519,7 +502,6 @@ TEST(fxcrt, ByteStringMid) { EXPECT_EQ("FRED", fred.Mid(0, 4)); EXPECT_EQ("", fred.Mid(0, 10)); - EXPECT_EQ("", fred.Mid(-1, 2)); EXPECT_EQ("RED", fred.Mid(1, 3)); EXPECT_EQ("", fred.Mid(4, 1)); @@ -536,12 +518,10 @@ TEST(fxcrt, ByteStringLeft) { EXPECT_EQ("FRED", fred.Left(4)); EXPECT_EQ("", fred.Left(5)); - EXPECT_EQ("", fred.Left(-1)); CFX_ByteString empty; EXPECT_EQ("", empty.Left(0)); EXPECT_EQ("", empty.Left(1)); - EXPECT_EQ("", empty.Left(-1)); } TEST(fxcrt, ByteStringRight) { @@ -553,12 +533,10 @@ TEST(fxcrt, ByteStringRight) { EXPECT_EQ("FRED", fred.Right(4)); EXPECT_EQ("", fred.Right(5)); - EXPECT_EQ("", fred.Right(-1)); CFX_ByteString empty; EXPECT_EQ("", empty.Right(0)); EXPECT_EQ("", empty.Right(1)); - EXPECT_EQ("", empty.Right(-1)); } TEST(fxcrt, ByteStringFind) { @@ -1009,12 +987,9 @@ TEST(fxcrt, ByteStringCMid) { CFX_ByteStringC longer_string("abcdef"); EXPECT_EQ(longer_string, longer_string.Mid(0, 6)); EXPECT_EQ("", longer_string.Mid(0, 187)); - EXPECT_EQ("", longer_string.Mid(-42, 6)); - EXPECT_EQ("", longer_string.Mid(-42, 187)); CFX_ByteStringC leading_substring("ab"); EXPECT_EQ(leading_substring, longer_string.Mid(0, 2)); - EXPECT_EQ("", longer_string.Mid(-1, 2)); CFX_ByteStringC middle_substring("bcde"); EXPECT_EQ(middle_substring, longer_string.Mid(1, 4)); @@ -1027,9 +1002,6 @@ TEST(fxcrt, ByteStringCMid) { TEST(fxcrt, ByteStringCElementAccess) { // CFX_ByteStringC includes the NUL terminator for non-empty strings. CFX_ByteStringC abc("abc"); -#ifndef NDEBUG - EXPECT_DEATH({ abc[-1]; }, ".*"); -#endif EXPECT_EQ('a', static_cast<char>(abc[0])); EXPECT_EQ('b', static_cast<char>(abc[1])); EXPECT_EQ('c', static_cast<char>(abc[2])); diff --git a/core/fxcrt/cfx_widestring_unittest.cpp b/core/fxcrt/cfx_widestring_unittest.cpp index 1408d10f15..7b12d50601 100644 --- a/core/fxcrt/cfx_widestring_unittest.cpp +++ b/core/fxcrt/cfx_widestring_unittest.cpp @@ -12,9 +12,6 @@ TEST(fxcrt, WideStringElementAccess) { const CFX_WideString abc(L"abc"); -#ifndef NDEBUG - EXPECT_DEATH({ abc[-1]; }, ".*"); -#endif EXPECT_EQ(L'a', abc[0]); EXPECT_EQ(L'b', abc[1]); EXPECT_EQ(L'c', abc[2]); @@ -28,10 +25,8 @@ TEST(fxcrt, WideStringElementAccess) { EXPECT_EQ(L'b', mutable_abc[1]); EXPECT_EQ(L'c', mutable_abc[2]); EXPECT_EQ(abc.c_str(), mutable_abc.c_str()); -#ifndef NDEBUG - EXPECT_DEATH({ mutable_abc.SetAt(-1, L'd'); }, ".*"); EXPECT_EQ(L"abc", abc); -#endif + const wchar_t* c_str = abc.c_str(); mutable_abc.SetAt(0, L'd'); EXPECT_EQ(c_str, abc.c_str()); @@ -373,8 +368,6 @@ TEST(fxcrt, WideStringReplace) { TEST(fxcrt, WideStringInsert) { CFX_WideString fred(L"FRED"); - EXPECT_EQ(4u, fred.Insert(-1, 'X')); - EXPECT_EQ(L"FRED", fred); EXPECT_EQ(5u, fred.Insert(0, 'S')); EXPECT_EQ(L"SFRED", fred); EXPECT_EQ(6u, fred.Insert(1, 'T')); @@ -387,11 +380,6 @@ TEST(fxcrt, WideStringInsert) { EXPECT_EQ(L"STFRUEDV", fred); { CFX_WideString empty; - EXPECT_EQ(0u, empty.Insert(-1, 'X')); - EXPECT_NE(L"X", empty); - } - { - CFX_WideString empty; EXPECT_EQ(1u, empty.Insert(0, 'X')); EXPECT_EQ(L"X", empty); } @@ -446,8 +434,6 @@ TEST(fxcrt, WideStringDelete) { EXPECT_EQ(L"ED", fred); EXPECT_EQ(1u, fred.Delete(1)); EXPECT_EQ(L"E", fred); - EXPECT_EQ(1u, fred.Delete(-1)); - EXPECT_EQ(L"E", fred); EXPECT_EQ(0u, fred.Delete(0)); EXPECT_EQ(L"", fred); EXPECT_EQ(0u, fred.Delete(0)); @@ -456,8 +442,6 @@ TEST(fxcrt, WideStringDelete) { CFX_WideString empty; EXPECT_EQ(0u, empty.Delete(0)); EXPECT_EQ(L"", empty); - EXPECT_EQ(0u, empty.Delete(-1)); - EXPECT_EQ(L"", empty); EXPECT_EQ(0u, empty.Delete(1)); EXPECT_EQ(L"", empty); } @@ -478,7 +462,6 @@ TEST(fxcrt, WideStringMid) { EXPECT_EQ(L"FRED", fred.Mid(0, 4)); EXPECT_EQ(L"", fred.Mid(0, 10)); - EXPECT_EQ(L"", fred.Mid(-1, 2)); EXPECT_EQ(L"", fred.Mid(1, 4)); EXPECT_EQ(L"", fred.Mid(4, 1)); @@ -495,12 +478,10 @@ TEST(fxcrt, WideStringLeft) { EXPECT_EQ(L"FRED", fred.Left(4)); EXPECT_EQ(L"", fred.Left(5)); - EXPECT_EQ(L"", fred.Left(-1)); CFX_WideString empty; EXPECT_EQ(L"", empty.Left(0)); EXPECT_EQ(L"", empty.Left(1)); - EXPECT_EQ(L"", empty.Left(-1)); } TEST(fxcrt, WideStringRight) { @@ -512,12 +493,10 @@ TEST(fxcrt, WideStringRight) { EXPECT_EQ(L"FRED", fred.Right(4)); EXPECT_EQ(L"", fred.Right(5)); - EXPECT_EQ(L"", fred.Right(-1)); CFX_WideString empty; EXPECT_EQ(L"", empty.Right(0)); EXPECT_EQ(L"", empty.Right(1)); - EXPECT_EQ(L"", empty.Right(-1)); } TEST(fxcrt, WideStringFind) { @@ -818,9 +797,6 @@ TEST(fxcrt, WideStringCFromVector) { TEST(fxcrt, WideStringCElementAccess) { CFX_WideStringC abc(L"abc"); -#ifndef NDEBUG - EXPECT_DEATH({ abc[-1]; }, ".*"); -#endif EXPECT_EQ(L'a', static_cast<wchar_t>(abc[0])); EXPECT_EQ(L'b', static_cast<wchar_t>(abc[1])); EXPECT_EQ(L'c', static_cast<wchar_t>(abc[2])); diff --git a/xfa/fxfa/parser/cxfa_widgetdata.cpp b/xfa/fxfa/parser/cxfa_widgetdata.cpp index fd1b2ff9bc..80981d97d6 100644 --- a/xfa/fxfa/parser/cxfa_widgetdata.cpp +++ b/xfa/fxfa/parser/cxfa_widgetdata.cpp @@ -1772,7 +1772,7 @@ void CXFA_WidgetData::FormatNumStr(const CFX_WideString& wsValue, dot_index = !dot_index.has_value() ? len : dot_index; if (dot_index.value() >= 1) { - int nPos = dot_index.value() % 3; + FX_STRSIZE nPos = dot_index.value() % 3; wsOutput.clear(); for (FX_STRSIZE i = 0; i < dot_index.value(); i++) { if (i % 3 == nPos && i != 0) |