From c8f0fb73e49f6b6b6ac1690c585c25ab7dbd2b88 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 11 Sep 2025 00:01:46 +0100 Subject: Always pass API URL to curlGetUserAgentDetail --- test/test-ingest.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'test/test-ingest.cpp') diff --git a/test/test-ingest.cpp b/test/test-ingest.cpp index 9b21e44..3799aab 100644 --- a/test/test-ingest.cpp +++ b/test/test-ingest.cpp @@ -175,6 +175,7 @@ public: TestIngestor() : WebStat::Ingestor {WebStat::getTestUtsName("test-hostname"), std::make_shared("webstat")} { + userAgentAPI = FIXTURE_URL_BASE + "/userAgent.json"; } }; @@ -206,13 +207,11 @@ BOOST_AUTO_TEST_CASE(StoreLog, *boost::unit_test::depends_on("I/StoreLogLine")) BOOST_CHECK_EQUAL(linesDiscarded, 0); } -BOOST_AUTO_TEST_SUITE_END(); - BOOST_AUTO_TEST_CASE(FetchMockUserAgentDetail) { const auto uaDetailReq = WebStat::curlGetUserAgentDetail( R"(Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36)", - (FIXTURE_URL_BASE + "/userAgent.json").c_str()); + userAgentAPI.c_str()); BOOST_REQUIRE(uaDetailReq); BOOST_REQUIRE_EQUAL(CURLE_OK, curl_easy_perform(uaDetailReq->hnd.get())); @@ -223,10 +222,13 @@ BOOST_AUTO_TEST_CASE(FetchMockUserAgentDetail) } } +BOOST_AUTO_TEST_SUITE_END(); + BOOST_AUTO_TEST_CASE(FetchRealUserAgentDetail, *boost::unit_test::disabled()) { const auto uaDetailReq = WebStat::curlGetUserAgentDetail( - R"(Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36)"); + R"(Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36)", + "http://useragentstring.com"); BOOST_REQUIRE(uaDetailReq); BOOST_REQUIRE_EQUAL(CURLE_OK, curl_easy_perform(uaDetailReq->hnd.get())); -- cgit v1.2.3