Skip to content

Commit

Permalink
Use assert_ge
Browse files Browse the repository at this point in the history
  • Loading branch information
RickiNano committed Jan 18, 2024
1 parent 63e41ec commit bc482f4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions nano/core_test/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ TEST (node, work_generate)
auto difficulty = nano::difficulty::from_multiplier (1.5, node.network_params.work.base);
auto work = node.work_generate_blocking (version, root, difficulty);
ASSERT_TRUE (work.is_initialized ());
ASSERT_TRUE (nano::dev::network_params.work.difficulty (version, root, *work) >= difficulty);
ASSERT_GE (nano::dev::network_params.work.difficulty (version, root, *work), difficulty);
}
{
auto difficulty = nano::difficulty::from_multiplier (0.5, node.network_params.work.base);
Expand All @@ -57,7 +57,7 @@ TEST (node, work_generate)
work = node.work_generate_blocking (version, root, difficulty);
} while (nano::dev::network_params.work.difficulty (version, root, *work) >= node.network_params.work.base);
ASSERT_TRUE (work.is_initialized ());
ASSERT_TRUE (nano::dev::network_params.work.difficulty (version, root, *work) >= difficulty);
ASSERT_GE (nano::dev::network_params.work.difficulty (version, root, *work), difficulty);
ASSERT_FALSE (nano::dev::network_params.work.difficulty (version, root, *work) >= node.network_params.work.base);
}
}
Expand Down
6 changes: 3 additions & 3 deletions nano/core_test/socket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ TEST (socket, max_connections_per_ip)
auto server_port = system.get_available_port ();

const auto max_ip_connections = node->network_params.network.max_peers_per_ip;
ASSERT_TRUE (max_ip_connections >= 1);
ASSERT_GE (max_ip_connections, 1);

const auto max_global_connections = 1000;

Expand Down Expand Up @@ -235,7 +235,7 @@ TEST (socket, max_connections_per_subnetwork)
boost::asio::ip::tcp::endpoint listen_endpoint{ boost::asio::ip::address_v6::any (), server_port };

const auto max_subnetwork_connections = node->network_params.network.max_peers_per_subnetwork;
ASSERT_TRUE (max_subnetwork_connections >= 1);
ASSERT_GE (max_subnetwork_connections, 1);

const auto max_global_connections = 1000;

Expand Down Expand Up @@ -295,7 +295,7 @@ TEST (socket, disabled_max_peers_per_ip)
auto server_port = system.get_available_port ();

const auto max_ip_connections = node->network_params.network.max_peers_per_ip;
ASSERT_TRUE (max_ip_connections >= 1);
ASSERT_GE (max_ip_connections, 1);

const auto max_global_connections = 1000;

Expand Down
2 changes: 1 addition & 1 deletion nano/core_test/uint256_union.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -624,5 +624,5 @@ TEST (random_pool, generate_word64_big_number)
uint64_t min = static_cast<uint64_t> (std::numeric_limits<uint32_t>::max ()) + 1;
uint64_t max = std::numeric_limits<uint64_t>::max ();
auto big_random = nano::random_pool::generate_word64 (min, max);
ASSERT_TRUE (big_random >= min);
ASSERT_GE (big_random, min);
}

0 comments on commit bc482f4

Please sign in to comment.