21 std::vector<NodeEvictionCandidate> eviction_candidates;
23 eviction_candidates.push_back({
24 fuzzed_data_provider.ConsumeIntegral<
NodeId>(),
25 std::chrono::seconds{fuzzed_data_provider.ConsumeIntegral<int64_t>()},
26 std::chrono::microseconds{fuzzed_data_provider.ConsumeIntegral<int64_t>()},
27 std::chrono::seconds{fuzzed_data_provider.ConsumeIntegral<int64_t>()},
28 std::chrono::seconds{fuzzed_data_provider.ConsumeIntegral<int64_t>()},
29 fuzzed_data_provider.ConsumeBool(),
30 fuzzed_data_provider.ConsumeBool(),
31 fuzzed_data_provider.ConsumeBool(),
32 fuzzed_data_provider.ConsumeIntegral<uint64_t>(),
33 fuzzed_data_provider.ConsumeBool(),
34 fuzzed_data_provider.ConsumeBool(),
36 fuzzed_data_provider.ConsumeBool(),
42 const std::vector<NodeEvictionCandidate> eviction_candidates_copy = eviction_candidates;
43 const std::optional<NodeId> node_to_evict =
SelectNodeToEvict(std::move(eviction_candidates));
45 assert(std::any_of(eviction_candidates_copy.begin(), eviction_candidates_copy.end(), [&node_to_evict](
const NodeEvictionCandidate& eviction_candidate) { return *node_to_evict == eviction_candidate.id; }));
std::optional< NodeId > SelectNodeToEvict(std::vector< NodeEvictionCandidate > &&vEvictionCandidates)
Select an inbound peer to evict after filtering out (protecting) peers having distinct,...
#define LIMITED_WHILE(condition, limit)
Can be used to limit a theoretically unbounded loop.
FUZZ_TARGET(node_eviction)
constexpr ConnectionType ALL_CONNECTION_TYPES[]
constexpr auto ALL_NETWORKS