aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorm-holger <m-holger@kubitscheck.org>2024-02-20 14:02:16 +0100
committerm-holger <m-holger@kubitscheck.org>2024-02-20 14:02:16 +0100
commit36ee4ecc6ee15520ef792d52f48ae7dcb7d37c30 (patch)
treef2514db5ab81723f9e1022bf5c91275f470b9eb2
parenta047d5497e9029a71783997397118e5f03f90037 (diff)
downloadqpdf-36ee4ecc6ee15520ef792d52f48ae7dcb7d37c30.tar.zst
Add test for QPDFObjectHandle::isDirectNull
-rw-r--r--qpdf/test_driver.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/qpdf/test_driver.cc b/qpdf/test_driver.cc
index 45b8adf0..f863440d 100644
--- a/qpdf/test_driver.cc
+++ b/qpdf/test_driver.cc
@@ -1191,6 +1191,7 @@ test_31(QPDF& pdf, char const* arg2)
std::cout << "trailing data: " << e.what() << std::endl;
}
assert(QPDFObjectHandle::parse(&pdf, "[5 0 R]").getArrayItem(0).isInteger());
+ assert(!QPDFObjectHandle::parse(&pdf, "[5 0 R]").getArrayItem(0).isDirectNull());
// Make sure an indirect integer followed by "0 R" is not
// mistakenly parsed as an indirect object.
assert(QPDFObjectHandle::parse(&pdf, "[5 0 R 0 R /X]").unparse() == "[ 5 0 R 0 (R) /X ]");
@@ -1202,6 +1203,8 @@ test_31(QPDF& pdf, char const* arg2)
assert(QPDFObjectHandle::parse(&pdf, ">>").unparse() == "null");
// TC:QPDFParser eof in parse
assert(QPDFObjectHandle::parse(&pdf, "[7 0 R]").getArrayItem(0).isNull());
+ assert(!QPDFObjectHandle::parse(&pdf, "[7 0 R]").getArrayItem(0).isDirectNull());
+ assert(QPDFObjectHandle::parse(&pdf, "null").isDirectNull());
// TC:QPDFParser invalid objgen
assert(
QPDFObjectHandle::parse(&pdf, "[0 0 R -1 0 R 1 65535 R 1 100000 R 1 -1 R]").unparse() ==