memgraph/tests/unit/utils_network.cpp
Dominik Gleich 5418dfb19e Rename NetworkEndpoint
Summary:
Rename redunant port str

Add endpoint << operator

Migrate everything to endpoint

Reviewers: mferencevic, florijan

Reviewed By: mferencevic

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D1100
2018-01-15 15:47:37 +01:00

22 lines
478 B
C++

#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "utils/network.hpp"
using namespace utils;
TEST(ResolveHostname, Simple) {
auto result = ResolveHostname("localhost");
EXPECT_TRUE(result == "127.0.0.1" || result == "::1");
}
TEST(ResolveHostname, PassThroughIpv4) {
auto result = ResolveHostname("127.0.0.1");
EXPECT_EQ(result, "127.0.0.1");
}
TEST(ResolveHostname, PassThroughIpv6) {
auto result = ResolveHostname("::1");
EXPECT_EQ(result, "::1");
}