-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathevo_instantsend_tests.cpp
More file actions
40 lines (30 loc) · 1.1 KB
/
evo_instantsend_tests.cpp
File metadata and controls
40 lines (30 loc) · 1.1 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright (c) 2022 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 <test/util/setup_common.h>
#include <llmq/instantsend.h>
#include <boost/test/unit_test.hpp>
BOOST_FIXTURE_TEST_SUITE(evo_instantsend_tests, BasicTestingSetup)
BOOST_AUTO_TEST_CASE(instantsend_CInstantSendLock_tests)
{
enum {
DET = true,
NON_DET = false
};
{
llmq::CInstantSendLock lock;
BOOST_CHECK_EQUAL(lock.IsDeterministic(), NON_DET);
}
std::vector<std::pair<int, bool>> version_det_pair = {
{llmq::CInstantSendLock::isdlock_version, DET},
{llmq::CInstantSendLock::islock_version, NON_DET},
{2, DET},
{100, DET},
{std::numeric_limits<decltype(llmq::CInstantSendLock::isdlock_version)>::max(), DET},
};
for (const auto& [version, det] : version_det_pair) {
llmq::CInstantSendLock lock(version);
BOOST_CHECK_EQUAL(lock.IsDeterministic(), det);
}
}
BOOST_AUTO_TEST_SUITE_END()