LCOV - code coverage report
Current view: top level - /opt/artdaq/srcs/artdaq-mfextensions/test/Extensions - throttle_t.cc (source / functions) Coverage Total Hit
Test: artdaq.info.cleaned Lines: 100.0 % 13 13
Test Date: 2025-09-04 00:45:34 Functions: 100.0 % 2 2

            Line data    Source code
       1              : #include "mfextensions/Extensions/throttle.hh"
       2              : 
       3              : #define BOOST_TEST_MODULE throttle_t
       4              : #include "cetlib/quiet_unit_test.hpp"
       5              : #include "cetlib_except/exception.h"
       6              : 
       7              : #define TRACE_NAME "throttle_t"
       8              : #include "TRACE/tracemf.h"
       9              : 
      10              : BOOST_AUTO_TEST_SUITE(throttle_t)
      11              : 
      12            2 : BOOST_AUTO_TEST_CASE(Throttle)
      13              : {
      14            1 :         throttle t("test", 2, 1);
      15              : 
      16              :         struct timeval tv;
      17            1 :         gettimeofday(&tv, nullptr);
      18              : 
      19            3 :         BOOST_REQUIRE(!t.reach_limit("test", tv));
      20            3 :         BOOST_REQUIRE(!t.reach_limit("test", tv));
      21            3 :         BOOST_REQUIRE(t.reach_limit("test", tv));
      22            3 :         BOOST_REQUIRE(!t.reach_limit("quiz", tv));
      23              : 
      24            1 :         t.use(false);
      25            3 :         BOOST_REQUIRE(!t.reach_limit("test", tv));
      26              : 
      27            1 :         t.use(true);
      28            1 :         tv.tv_sec += 2;
      29            3 :         BOOST_REQUIRE(!t.reach_limit("test", tv));
      30            1 : }
      31              : 
      32              : BOOST_AUTO_TEST_SUITE_END()
        

Generated by: LCOV version 2.0-1