summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfview_embeddertest.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/fpdfview_embeddertest.cpp')
-rw-r--r--fpdfsdk/fpdfview_embeddertest.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/fpdfsdk/fpdfview_embeddertest.cpp b/fpdfsdk/fpdfview_embeddertest.cpp
index 00075876f6..0e478b448f 100644
--- a/fpdfsdk/fpdfview_embeddertest.cpp
+++ b/fpdfsdk/fpdfview_embeddertest.cpp
@@ -30,6 +30,12 @@ TEST_F(FPDFViewEmbeddertest, Document) {
EXPECT_EQ(-1, FPDF_GetSecurityHandlerRevision(document()));
}
+TEST_F(FPDFViewEmbeddertest, LoadNonexistentDocument) {
+ FPDF_DOCUMENT doc = FPDF_LoadDocument("nonexistent_document.pdf", "");
+ ASSERT_FALSE(doc);
+ EXPECT_EQ(static_cast<int>(FPDF_GetLastError()), FPDF_ERR_FILE);
+}
+
// See bug 465.
TEST_F(FPDFViewEmbeddertest, EmptyDocument) {
EXPECT_TRUE(CreateEmptyDocument());