hostname_ut.cpp 521 B

12345678910111213141516171819202122232425
  1. #include "hostname.h"
  2. #include <library/cpp/testing/unittest/registar.h>
  3. Y_UNIT_TEST_SUITE(THostNameTest) {
  4. Y_UNIT_TEST(Test1) {
  5. UNIT_ASSERT(*GetHostName() != '?');
  6. }
  7. Y_UNIT_TEST(TestFQDN) {
  8. UNIT_ASSERT(*GetFQDNHostName() != '?');
  9. }
  10. Y_UNIT_TEST(TestIsFQDN) {
  11. const auto x = GetFQDNHostName();
  12. try {
  13. UNIT_ASSERT(IsFQDN(x));
  14. } catch (...) {
  15. Cerr << x << Endl;
  16. throw;
  17. }
  18. }
  19. } // Y_UNIT_TEST_SUITE(THostNameTest)