summaryrefslogtreecommitdiff
path: root/xfa/fde/cfde_txtedtbuf_unittest.cpp
diff options
context:
space:
mode:
authorJane Liu <janeliulwq@google.com>2017-08-21 10:26:25 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-08-21 15:18:36 +0000
commit3fa212abba3b6977a4e47981116bb0a3f4017221 (patch)
treebcf288f01955521b52d9806f510ea9a4d14bd6b2 /xfa/fde/cfde_txtedtbuf_unittest.cpp
parent69ad278881f83a1f8cf45d5a42a88752c0871c7e (diff)
downloadpdfium-3fa212abba3b6977a4e47981116bb0a3f4017221.tar.xz
Converted CFDE_TxtEdt{Buf|Engine}::Insert() to take CFX_WideString
Converted CFDE_TxtEdtBuf::Insert(), CFDE_TxtEdtEngine::Insert(), and CFDE_TxtEdtEngine::Inner_Insert() to take in CFX_WideString instead of a wchar_t* and length. Bug=pdfium:757 Change-Id: I6097e9b0d4e584b920b2117b4c5489eedef37767 Reviewed-on: https://pdfium-review.googlesource.com/11411 Commit-Queue: Jane Liu <janeliulwq@google.com> Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fde/cfde_txtedtbuf_unittest.cpp')
-rw-r--r--xfa/fde/cfde_txtedtbuf_unittest.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/xfa/fde/cfde_txtedtbuf_unittest.cpp b/xfa/fde/cfde_txtedtbuf_unittest.cpp
index 020175aa57..74bc4f95b7 100644
--- a/xfa/fde/cfde_txtedtbuf_unittest.cpp
+++ b/xfa/fde/cfde_txtedtbuf_unittest.cpp
@@ -34,7 +34,7 @@ TEST_F(CFDE_TxtEdtBufTest, InsertAppendChunk) {
buf_->SetText(L"Hi");
CFX_WideString end = L" World";
- buf_->Insert(2, end.c_str(), end.GetLength());
+ buf_->Insert(2, end);
EXPECT_EQ(3UL, ChunkCount());
EXPECT_EQ(8, buf_->GetTextLength());
@@ -47,7 +47,7 @@ TEST_F(CFDE_TxtEdtBufTest, InsertPrependChunk) {
buf_->SetText(L"Hi");
CFX_WideString end = L"World ";
- buf_->Insert(0, end.c_str(), end.GetLength());
+ buf_->Insert(0, end);
EXPECT_EQ(3UL, ChunkCount());
EXPECT_EQ(8, buf_->GetTextLength());
@@ -61,7 +61,7 @@ TEST_F(CFDE_TxtEdtBufTest, InsertBetweenChunks) {
EXPECT_EQ(3UL, ChunkCount());
CFX_WideString inst = L"there ";
- buf_->Insert(6, inst.c_str(), inst.GetLength());
+ buf_->Insert(6, inst);
EXPECT_EQ(5UL, ChunkCount());
EXPECT_EQ(17, buf_->GetTextLength());
@@ -170,9 +170,8 @@ TEST_F(CFDE_TxtEdtBufTestDeathTest, InsertBadIndexes) {
CFX_WideString inst = L"there ";
buf_->SetText(L"Hi");
- EXPECT_DEATH(buf_->Insert(-4, inst.c_str(), inst.GetLength()), "Assertion");
- EXPECT_DEATH(buf_->Insert(9999, inst.c_str(), inst.GetLength()), "Assertion");
- EXPECT_DEATH(buf_->Insert(1, inst.c_str(), -6), "Assertion");
+ EXPECT_DEATH(buf_->Insert(-4, inst), "Assertion");
+ EXPECT_DEATH(buf_->Insert(9999, inst), "Assertion");
}
TEST_F(CFDE_TxtEdtBufTestDeathTest, DeleteWithBadIdx) {