aboutsummaryrefslogtreecommitdiffstats
path: root/qpdf/test_driver.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2022-06-25 19:55:45 +0200
committerJay Berkenbilt <ejb@ql.org>2022-06-25 19:55:45 +0200
commit0c7c7e4ba485fd39f5b6d41fa2924c607d2eeda0 (patch)
tree2aff155bc6bac1e5a748262203a18c45096020c7 /qpdf/test_driver.cc
parent25aff0bd52b0382b9349c81aaabc2fde51528923 (diff)
downloadqpdf-0c7c7e4ba485fd39f5b6d41fa2924c607d2eeda0.tar.zst
Track whether certain page modifying methods have been called
We need to know whether pushInheritedAttributesToPage or getAllPages have been called when generating JSON output. When reading the JSON back in, we have to call the same methods so that object numbers will line up properly.
Diffstat (limited to 'qpdf/test_driver.cc')
-rw-r--r--qpdf/test_driver.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/qpdf/test_driver.cc b/qpdf/test_driver.cc
index 2384ddef..0eb6ed8d 100644
--- a/qpdf/test_driver.cc
+++ b/qpdf/test_driver.cc
@@ -691,7 +691,9 @@ test_15(QPDF& pdf, char const* arg2)
// Remove pages from various places, checking to make sure
// that our pages reference is getting updated.
assert(pages.size() == 10);
+ assert(!pdf.everPushedInheritedAttributesToPages());
pdf.removePage(pages.back()); // original page 9
+ assert(pdf.everPushedInheritedAttributesToPages());
assert(pages.size() == 9);
pdf.removePage(*pages.begin()); // original page 0
assert(pages.size() == 8);
@@ -767,7 +769,9 @@ static void
test_16(QPDF& pdf, char const* arg2)
{
// Insert a page manually and then update the cache.
+ assert(!pdf.everCalledGetAllPages());
std::vector<QPDFObjectHandle> const& all_pages = pdf.getAllPages();
+ assert(pdf.everCalledGetAllPages());
QPDFObjectHandle contents = createPageContents(pdf, "New page 10");
QPDFObjectHandle page =
@@ -785,6 +789,7 @@ test_16(QPDF& pdf, char const* arg2)
kids.appendItem(page);
assert(all_pages.size() == 10);
pdf.updateAllPagesCache();
+ assert(pdf.everCalledGetAllPages());
assert(all_pages.size() == 11);
assert(all_pages.back().getObjGen() == page.getObjGen());