aboutsummaryrefslogtreecommitdiffstats
path: root/qpdf/qpdf-ctest.c
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2021-12-02 14:04:59 +0100
committerJay Berkenbilt <ejb@ql.org>2021-12-09 16:33:31 +0100
commite3cc171d0210cc3230754d50285233ccb8759081 (patch)
tree4e771ed6045d69e0826c5fa4ca5c87f6a63f4286 /qpdf/qpdf-ctest.c
parentbef2c2222a0b9429276b34d8f5024f31b8e86495 (diff)
downloadqpdf-e3cc171d0210cc3230754d50285233ccb8759081.tar.zst
C API: qpdf_oh_is_initialized
Diffstat (limited to 'qpdf/qpdf-ctest.c')
-rw-r--r--qpdf/qpdf-ctest.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/qpdf/qpdf-ctest.c b/qpdf/qpdf-ctest.c
index a57ea44f..c5d6d199 100644
--- a/qpdf/qpdf-ctest.c
+++ b/qpdf/qpdf-ctest.c
@@ -512,6 +512,7 @@ static void test24(char const* infile,
qpdf_oh_get_object_id(qpdf, root_from_trailer));
qpdf_oh pages = qpdf_oh_get_key(qpdf, root, "/Pages");
assert(qpdf_oh_is_dictionary(qpdf, pages));
+ assert(qpdf_oh_is_initialized(qpdf, pages));
qpdf_oh kids = qpdf_oh_get_key(qpdf, pages, "/Kids");
assert(qpdf_oh_is_array(qpdf, kids));
assert(qpdf_oh_get_array_n_items(qpdf, kids) == 1);
@@ -687,6 +688,12 @@ static void test24(char const* infile,
qpdf_set_suppress_original_object_IDs(qpdf, QPDF_TRUE);
qpdf_write(qpdf);
report_errors();
+
+ /* Make sure we detect uninitialized objects */
+ qpdf_data qpdf2 = qpdf_init();
+ trailer = qpdf_get_trailer(qpdf2);
+ assert(! qpdf_oh_is_initialized(qpdf2, trailer));
+ qpdf_cleanup(&qpdf2);
}
int main(int argc, char* argv[])