aboutsummaryrefslogtreecommitdiffstats
path: root/qpdf/test_driver.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2018-12-31 23:12:38 +0100
committerJay Berkenbilt <ejb@ql.org>2019-01-01 14:12:56 +0100
commit95d6b17a8904b110c3625e66538368c433f48042 (patch)
treed5d845a2319885d26ed8baaf094adc98f38af765 /qpdf/test_driver.cc
parent104fd6da522c8828571580cb30f324c3cbe7283f (diff)
downloadqpdf-95d6b17a8904b110c3625e66538368c433f48042.tar.zst
Add QPDFObjectHandle::mergeDictionary()
Diffstat (limited to 'qpdf/test_driver.cc')
-rw-r--r--qpdf/test_driver.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/qpdf/test_driver.cc b/qpdf/test_driver.cc
index eae25a5c..8fb645f9 100644
--- a/qpdf/test_driver.cc
+++ b/qpdf/test_driver.cc
@@ -1754,6 +1754,17 @@ void runtest(int n, char const* filename1, char const* arg2)
}
}
}
+ else if (n == 50)
+ {
+ // Test dictionary merge. This test is crafted to work with
+ // merge-dict.pdf
+ QPDFObjectHandle d1 = pdf.getTrailer().getKey("/Dict1");
+ QPDFObjectHandle d2 = pdf.getTrailer().getKey("/Dict2");
+ d1.mergeDictionary(d2);
+ std::cout << d1.getJSON().unparse() << std::endl;
+ // Top-level type mismatch
+ d1.mergeDictionary(d2.getKey("/k1"));
+ }
else
{
throw std::runtime_error(std::string("invalid test ") +