diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/perf-ingest.cpp | 11 | ||||
| -rw-r--r-- | test/test-ingest.cpp | 13 |
2 files changed, 23 insertions, 1 deletions
diff --git a/test/perf-ingest.cpp b/test/perf-ingest.cpp index c403349..cf0be0d 100644 --- a/test/perf-ingest.cpp +++ b/test/perf-ingest.cpp @@ -18,10 +18,19 @@ namespace { static const WebStat::MockDB mockdb; } + class PerfIngestor : public WebStat::Ingestor { + using Ingestor::Ingestor; + + void + log(int, const char *, ...) const override + { + } + }; + void doIngestFile(benchmark::State & state) { - WebStat::Ingestor ingestor {WebStat::getTestUtsName("perf-hostname"), + PerfIngestor ingestor {WebStat::getTestUtsName("perf-hostname"), std::make_shared<WebStat::MockDBPool>("webstat"), { .userAgentAPI = {}, diff --git a/test/test-ingest.cpp b/test/test-ingest.cpp index a1dc5e9..9ce48be 100644 --- a/test/test-ingest.cpp +++ b/test/test-ingest.cpp @@ -3,6 +3,7 @@ #include <boost/test/unit_test.hpp> #include "testing-util.hpp" +#include <cstdio> #include <selectcommandUtil.impl.h> #include <ingestor.hpp> @@ -217,6 +218,18 @@ public: } SPECIAL_MEMBERS_DELETE(TestIngestor); + + [[gnu::format(printf, 3, 4)]] void + log(int, const char * msgfmt, ...) const override + { + va_list args; + va_start(args, msgfmt); + std::unique_ptr<char, DeleteWith<&free>> msg; + BOOST_REQUIRE_GE(vasprintf(std::out_ptr(msg), msgfmt, args), 0); + va_end(args); + BOOST_REQUIRE(msg); + BOOST_TEST_MESSAGE(msg.get()); + } }; BOOST_FIXTURE_TEST_SUITE(I, TestIngestor); |
