netaddr_ut.cpp 503 B

123456789101112131415161718192021
  1. #include <library/cpp/testing/unittest/registar.h>
  2. #include "netaddr.h"
  3. #include "test_utils.h"
  4. using namespace NBus;
  5. Y_UNIT_TEST_SUITE(TNetAddr) {
  6. Y_UNIT_TEST(ResolveIpv4) {
  7. ASSUME_IP_V4_ENABLED;
  8. UNIT_ASSERT(TNetAddr("ns1.yandex.ru", 80, EIP_VERSION_4).IsIpv4());
  9. }
  10. Y_UNIT_TEST(ResolveIpv6) {
  11. UNIT_ASSERT(TNetAddr("ns1.yandex.ru", 80, EIP_VERSION_6).IsIpv6());
  12. }
  13. Y_UNIT_TEST(ResolveAny) {
  14. TNetAddr("ns1.yandex.ru", 80, EIP_VERSION_ANY);
  15. }
  16. }