forked from dashpay/dash
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathllmq_dkg_tests.cpp
28 lines (21 loc) · 973 Bytes
/
llmq_dkg_tests.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Copyright (c) 2022-2023 The Dash Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <llmq/dkgsession.h>
#include <util/irange.h>
#include <util/underlying.h>
#include <boost/test/unit_test.hpp>
BOOST_AUTO_TEST_SUITE(llmq_dkg_tests)
BOOST_AUTO_TEST_CASE(llmq_dkgerror)
{
using namespace llmq;
for (auto i : irange::range(ToUnderlying(llmq::DKGError::type::_COUNT))) {
BOOST_ASSERT(GetSimulatedErrorRate(llmq::DKGError::type(i)) == 0.0);
SetSimulatedDKGErrorRate(llmq::DKGError::type(i), 1.0);
BOOST_ASSERT(GetSimulatedErrorRate(llmq::DKGError::type(i)) == 1.0);
}
BOOST_ASSERT(GetSimulatedErrorRate(llmq::DKGError::type::_COUNT) == 0.0);
SetSimulatedDKGErrorRate(llmq::DKGError::type::_COUNT, 1.0);
BOOST_ASSERT(GetSimulatedErrorRate(llmq::DKGError::type::_COUNT) == 0.0);
}
BOOST_AUTO_TEST_SUITE_END()