| 373 | namespace { |
| 374 | |
| 375 | void 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 |
no test coverage detected