Commit db6598b449f4edbb69a581ecc8bc6791e24ad3ea
1 parent
06c6f9a9
Attempt to test for QPDFNameTreeObjectHelper's vtable
It has disappeared from the DLL on Windows a few times.
Showing
2 changed files
with
26 additions
and
0 deletions
qpdf/qtest/qpdf/exceptions.out
| @@ -2,4 +2,5 @@ Caught QPDFExc as expected | @@ -2,4 +2,5 @@ Caught QPDFExc as expected | ||
| 2 | Caught QPDFSystemError as expected | 2 | Caught QPDFSystemError as expected |
| 3 | Caught logic_error as expected | 3 | Caught logic_error as expected |
| 4 | Caught runtime_error as expected | 4 | Caught runtime_error as expected |
| 5 | +~ExtendNameTree called | ||
| 5 | test 61 done | 6 | test 61 done |
qpdf/test_driver.cc
| @@ -47,6 +47,24 @@ usage() | @@ -47,6 +47,24 @@ usage() | ||
| 47 | exit(2); | 47 | exit(2); |
| 48 | } | 48 | } |
| 49 | 49 | ||
| 50 | +// Derive from QPDFNumberTreeObjectHelper -- See test 61 | ||
| 51 | +class ExtendNameTree: public QPDFNameTreeObjectHelper | ||
| 52 | +{ | ||
| 53 | + public: | ||
| 54 | + ExtendNameTree(QPDFObjectHandle o, QPDF& q); | ||
| 55 | + virtual ~ExtendNameTree(); | ||
| 56 | +}; | ||
| 57 | + | ||
| 58 | +ExtendNameTree::ExtendNameTree(QPDFObjectHandle o, QPDF& q) : | ||
| 59 | + QPDFNameTreeObjectHelper(o, q) | ||
| 60 | +{ | ||
| 61 | +} | ||
| 62 | + | ||
| 63 | +ExtendNameTree::~ExtendNameTree() | ||
| 64 | +{ | ||
| 65 | + std::cout << "~ExtendNameTree called" << std::endl; | ||
| 66 | +} | ||
| 67 | + | ||
| 50 | class Provider: public QPDFObjectHandle::StreamDataProvider | 68 | class Provider: public QPDFObjectHandle::StreamDataProvider |
| 51 | { | 69 | { |
| 52 | public: | 70 | public: |
| @@ -2281,6 +2299,13 @@ test_61(QPDF& pdf, char const* arg2) | @@ -2281,6 +2299,13 @@ test_61(QPDF& pdf, char const* arg2) | ||
| 2281 | Pl_Discard pd; | 2299 | Pl_Discard pd; |
| 2282 | Pipeline* p = &pd; | 2300 | Pipeline* p = &pd; |
| 2283 | assert(dynamic_cast<Pl_Discard*>(p) != nullptr); | 2301 | assert(dynamic_cast<Pl_Discard*>(p) != nullptr); |
| 2302 | + | ||
| 2303 | + // For some reason, QPDFNameTreeObjectHelper's vtable seems to | ||
| 2304 | + // like to not make it into the shared library with mingw. Try to | ||
| 2305 | + // make sure this is really fixed. | ||
| 2306 | + QPDFNameTreeObjectHelper* n = | ||
| 2307 | + new ExtendNameTree(QPDFObjectHandle::newNull(), pdf); | ||
| 2308 | + delete n; | ||
| 2284 | } | 2309 | } |
| 2285 | 2310 | ||
| 2286 | static void | 2311 | static void |