X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=tst%2Fhostandport_test.cpp;h=8f0c2d2532526e5d9ffd65033ccf29e7d7a45b31;hb=2dcf940b7a815456af601cdc6fd8ebbc57bda161;hp=7b9f97b851706078be471a5eac19e806c70680b0;hpb=b7f4971cb7d84e8288140901f4a9dfa773292421;p=ric-plt%2Fsdl.git diff --git a/tst/hostandport_test.cpp b/tst/hostandport_test.cpp index 7b9f97b..8f0c2d2 100644 --- a/tst/hostandport_test.cpp +++ b/tst/hostandport_test.cpp @@ -17,6 +17,7 @@ #include #include #include "private/hostandport.hpp" +#include using namespace shareddatalayer; using namespace testing; @@ -135,3 +136,12 @@ TEST(HostAndPortTest, EmptyHostThrows) { EXPECT_THROW(HostAndPort(":1234", htons(100)), HostAndPort::EmptyHost); } + +TEST(HostAndPortTest, CanOutput) +{ + std::string expectedOutput("somehost.somesubdomain.somedomain:1234"); + std::stringstream ss; + HostAndPort hostAndPort("somehost.somesubdomain.somedomain", 1234); + ss << hostAndPort; + EXPECT_EQ(expectedOutput, ss.str()); +}