Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Unified Diff: core/src/fpdfapi/fpdf_parser/fpdf_parser_parser_unittest.cpp

Issue 1486383002: Merge to XFA: Add basic checking for RebuildCrossRef (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: core/src/fpdfapi/fpdf_parser/fpdf_parser_parser_unittest.cpp
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser_unittest.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser_unittest.cpp
index 8e953a6ee37986e41b83620f6f5b1d466ac3941d..640feac9aad497af4875e3a95d77d7ae4df68b42 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser_unittest.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser_unittest.cpp
@@ -26,6 +26,7 @@ class CPDF_TestParser : public CPDF_Parser {
// Add test case as private friend so that RebuildCrossRef in CPDF_Parser
// can be accessed.
FRIEND_TEST(fpdf_parser_parser, RebuildCrossRefCorrectly);
+ FRIEND_TEST(fpdf_parser_parser, RebuildCrossRefFailed);
};
// TODO(thestig) Using unique_ptr with ReleaseDeleter is still not ideal.
@@ -211,3 +212,13 @@ TEST(fpdf_parser_parser, RebuildCrossRefCorrectly) {
EXPECT_EQ(versions[i], parser.m_ObjVersion.GetAt(i));
}
}
+
+TEST(fpdf_parser_parser, RebuildCrossRefFailed) {
+ CPDF_TestParser parser;
+ std::string test_file;
+ ASSERT_TRUE(PathService::GetTestFilePath(
+ "parser_rebuildxref_error_notrailer.pdf", &test_file));
+ ASSERT_TRUE(parser.InitTest(test_file.c_str())) << test_file;
+
+ ASSERT_FALSE(parser.RebuildCrossRef());
+}
« no previous file with comments | « core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp ('k') | testing/resources/parser_rebuildxref_error_notrailer.pdf » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698