diff options
author | Jay Berkenbilt <ejb@ql.org> | 2021-11-19 19:33:10 +0100 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2021-11-19 19:33:10 +0100 |
commit | b97a43e0912f44c59a83e02b9c0ca60352e2466e (patch) | |
tree | 2b58efa29d4ddadca9111acdbff79816f7a9b7bb | |
parent | 4630b8567c853e0a05d41f15b701c370f660250f (diff) | |
download | qpdf-b97a43e0912f44c59a83e02b9c0ca60352e2466e.tar.zst |
Add additional testing around improved array wrapping
-rw-r--r-- | qpdf/qpdf-ctest.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/qpdf/qpdf-ctest.c b/qpdf/qpdf-ctest.c index c954a64d..9557d522 100644 --- a/qpdf/qpdf-ctest.c +++ b/qpdf/qpdf-ctest.c @@ -536,6 +536,9 @@ static void test24(char const* infile, for (int i = 0; i < 4; ++i) { qpdf_oh item = qpdf_oh_get_array_item(qpdf, mediabox, i); + qpdf_oh item2 = qpdf_oh_get_array_item(qpdf, wrapped_mediabox, i); + assert(qpdf_oh_get_int_value_as_int(qpdf, item) == + qpdf_oh_get_int_value_as_int(qpdf, item2)); printf("item %d: %d %.2f\n", i, qpdf_oh_get_int_value_as_int(qpdf, item), qpdf_oh_get_numeric_value(qpdf, item)); @@ -571,6 +574,12 @@ static void test24(char const* infile, assert(qpdf_oh_get_object_id( qpdf, qpdf_oh_get_array_item(qpdf, contents_array, 0)) == qpdf_oh_get_object_id(qpdf, contents)); + qpdf_oh wrapped_contents_array = + qpdf_oh_wrap_in_array(qpdf, contents_array); + assert(qpdf_oh_get_array_n_items(qpdf, wrapped_contents_array) == 1); + assert(qpdf_oh_get_object_id( + qpdf, qpdf_oh_get_array_item(qpdf, wrapped_contents_array, 0)) == + qpdf_oh_get_object_id(qpdf, contents)); qpdf_oh resources = qpdf_oh_get_key(qpdf, page1, "/Resources"); qpdf_oh procset = qpdf_oh_get_key(qpdf, resources, "/ProcSet"); assert(strcmp(qpdf_oh_unparse(qpdf, procset), |