Skip to content

Commit

Permalink
Merge branch 'develop' into election-bounding-2
Browse files Browse the repository at this point in the history
# Conflicts:
#	nano/node/scheduler/buckets.cpp
  • Loading branch information
pwojcikdev committed Jul 10, 2024
2 parents 543c601 + 4f450ae commit a126fcc
Show file tree
Hide file tree
Showing 41 changed files with 992 additions and 368 deletions.
22 changes: 13 additions & 9 deletions nano/core_test/confirming_set.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include <nano/node/make_store.hpp>
#include <nano/secure/ledger.hpp>
#include <nano/secure/ledger_set_confirmed.hpp>
#include <nano/test_common/ledger.hpp>
#include <nano/test_common/ledger_context.hpp>
#include <nano/test_common/system.hpp>
#include <nano/test_common/testutil.hpp>

Expand All @@ -18,23 +18,26 @@ using namespace std::chrono_literals;

TEST (confirming_set, construction)
{
auto ctx = nano::test::context::ledger_empty ();
nano::confirming_set confirming_set (ctx.ledger (), ctx.stats ());
auto ctx = nano::test::ledger_empty ();
nano::confirming_set_config config{};
nano::confirming_set confirming_set{ config, ctx.ledger (), ctx.stats () };
}

TEST (confirming_set, add_exists)
{
auto ctx = nano::test::context::ledger_send_receive ();
nano::confirming_set confirming_set (ctx.ledger (), ctx.stats ());
auto ctx = nano::test::ledger_send_receive ();
nano::confirming_set_config config{};
nano::confirming_set confirming_set{ config, ctx.ledger (), ctx.stats () };
auto send = ctx.blocks ()[0];
confirming_set.add (send->hash ());
ASSERT_TRUE (confirming_set.exists (send->hash ()));
}

TEST (confirming_set, process_one)
{
auto ctx = nano::test::context::ledger_send_receive ();
nano::confirming_set confirming_set (ctx.ledger (), ctx.stats ());
auto ctx = nano::test::ledger_send_receive ();
nano::confirming_set_config config{};
nano::confirming_set confirming_set{ config, ctx.ledger (), ctx.stats () };
std::atomic<int> count = 0;
std::mutex mutex;
std::condition_variable condition;
Expand All @@ -49,8 +52,9 @@ TEST (confirming_set, process_one)

TEST (confirming_set, process_multiple)
{
auto ctx = nano::test::context::ledger_send_receive ();
nano::confirming_set confirming_set (ctx.ledger (), ctx.stats ());
auto ctx = nano::test::ledger_send_receive ();
nano::confirming_set_config config{};
nano::confirming_set confirming_set{ config, ctx.ledger (), ctx.stats () };
std::atomic<int> count = 0;
std::mutex mutex;
std::condition_variable condition;
Expand Down
4 changes: 1 addition & 3 deletions nano/core_test/entry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

#include <boost/filesystem/path.hpp>

constexpr std::size_t OPEN_FILE_DESCRIPTORS_LIMIT = 16384;

namespace nano
{
namespace test
Expand All @@ -19,8 +17,8 @@ void force_nano_dev_network ();

GTEST_API_ int main (int argc, char ** argv)
{
nano::initialize_file_descriptor_limit ();
nano::logger::initialize_for_tests (nano::log_config::tests_default ());
nano::set_file_descriptor_limit (OPEN_FILE_DESCRIPTORS_LIMIT);
nano::force_nano_dev_network ();
nano::node_singleton_memory_pool_purge_guard memory_pool_cleanup_guard;
testing::InitGoogleTest (&argc, argv);
Expand Down
Loading

0 comments on commit a126fcc

Please sign in to comment.