Add Sentinel configuration reading
[ric-plt/sdl.git] / tst / hostandport_test.cpp
index 7b9f97b..8f0c2d2 100644 (file)
@@ -17,6 +17,7 @@
 #include <arpa/inet.h>
 #include <gtest/gtest.h>
 #include "private/hostandport.hpp"
+#include <sstream>
 
 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());
+}