| 18 | BOOST_FIXTURE_TEST_SUITE(i2p_tests, BasicTestingSetup) |
| 19 | |
| 20 | BOOST_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 | |
| 44 | BOOST_AUTO_TEST_SUITE_END() |