mirror of
https://github.com/qpdf/qpdf.git
synced 2024-12-22 10:58:58 +00:00
Add test for attempts to copy foreign /Pages object
This commit is contained in:
parent
0046de0852
commit
ca79fcb26e
@ -1 +1,2 @@
|
||||
WARNING: minimal.pdf (object 6 0, offset 556): Unexpected reference to /Pages object while copying foreign object. Replacing with Null object.
|
||||
test 25 done
|
||||
|
@ -954,6 +954,8 @@ test_25(QPDF& pdf, char const* arg2)
|
||||
// Copy qtest without crossing page boundaries. Should get O1
|
||||
// and O2 and their streams but not O3 or any other pages.
|
||||
|
||||
// Also verify that attempts to copy /Pages objects return null.
|
||||
|
||||
assert(arg2 != nullptr);
|
||||
{
|
||||
// Make sure original PDF is out of scope when we write.
|
||||
@ -961,6 +963,8 @@ test_25(QPDF& pdf, char const* arg2)
|
||||
oldpdf.processFile(arg2);
|
||||
QPDFObjectHandle qtest = oldpdf.getTrailer().getKey("/QTest");
|
||||
pdf.getTrailer().replaceKey("/QTest", pdf.copyForeignObject(qtest));
|
||||
|
||||
assert(pdf.copyForeignObject(oldpdf.getRoot().getKey("/Pages")).isNull());
|
||||
}
|
||||
|
||||
QPDFWriter w(pdf, "a.pdf");
|
||||
|
Loading…
Reference in New Issue
Block a user