diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2019-03-03 13:38:39 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2019-03-03 13:38:39 +0000 |
commit | f988df5245cfb59e893bbe262aac8d6260196bac (patch) | |
tree | 39145469fc79890d49bb9eae6fdd59efb329a846 /libpqpp/unittests/testpq.cpp | |
parent | Tidy link of libpq (diff) | |
download | libdbpp-postgresql-f988df5245cfb59e893bbe262aac8d6260196bac.tar.bz2 libdbpp-postgresql-f988df5245cfb59e893bbe262aac8d6260196bac.tar.xz libdbpp-postgresql-f988df5245cfb59e893bbe262aac8d6260196bac.zip |
More clang-tidy fixes
Diffstat (limited to 'libpqpp/unittests/testpq.cpp')
-rw-r--r-- | libpqpp/unittests/testpq.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libpqpp/unittests/testpq.cpp b/libpqpp/unittests/testpq.cpp index 5b584b7..e78a079 100644 --- a/libpqpp/unittests/testpq.cpp +++ b/libpqpp/unittests/testpq.cpp @@ -168,10 +168,12 @@ BOOST_AUTO_TEST_CASE( bulkload ) // Test sample file ro->beginBulkUpload("bulktest", ""); std::ifstream in(rootDir / "bulk.sample"); - if (!in.good()) throw std::runtime_error("Couldn't open bulk.sample"); - char buf[BUFSIZ]; - for (std::streamsize r; (r = in.readsome(buf, sizeof(buf))) > 0; ) { - ro->bulkUploadData(buf, r); + if (!in.good()) { + throw std::runtime_error("Couldn't open bulk.sample"); + } + std::array<char, BUFSIZ> buf {}; + for (std::streamsize r; (r = in.readsome(buf.data(), buf.size())) > 0; ) { + ro->bulkUploadData(buf.data(), r); } ro->endBulkUpload(nullptr); assertScalarValueHelper(*count, 800); |