summaryrefslogtreecommitdiff
path: root/libmysqlpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2019-03-03 13:37:49 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2019-03-03 13:37:49 +0000
commit3a21e866ac46c33733b3a72d0fdfbce2d3cc72d2 (patch)
tree5da3a6e62cc12cd872ae2b9aa679aee3790ecc6f /libmysqlpp
parentEnable hicpp checks and fix accordingly (diff)
downloadlibdbpp-mysql-3a21e866ac46c33733b3a72d0fdfbce2d3cc72d2.tar.bz2
libdbpp-mysql-3a21e866ac46c33733b3a72d0fdfbce2d3cc72d2.tar.xz
libdbpp-mysql-3a21e866ac46c33733b3a72d0fdfbce2d3cc72d2.zip
More clang-tidy fixes
Diffstat (limited to 'libmysqlpp')
-rw-r--r--libmysqlpp/unittests/testmysql.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/libmysqlpp/unittests/testmysql.cpp b/libmysqlpp/unittests/testmysql.cpp
index ca4cbc0..7795a0b 100644
--- a/libmysqlpp/unittests/testmysql.cpp
+++ b/libmysqlpp/unittests/testmysql.cpp
@@ -106,10 +106,12 @@ BOOST_AUTO_TEST_CASE( bulkload )
// Test sample file
ro->beginBulkUpload("bulktest", "");
std::ifstream in((rootDir / "bulk.sample").string());
- 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);