summaryrefslogtreecommitdiffstats
path: root/qpdf/qtest
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2019-02-08 01:21:26 +0100
committerJay Berkenbilt <ejb@ql.org>2019-02-08 01:21:26 +0100
commitfc2e491f74ef151ac121fee2db00e33073255677 (patch)
tree2a9de3c482ed1a0f7fd63e6d4a42bf90055720ce /qpdf/qtest
parentae65cdcce2427f8fe106ecf4da53602210b68210 (diff)
downloadqpdf-fc2e491f74ef151ac121fee2db00e33073255677.tar.zst
Add test for exception handling
There have been issues reported where exceptions are not thrown properly across shared library/DLL boundaries, so add a test specifically to ensure that exceptions are caught as thrown.
Diffstat (limited to 'qpdf/qtest')
-rw-r--r--qpdf/qtest/qpdf.test10
-rw-r--r--qpdf/qtest/qpdf/exceptions.out5
2 files changed, 15 insertions, 0 deletions
diff --git a/qpdf/qtest/qpdf.test b/qpdf/qtest/qpdf.test
index af103201..b6b33977 100644
--- a/qpdf/qtest/qpdf.test
+++ b/qpdf/qtest/qpdf.test
@@ -180,6 +180,16 @@ $td->runtest("check final version",
show_ntests();
# ----------
+$td->notify("--- Exceptions ---");
+$n_tests += 1;
+
+$td->runtest("check exception handling",
+ {$td->COMMAND => "test_driver 61 -"},
+ {$td->FILE => "exceptions.out", $td->EXIT_STATUS => 0},
+ $td->NORMALIZE_NEWLINES);
+
+show_ntests();
+# ----------
$td->notify("--- Dangling Refs ---");
my @dangling = (qw(minimal dangling-refs));
$n_tests += 2 * scalar(@dangling);
diff --git a/qpdf/qtest/qpdf/exceptions.out b/qpdf/qtest/qpdf/exceptions.out
new file mode 100644
index 00000000..ab69668e
--- /dev/null
+++ b/qpdf/qtest/qpdf/exceptions.out
@@ -0,0 +1,5 @@
+Caught QPDFExc as expected
+Caught QPDFSystemError as expected
+Caught logic_error as expected
+Caught runtime_error as expected
+test 61 done