summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/fpdfview_embeddertest.cpp
diff options
context:
space:
mode:
authorOliver Chang <ochang@chromium.org>2015-12-09 12:44:33 -0800
committerOliver Chang <ochang@chromium.org>2015-12-09 12:44:33 -0800
commit35e68a5275f2d1e6819c773f0f367e225a0d5961 (patch)
treeb20af57f5be5d7ef5d8be2ebf44e92ad94ab88a9 /fpdfsdk/src/fpdfview_embeddertest.cpp
parentdf685030b73074e46d7eb789e13135c52775091f (diff)
downloadpdfium-35e68a5275f2d1e6819c773f0f367e225a0d5961.tar.xz
XFA: Revert UTF16LE_Encode changes
Revert "Fix embedder test failures introduced by commit c70b19aad245" This reverts commit 8d89e65897d8b6cf7899e7a82d9d381c3ad327cb. Revert "Fix invalid buffer length set in CFX_WideString::UTF16LE_Encode()" This reverts commit c70b19aad245fb1ed39bf8c264d991555f4c5a58. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1516643002 .
Diffstat (limited to 'fpdfsdk/src/fpdfview_embeddertest.cpp')
-rw-r--r--fpdfsdk/src/fpdfview_embeddertest.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/fpdfsdk/src/fpdfview_embeddertest.cpp b/fpdfsdk/src/fpdfview_embeddertest.cpp
index 2606dc7a0e..35da9b6caf 100644
--- a/fpdfsdk/src/fpdfview_embeddertest.cpp
+++ b/fpdfsdk/src/fpdfview_embeddertest.cpp
@@ -56,10 +56,10 @@ TEST_F(FPDFViewEmbeddertest, NamedDests) {
buffer_size = 2000000; // Absurdly large, check not used for this case.
dest = FPDF_GetNamedDest(document(), 0, nullptr, &buffer_size);
EXPECT_NE(nullptr, dest);
- EXPECT_EQ(10u, buffer_size);
+ EXPECT_EQ(12u, buffer_size);
// Try to retrieve the first item with too small a buffer.
- buffer_size = 8;
+ buffer_size = 10;
dest = FPDF_GetNamedDest(document(), 0, fixed_buffer, &buffer_size);
EXPECT_NE(nullptr, dest);
EXPECT_EQ(-1, buffer_size);
@@ -69,8 +69,8 @@ TEST_F(FPDFViewEmbeddertest, NamedDests) {
buffer_size = 12;
dest = FPDF_GetNamedDest(document(), 0, fixed_buffer, &buffer_size);
EXPECT_NE(nullptr, dest);
- EXPECT_EQ(10u, buffer_size);
- EXPECT_EQ(std::string("F\0i\0r\0s\0t\0", 10),
+ EXPECT_EQ(12u, buffer_size);
+ EXPECT_EQ(std::string("F\0i\0r\0s\0t\0\0\0", 12),
std::string(fixed_buffer, buffer_size));
// Try to retrieve the second item with ample buffer. Item is taken
@@ -78,8 +78,8 @@ TEST_F(FPDFViewEmbeddertest, NamedDests) {
buffer_size = sizeof(fixed_buffer);
dest = FPDF_GetNamedDest(document(), 1, fixed_buffer, &buffer_size);
EXPECT_NE(nullptr, dest);
- EXPECT_EQ(8u, buffer_size);
- EXPECT_EQ(std::string("N\0e\0x\0t\0", 8),
+ EXPECT_EQ(10u, buffer_size);
+ EXPECT_EQ(std::string("N\0e\0x\0t\0\0\0", 10),
std::string(fixed_buffer, buffer_size));
// Try to retrieve third item with ample buffer. Item is taken
@@ -102,8 +102,8 @@ TEST_F(FPDFViewEmbeddertest, NamedDests) {
buffer_size = sizeof(fixed_buffer);
dest = FPDF_GetNamedDest(document(), 4, fixed_buffer, &buffer_size);
EXPECT_NE(nullptr, dest);
- EXPECT_EQ(28u, buffer_size);
- EXPECT_EQ(std::string("F\0i\0r\0s\0t\0A\0l\0t\0e\0r\0n\0a\0t\0e\0", 28),
+ EXPECT_EQ(30u, buffer_size);
+ EXPECT_EQ(std::string("F\0i\0r\0s\0t\0A\0l\0t\0e\0r\0n\0a\0t\0e\0\0\0", 30),
std::string(fixed_buffer, buffer_size));
// Try to retrieve sixth item with ample buffer. Item istaken from the
@@ -112,8 +112,8 @@ TEST_F(FPDFViewEmbeddertest, NamedDests) {
buffer_size = sizeof(fixed_buffer);
dest = FPDF_GetNamedDest(document(), 5, fixed_buffer, &buffer_size);
EXPECT_NE(nullptr, dest);
- EXPECT_EQ(26u, buffer_size);
- EXPECT_EQ(std::string("L\0a\0s\0t\0A\0l\0t\0e\0r\0n\0a\0t\0e\0", 26),
+ EXPECT_EQ(28u, buffer_size);
+ EXPECT_EQ(std::string("L\0a\0s\0t\0A\0l\0t\0e\0r\0n\0a\0t\0e\0\0\0", 28),
std::string(fixed_buffer, buffer_size));
// Try to retrieve non-existent item with ample buffer.