aboutsummaryrefslogtreecommitdiffstats
path: root/qpdf/test_driver.cc
diff options
context:
space:
mode:
Diffstat (limited to 'qpdf/test_driver.cc')
-rw-r--r--qpdf/test_driver.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/qpdf/test_driver.cc b/qpdf/test_driver.cc
index 9a21b82c..1d995bb7 100644
--- a/qpdf/test_driver.cc
+++ b/qpdf/test_driver.cc
@@ -1274,6 +1274,18 @@ void runtest(int n, char const* filename1, char const* arg2)
{
std::cout << "logic error: " << e.what() << std::endl;
}
+
+ // Detect adding a foreign object
+ auto root1 = pdf.getRoot();
+ auto root2 = other.getRoot();
+ try
+ {
+ root1.replaceKey("/Oops", root2);
+ }
+ catch (std::logic_error const& e)
+ {
+ std::cout << "logic error: " << e.what() << std::endl;
+ }
}
else if (n == 30)
{