Rephrase release notes introduction
[ric-plt/sdl.git] / tst / hostandport_test.cpp
index 7b9f97b..beab275 100644 (file)
    limitations under the License.
 */
 
+/*
+ * This source code is part of the near-RT RIC (RAN Intelligent Controller)
+ * platform project (RICP).
+*/
+
 #include <arpa/inet.h>
 #include <gtest/gtest.h>
 #include "private/hostandport.hpp"
+#include <sstream>
 
 using namespace shareddatalayer;
 using namespace testing;
@@ -135,3 +141,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());
+}