MCPcopy Create free account
hub / github.com/ElementsProject/elements / BOOST_AUTO_TEST_CASE

Function BOOST_AUTO_TEST_CASE

src/test/i2p_tests.cpp:20–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18BOOST_FIXTURE_TEST_SUITE(i2p_tests, BasicTestingSetup)
19
20BOOST_AUTO_TEST_CASE(unlimited_recv)
21{
22 auto CreateSockOrig = CreateSock;
23
24 // Mock CreateSock() to create MockSock.
25 CreateSock = [](const CService&) {
26 return std::make_unique<StaticContentsSock>(std::string(i2p::sam::MAX_MSG_SIZE + 1, 'a'));
27 };
28
29 CThreadInterrupt interrupt;
30 i2p::sam::Session session(gArgs.GetDataDirNet() / "test_i2p_private_key", CService{}, &interrupt);
31
32 {
33 ASSERT_DEBUG_LOG("Creating SAM session");
34 ASSERT_DEBUG_LOG("too many bytes without a terminator");
35
36 i2p::Connection conn;
37 bool proxy_error;
38 BOOST_REQUIRE(!session.Connect(CService{}, conn, proxy_error));
39 }
40
41 CreateSock = CreateSockOrig;
42}
43
44BOOST_AUTO_TEST_SUITE_END()

Callers

nothing calls this directly

Calls 1

ConnectMethod · 0.45

Tested by

no test coverage detected