aboutsummaryrefslogtreecommitdiffstats
path: root/util/system/hostname_ut.cpp
blob: 03eacb8aebba34b7e4a756e5a098faddf12b063b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include "hostname.h"

#include <library/cpp/testing/unittest/registar.h>

Y_UNIT_TEST_SUITE(THostNameTest) {
    Y_UNIT_TEST(Test1) {
        UNIT_ASSERT(*GetHostName() != '?');
    }
 
    Y_UNIT_TEST(TestFQDN) {
        UNIT_ASSERT(*GetFQDNHostName() != '?');
    }
 
    Y_UNIT_TEST(TestIsFQDN) {
        const auto x = GetFQDNHostName();

        try {
            UNIT_ASSERT(IsFQDN(x));
        } catch (...) {
            Cerr << x << Endl;

            throw;
        }
    }
};