diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-11-25 15:37:53 -0800 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-11-25 15:37:53 -0800 |
commit | c3e4ae5fe5067723b58a2029a95c6411c92bed15 (patch) | |
tree | 1544bf8fa786c92a009efc8974886027403c676e /fpdfsdk/src/fpdfview_embeddertest.cpp | |
parent | 3caa6537663e85ad6874c4420907d2ab885c80ea (diff) | |
download | pdfium-c3e4ae5fe5067723b58a2029a95c6411c92bed15.tar.xz |
Merge to master: Take Jun's UTF16LE patches.
(cherry picked from commit 8d89e65897d8b6cf7899e7a82d9d381c3ad327cb)
(cherry picked from commit c70b19aad245fb1ed39bf8c264d991555f4c5a58)
BUG=pdfium:275
TBR=jun_fang@foxitsoftware.com
Review URL: https://codereview.chromium.org/1473753004 .
Diffstat (limited to 'fpdfsdk/src/fpdfview_embeddertest.cpp')
-rw-r--r-- | fpdfsdk/src/fpdfview_embeddertest.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/fpdfsdk/src/fpdfview_embeddertest.cpp b/fpdfsdk/src/fpdfview_embeddertest.cpp index 35da9b6caf..2606dc7a0e 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(12u, buffer_size); + EXPECT_EQ(10u, buffer_size); // Try to retrieve the first item with too small a buffer. - buffer_size = 10; + buffer_size = 8; 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(12u, buffer_size); - EXPECT_EQ(std::string("F\0i\0r\0s\0t\0\0\0", 12), + EXPECT_EQ(10u, buffer_size); + EXPECT_EQ(std::string("F\0i\0r\0s\0t\0", 10), 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(10u, buffer_size); - EXPECT_EQ(std::string("N\0e\0x\0t\0\0\0", 10), + EXPECT_EQ(8u, buffer_size); + EXPECT_EQ(std::string("N\0e\0x\0t\0", 8), 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(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), + 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), 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(28u, buffer_size); - EXPECT_EQ(std::string("L\0a\0s\0t\0A\0l\0t\0e\0r\0n\0a\0t\0e\0\0\0", 28), + EXPECT_EQ(26u, buffer_size); + EXPECT_EQ(std::string("L\0a\0s\0t\0A\0l\0t\0e\0r\0n\0a\0t\0e\0", 26), std::string(fixed_buffer, buffer_size)); // Try to retrieve non-existent item with ample buffer. |