From 2317b4608821b03da0cc288d06b9c0bdb6b60239 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 22 May 2021 16:42:06 +0100 Subject: Pass linter checks Except IWYU, doesn't like the C++20 CTF. --- test/test-bitset.cpp | 6 ++++-- test/test-rawDataReader.cpp | 16 +++++++++++++--- test/test-streams.cpp | 19 ++++++++++++++++--- 3 files changed, 33 insertions(+), 8 deletions(-) (limited to 'test') diff --git a/test/test-bitset.cpp b/test/test-bitset.cpp index 15e43d6..02b3893 100644 --- a/test/test-bitset.cpp +++ b/test/test-bitset.cpp @@ -1,10 +1,12 @@ #define BOOST_TEST_MODULE BitSet -#include #include #include "helpers.h" +#include #include #include +#include +#include using namespace MyGrate; @@ -14,7 +16,7 @@ BOOST_TEST_DONT_PRINT_LOG_VALUE(BitSet::Iterator); BOOST_AUTO_TEST_CASE(bitset) { - std::byte bytes[3] {0x00_b, 0xFF_b, 0xa1_b}; + constexpr std::array bytes {0x00_b, 0xFF_b, 0xa1_b}; BitSet bs {bytes}; BOOST_REQUIRE_EQUAL(bs.size(), 24); diff --git a/test/test-rawDataReader.cpp b/test/test-rawDataReader.cpp index 4ac0a8a..b211fe3 100644 --- a/test/test-rawDataReader.cpp +++ b/test/test-rawDataReader.cpp @@ -3,10 +3,20 @@ #include #include +#include "bitset.h" #include "helpers.h" +#include "mariadb_repl.h" +#include +#include +#include #include #include +#include #include +#include +#include +#include +#include using namespace MyGrate; @@ -147,10 +157,10 @@ BOOST_DATA_TEST_CASE(read_field_type, BOOST_AUTO_TEST_CASE(rdr_from_MARIADB_STRING) { - char buf[5] = "test"; - MARIADB_STRING str {buf, strlen(buf)}; + std::string buf {"test"}; + MARIADB_STRING str {buf.data(), buf.length()}; RawDataReader rdr {str}; - BOOST_CHECK_EQUAL(rdr.viewValue(4), "test"); + BOOST_CHECK_EQUAL(rdr.viewValue(buf.length()), buf); } using SimpleTypes = boost::mpl::list #include +#include "bitset.h" #include "helpers.h" +#include "mariadb_repl.h" +#include "mysql_types.h" +#include +#include +#include +#include +#include +#include +#include +#include +struct timespec; +struct tm; #include BOOST_FIXTURE_TEST_SUITE(stream, std::stringstream); @@ -56,7 +69,7 @@ BOOST_DATA_TEST_CASE(tss, *this << in; BOOST_CHECK_EQUAL(this->str(), exp); } -constexpr std::byte somebits[3] {0x00_b, 0xFF_b, 0xa1_b}; +constexpr std::array somebits {0x00_b, 0xFF_b, 0xa1_b}; BOOST_DATA_TEST_CASE(bss, boost::unit_test::data::make>({ {{MyGrate::BitSet {somebits}}, "[0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,1,0,1]"}, @@ -69,8 +82,8 @@ BOOST_DATA_TEST_CASE(bss, BOOST_AUTO_TEST_CASE(mariadb_string) { - char buf[5] = "test"; - MARIADB_STRING str {buf, strlen(buf)}; + std::string buf {"test"}; + MARIADB_STRING str {buf.data(), buf.length()}; *this << str; BOOST_CHECK_EQUAL(this->str(), buf); } -- cgit v1.2.3