Skip to content

Commit 0116614

Browse files
authored
Removed NDEBUG tracking for compiling tests in Release mode (#287)
1 parent 974d0c8 commit 0116614

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

include/libp2p/multi/multiaddress_protocol_list.hpp

+5-9
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,11 @@ namespace libp2p::multi {
5959
X_PARITY_WS = 4770,
6060
X_PARITY_WSS = 4780,
6161
// Range for private use: 0x300000 – 0x3FFFFF
62-
#ifndef NDEBUG
62+
// Debug section
6363
_DUMMY_PROTO_1 = 0x3DEAD1,
6464
_DUMMY_PROTO_2 = 0x3DEAD2,
6565
_DUMMY_PROTO_3 = 0x3DEAD3,
6666
_DUMMY_PROTO_4 = 0x3DEAD4,
67-
#endif
6867
};
6968

7069
constexpr bool operator==(const Protocol &p) const {
@@ -83,12 +82,9 @@ namespace libp2p::multi {
8382
public:
8483
/**
8584
* The total number of known protocols
85+
* (31 ordinal + 4 debug)
8686
*/
87-
static constexpr size_t kProtocolsNum = 31
88-
#ifndef NDEBUG
89-
+ 4
90-
#endif
91-
;
87+
static constexpr size_t kProtocolsNum = 31 + 4;
9288

9389
/**
9490
* Returns a protocol with the corresponding name if it exists, or nullptr
@@ -165,12 +161,12 @@ namespace libp2p::multi {
165161
{Protocol::Code::P2P_CIRCUIT, 0, "p2p-circuit"},
166162
{Protocol::Code::X_PARITY_WS, Protocol::kVarLen, "x-parity-ws"},
167163
{Protocol::Code::X_PARITY_WSS, Protocol::kVarLen, "x-parity-wss"},
168-
#ifndef NDEBUG
164+
// Debug section
169165
{Protocol::Code::_DUMMY_PROTO_1, 0, "_dummy_proto_1"},
170166
{Protocol::Code::_DUMMY_PROTO_2, 0, "_dummy_proto_2"},
171167
{Protocol::Code::_DUMMY_PROTO_3, Protocol::kVarLen, "_dummy_proto_3"},
172168
{Protocol::Code::_DUMMY_PROTO_4, Protocol::kVarLen, "_dummy_proto_4"},
173-
#endif
169+
174170
};
175171
};
176172

0 commit comments

Comments
 (0)