From bdaa314b7eacc7cd41dbf09f8f8ea6d742c3ea37 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Mon, 8 Sep 2025 23:39:09 +0100 Subject: Add test over Ingestor::ingestLog --- test/test-ingest.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'test/test-ingest.cpp') diff --git a/test/test-ingest.cpp b/test/test-ingest.cpp index 463a69c..fd7ad65 100644 --- a/test/test-ingest.cpp +++ b/test/test-ingest.cpp @@ -195,6 +195,17 @@ BOOST_DATA_TEST_CASE(StoreLogLine, BOOST_CHECK_EQUAL(linesDiscarded, 0); } +BOOST_AUTO_TEST_CASE(StoreLog, *boost::unit_test::depends_on("I/StoreLogLine")) +{ + WebStat::LogFile log {"/tmp/store-log-fixture.log", 10}; + WebStat::FilePtr input {fopen(log.path.c_str(), "r")}; + BOOST_REQUIRE(input); + ingestLog(input.get()); + BOOST_CHECK_EQUAL(linesRead, 10); + BOOST_CHECK_EQUAL(linesParsed, 10); + BOOST_CHECK_EQUAL(linesDiscarded, 0); +} + BOOST_AUTO_TEST_SUITE_END(); BOOST_AUTO_TEST_CASE(FetchRealUserAgentDetail, *boost::unit_test::disabled()) -- cgit v1.2.3