#include "gtest/gtest.h"
#include "cryptonote_core/cryptonote_core.h"
#include "p2p/net_node.h"
#include "p2p/net_node.inl"
#include "cryptonote_protocol/cryptonote_protocol_handler.h"
#include "cryptonote_protocol/cryptonote_protocol_handler.inl"
Go to the source code of this file.
◆ MAKE_IPV4_ADDRESS
| #define MAKE_IPV4_ADDRESS |
( |
| a, |
|
|
| b, |
|
|
| c, |
|
|
| d ) |
Value:
#define MAKE_IP(a1, a2, a3, a4)
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition at line 38 of file ban.cpp.
◆ Server
◆ TEST() [1/2]
Definition at line 114 of file ban.cpp.
115{
119 cprotocol.set_p2p_endpoint(&server);
120
121
125
126
128 ASSERT_TRUE(server.get_blocked_hosts().size() == 1);
131
132
134 ASSERT_TRUE(server.get_blocked_hosts().size() == 1);
137
138
140 ASSERT_TRUE(server.get_blocked_hosts().size() == 1);
143
144
146 ASSERT_TRUE(server.get_blocked_hosts().size() == 0);
149
150
152 ASSERT_TRUE(server.get_blocked_hosts().size() == 0);
155
156
159 ASSERT_TRUE(server.get_blocked_hosts().size() == 2);
164
165
166#if 0
167
168 sleep(2);
169 ASSERT_TRUE(server.get_blocked_hosts().size() == 1);
172
173
174 sleep(2);
175 ASSERT_TRUE(server.get_blocked_hosts().size() == 0);
178#endif
179
180
181 time_t t;
183 ASSERT_TRUE(server.get_blocked_hosts().size() == 1);
188 ASSERT_TRUE(server.get_blocked_hosts().size() == 1);
193 ASSERT_TRUE(server.get_blocked_hosts().size() == 1);
197}
#define MAKE_IPV4_ADDRESS(a, b, c, d)
nodetool::node_server< cryptonote::t_cryptonote_protocol_handler< test_core > > Server
#define ASSERT_FALSE(condition)
#define ASSERT_TRUE(condition)
◆ TEST() [2/2]
Definition at line 199 of file ban.cpp.
200{
204 cprotocol.set_p2p_endpoint(&server);
205
206
213}