diff options
author | Jay Berkenbilt <ejb@ql.org> | 2009-09-27 20:28:51 +0200 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2009-09-27 20:28:51 +0200 |
commit | 40f4b1ef5237a51b38b74b04d53d6aa20819b5d7 (patch) | |
tree | aa91f7a3cbe9a3cba1b28ffc1d381dd94deacce4 /qpdf/qpdf-ctest.c | |
parent | 65bf77fa3537724b646880d7dacd34f4e4c8b67e (diff) | |
download | qpdf-40f4b1ef5237a51b38b74b04d53d6aa20819b5d7.tar.zst |
more tests of C API
git-svn-id: svn+q:///qpdf/trunk@732 71b93d88-0707-0410-a8cf-f5a4172ac649
Diffstat (limited to 'qpdf/qpdf-ctest.c')
-rw-r--r-- | qpdf/qpdf-ctest.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/qpdf/qpdf-ctest.c b/qpdf/qpdf-ctest.c index d491b2a5..6a4bc2a9 100644 --- a/qpdf/qpdf-ctest.c +++ b/qpdf/qpdf-ctest.c @@ -38,8 +38,8 @@ static void test02(char const* infile, char const* outfile) { qpdf_set_suppress_warnings(qpdf, QPDF_TRUE); - qpdf_read(qpdf, infile, password); - if (qpdf_init_write(qpdf, outfile) == QPDF_SUCCESS) + if (((qpdf_read(qpdf, infile, password) & QPDF_ERRORS) == 0) && + ((qpdf_init_write(qpdf, outfile) & QPDF_ERRORS) == 0)) { qpdf_set_static_ID(qpdf, QPDF_TRUE); qpdf_write(qpdf); @@ -132,6 +132,15 @@ static void test09(char const* infile, report_errors(); } +static void test10(char const* infile, + char const* password, + char const* outfile) +{ + qpdf_set_attempt_recovery(qpdf, QPDF_FALSE); + qpdf_read(qpdf, infile, password); + report_errors(); +} + int main(int argc, char* argv[]) { char* whoami = 0; @@ -174,6 +183,7 @@ int main(int argc, char* argv[]) (n == 7) ? test07 : (n == 8) ? test08 : (n == 9) ? test09 : + (n == 10) ? test10 : 0); if (fn == 0) |