Commit f6367bbada59a150171b7e89f73e4a042ac4d49a

Authored by Jay Berkenbilt
1 parent 5489f1d8

Dangling ref test: show new object ID

qpdf/qtest/qpdf/dangling-refs-dangling.out
  1 +new object: 11 0 R
1 2 all objects
2 3 1 0 R
3 4 2 0 R
... ...
qpdf/qtest/qpdf/minimal-dangling.out
  1 +new object: 7 0 R
1 2 all objects
2 3 1 0 R
3 4 2 0 R
... ...
qpdf/test_driver.cc
... ... @@ -2062,8 +2062,10 @@ test_53(QPDF& pdf, char const* arg2)
2062 2062 {
2063 2063 // Test get all objects and dangling ref handling
2064 2064 QPDFObjectHandle root = pdf.getRoot();
2065   - root.replaceKey(
2066   - "/Q1", pdf.makeIndirectObject(QPDFObjectHandle::newString("potato")));
  2065 + auto new_obj =
  2066 + pdf.makeIndirectObject(QPDFObjectHandle::newString("potato"));
  2067 + root.replaceKey("/Q1", new_obj);
  2068 + std::cout << "new object: " << new_obj.unparse() << std::endl;
2067 2069 std::cout << "all objects" << std::endl;
2068 2070 for (auto& obj: pdf.getAllObjects()) {
2069 2071 std::cout << obj.unparse() << std::endl;
... ...