diff --git a/test/testInfluxDb.cxx b/test/testInfluxDb.cxx index bd555ec6..d3481e16 100644 --- a/test/testInfluxDb.cxx +++ b/test/testInfluxDb.cxx @@ -29,6 +29,10 @@ BOOST_AUTO_TEST_CASE(simplySendMetric2) { using namespace std::string_literals; auto monitoring = MonitoringFactory::Get("influxdb-stdout://"); + + std::stringstream coutRedirect; + std::streambuf* coutBuffer = std::cout.rdbuf(coutRedirect.rdbuf()); + monitoring->send(Metric{"card"} .addValue(40.217773, "temperature") .addValue(0, "droppedPackets") @@ -38,6 +42,9 @@ BOOST_AUTO_TEST_CASE(simplySendMetric2) .addTag(tags::Key::ID, 3) .addTag(tags::Key::Type, tags::Value::CRU) ); + std::string expected1 = "card,hostname=pcaldadam2.local,id=3,type=CRU temperature=40.2178,droppedPackets=0i,ctpClock=0.76817,localClock=240.471,totalPacketsPerSecond=0i 1618241730312076000\n"; + BOOST_CHECK(expected1.compare(coutRedirect.str())); + coutRedirect.str(std::string()); monitoring->send(Metric{"link"} .addValue("GBT/GBT"s, "gbtMode") @@ -52,6 +59,10 @@ BOOST_AUTO_TEST_CASE(simplySendMetric2) .addTag(tags::Key::CRU, 3) .addTag(tags::Key::ID, 3) ); + std::string expected2 = R"(link,hostname=pcaldadam2.local,CRU=3,id=3 gbtMode="GBT/GBT",loopback="None",gbtMux="TTC:CTP",datapathMode="Continuous",datapath="Disabled",rxFreq=181.371,txFreq=196.25,status=0i,opticalPower=657.4 1618241730312104000)"; + BOOST_CHECK(expected2.compare(coutRedirect.str())); + + std::cout.rdbuf(coutBuffer); } BOOST_AUTO_TEST_CASE(InfluxDbv2) diff --git a/test/testMonitoringFactory.cxx b/test/testMonitoringFactory.cxx index 11c19ab9..bc351628 100644 --- a/test/testMonitoringFactory.cxx +++ b/test/testMonitoringFactory.cxx @@ -11,7 +11,7 @@ #include #include -#define BOOST_TEST_MODULE TestMonitoringFactory +#define BOOST_TEST_MODULE TestMonitoringVerbosityy #define BOOST_TEST_DYN_LINK #include #include diff --git a/test/testThreads.cxx b/test/testThreads.cxx index fa34282d..f6db9389 100644 --- a/test/testThreads.cxx +++ b/test/testThreads.cxx @@ -15,7 +15,7 @@ namespace Test using namespace o2::monitoring; -BOOST_AUTO_TEST_CASE(retrieveOtherParams) +BOOST_AUTO_TEST_CASE(runLibraryInMultipleThreads) { std::array threads; for (auto& thread : threads) {