aboutsummaryrefslogtreecommitdiffstats
path: root/libtests
diff options
context:
space:
mode:
Diffstat (limited to 'libtests')
-rw-r--r--libtests/json_parse.cc8
1 files changed, 3 insertions, 5 deletions
diff --git a/libtests/json_parse.cc b/libtests/json_parse.cc
index 7f894c8d..721b17de 100644
--- a/libtests/json_parse.cc
+++ b/libtests/json_parse.cc
@@ -1,3 +1,4 @@
+#include <qpdf/FileInputSource.hh>
#include <qpdf/JSON.hh>
#include <qpdf/QUtil.hh>
#include <cstdlib>
@@ -103,11 +104,8 @@ main(int argc, char* argv[])
}
}
try {
- std::shared_ptr<char> buf;
- size_t size;
- QUtil::read_file_into_memory(filename, buf, size);
- std::string s(buf.get(), size);
- std::cout << JSON::parse(s, reactor.get()).unparse() << std::endl;
+ FileInputSource is(filename);
+ std::cout << JSON::parse(is, reactor.get()).unparse() << std::endl;
} catch (std::exception& e) {
std::cerr << "exception: " << filename << ": " << e.what() << std::endl;
return 2;