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;
{
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());
+}