MCPcopy Create free account
hub / github.com/arvidn/libtorrent / test_parse_interface

Function test_parse_interface

test/test_string.cpp:375–394  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

373namespace {
374
375void test_parse_interface(char const* input
376 , std::vector<listen_interface_t> const expected
377 , std::vector<std::string> const expected_e
378 , string_view const output)
379{
380 std::printf("parse interface: %s\n", input);
381 std::vector<std::string> err;
382 auto const list = parse_listen_interfaces(input, err);
383 TEST_EQUAL(list.size(), expected.size());
384 TEST_CHECK(list == expected);
385 TEST_CHECK(err == expected_e);
386#if TORRENT_ABI_VERSION == 1 \
387 || !defined TORRENT_DISABLE_LOGGING
388 TEST_EQUAL(print_listen_interfaces(list), output);
389 std::cout << "RESULT: " << print_listen_interfaces(list) << '\n';
390#endif
391 TORRENT_UNUSED(output);
392 for (auto const& e : err)
393 std::cout << "ERR: \"" << e << "\"\n";
394}
395
396} // anonymous namespace
397

Callers 1

TORRENT_TESTFunction · 0.85

Calls 3

parse_listen_interfacesFunction · 0.85
print_listen_interfacesFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected