diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2016-07-23 20:50:09 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2016-07-23 20:50:09 +0000 |
commit | f3fbd1c0586ff6ec7895991e6c28f61a503c36a8 (patch) | |
tree | 48d008fd3df8c0e73271a4b18474e0aac6dbfe33 /unittests/Host/SocketTest.cpp | |
parent | 2fc5d2d1dfaf623ce4e24cd8590565902f8c557c (diff) |
Notes
Diffstat (limited to 'unittests/Host/SocketTest.cpp')
-rw-r--r-- | unittests/Host/SocketTest.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/unittests/Host/SocketTest.cpp b/unittests/Host/SocketTest.cpp index ebb2f319a9c5..e3e522744760 100644 --- a/unittests/Host/SocketTest.cpp +++ b/unittests/Host/SocketTest.cpp @@ -116,7 +116,11 @@ TEST_F (SocketTest, DecodeHostAndPort) EXPECT_FALSE (Socket::DecodeHostAndPort ("google.com:-1138", host_str, port_str, port, &error)); EXPECT_TRUE (error.Fail ()); EXPECT_STREQ ("invalid host:port specification: 'google.com:-1138'", error.AsCString ()); - + + EXPECT_FALSE(Socket::DecodeHostAndPort("google.com:65536", host_str, port_str, port, &error)); + EXPECT_TRUE(error.Fail()); + EXPECT_STREQ("invalid host:port specification: 'google.com:65536'", error.AsCString()); + EXPECT_TRUE (Socket::DecodeHostAndPort ("12345", host_str, port_str, port, &error)); EXPECT_STREQ ("", host_str.c_str ()); EXPECT_STREQ ("12345", port_str.c_str ()); @@ -128,6 +132,12 @@ TEST_F (SocketTest, DecodeHostAndPort) EXPECT_STREQ ("0", port_str.c_str ()); EXPECT_EQ (0, port); EXPECT_TRUE (error.Success ()); + + EXPECT_TRUE(Socket::DecodeHostAndPort("*:65535", host_str, port_str, port, &error)); + EXPECT_STREQ("*", host_str.c_str()); + EXPECT_STREQ("65535", port_str.c_str()); + EXPECT_EQ(65535, port); + EXPECT_TRUE(error.Success()); } #ifndef LLDB_DISABLE_POSIX |