Skip to content

Commit 4a19f50

Browse files
committed
test: add ALL_NETWORKS to test utilities
1 parent 519e76b commit 4a19f50

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/test/util/net.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@
66
#define BITCOIN_TEST_UTIL_NET_H
77

88
#include <compat.h>
9+
#include <netaddress.h>
910
#include <net.h>
1011
#include <util/sock.h>
1112

13+
#include <array>
1214
#include <cassert>
1315
#include <cstring>
1416
#include <string>
@@ -67,6 +69,16 @@ constexpr ConnectionType ALL_CONNECTION_TYPES[]{
6769
ConnectionType::ADDR_FETCH,
6870
};
6971

72+
constexpr auto ALL_NETWORKS = std::array{
73+
Network::NET_UNROUTABLE,
74+
Network::NET_IPV4,
75+
Network::NET_IPV6,
76+
Network::NET_ONION,
77+
Network::NET_I2P,
78+
Network::NET_CJDNS,
79+
Network::NET_INTERNAL,
80+
};
81+
7082
/**
7183
* A mocked Sock alternative that returns a statically contained data upon read and succeeds
7284
* and ignores all writes. The data to be returned is given to the constructor and when it is

0 commit comments

Comments
 (0)