aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/messagebus/netaddr_ut.cpp
blob: 63b688e53be4789e310f4cafb2100ccc460037d9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <library/cpp/testing/unittest/registar.h>

#include "netaddr.h"
#include "test_utils.h"

using namespace NBus;

Y_UNIT_TEST_SUITE(TNetAddr) { 
    Y_UNIT_TEST(ResolveIpv4) { 
        ASSUME_IP_V4_ENABLED;
        UNIT_ASSERT(TNetAddr("ns1.yandex.ru", 80, EIP_VERSION_4).IsIpv4());
    }

    Y_UNIT_TEST(ResolveIpv6) { 
        UNIT_ASSERT(TNetAddr("ns1.yandex.ru", 80, EIP_VERSION_6).IsIpv6());
    }

    Y_UNIT_TEST(ResolveAny) { 
        TNetAddr("ns1.yandex.ru", 80, EIP_VERSION_ANY);
    }
}