LCOV - code coverage report
Current view: top level - src/test - llmq_dkg_tests.cpp (source / functions) Hit Total Coverage
Test: total_coverage.info Lines: 11 11 100.0 %
Date: 2026-06-25 07:23:43 Functions: 6 6 100.0 %

          Line data    Source code
       1             : // Copyright (c) 2022-2025 The Dash Core developers
       2             : // Distributed under the MIT software license, see the accompanying
       3             : // file COPYING or http://www.opensource.org/licenses/mit-license.php.
       4             : 
       5             : #include <llmq/dkgsession.h>
       6             : #include <util/helpers.h>
       7             : #include <util/std23.h>
       8             : 
       9             : #include <boost/test/unit_test.hpp>
      10             : 
      11         146 : BOOST_AUTO_TEST_SUITE(llmq_dkg_tests)
      12             : 
      13         148 : BOOST_AUTO_TEST_CASE(llmq_dkgerror)
      14             : {
      15             :     using namespace llmq;
      16           8 :     for (auto i : util::irange(std23::to_underlying(llmq::DKGError::type::_COUNT))) {
      17           7 :         BOOST_REQUIRE(GetSimulatedErrorRate(llmq::DKGError::type(i)) == 0.0);
      18           7 :         SetSimulatedDKGErrorRate(llmq::DKGError::type(i), 1.0);
      19           7 :         BOOST_REQUIRE(GetSimulatedErrorRate(llmq::DKGError::type(i)) == 1.0);
      20             :     }
      21           1 :     BOOST_REQUIRE(GetSimulatedErrorRate(llmq::DKGError::type::_COUNT) == 0.0);
      22           1 :     SetSimulatedDKGErrorRate(llmq::DKGError::type::_COUNT, 1.0);
      23           1 :     BOOST_REQUIRE(GetSimulatedErrorRate(llmq::DKGError::type::_COUNT) == 0.0);
      24           1 : }
      25             : 
      26         146 : BOOST_AUTO_TEST_SUITE_END()

Generated by: LCOV version 1.16