diff options
author | Jay Berkenbilt <ejb@ql.org> | 2022-04-18 17:24:17 +0200 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2022-04-18 17:24:17 +0200 |
commit | ce5c3bcad81c264c90a429ec505a581680ce35a1 (patch) | |
tree | 619784ef97a51f7936d43b89b19810199408a41e /qpdf/test_driver.cc | |
parent | 877694a5835a11120ef2bd1d2b82b609cb32ca07 (diff) | |
download | qpdf-ce5c3bcad81c264c90a429ec505a581680ce35a1.tar.zst |
QPDFJob: pass capture output streams through to underlying QPDF
Diffstat (limited to 'qpdf/test_driver.cc')
-rw-r--r-- | qpdf/test_driver.cc | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/qpdf/test_driver.cc b/qpdf/test_driver.cc index da2a5e7f..14c6c316 100644 --- a/qpdf/test_driver.cc +++ b/qpdf/test_driver.cc @@ -1734,7 +1734,8 @@ test_46(QPDF& pdf, char const* arg2) } std::cout << "/Bad1" << std::endl; - auto bad1 = QPDFNumberTreeObjectHelper(pdf.getTrailer().getKey("/Bad1"), pdf); + auto bad1 = + QPDFNumberTreeObjectHelper(pdf.getTrailer().getKey("/Bad1"), pdf); assert(bad1.begin() == bad1.end()); assert(bad1.last() == bad1.end()); @@ -3023,6 +3024,24 @@ test_84(QPDF& pdf, char const* arg2) } catch (QPDFUsage& e) { std::cout << "usage: " << e.what() << std::endl; } + + std::cout << "output capture" << std::endl; + std::ostringstream cout; + std::ostringstream cerr; + { + QPDFJob j; + j.setOutputStreams(&cout, &cerr); + j.config() + ->inputFile("bad2.pdf") + ->showObject("4,0") + ->checkConfiguration(); + std::cout << "calling run" << std::endl; + j.run(); + std::cout << "captured stdout" << std::endl; + std::cout << cout.str(); + std::cout << "captured stderr" << std::endl; + std::cout << cerr.str(); + } } static void |