diff options
author | Pavel Labath <labath@google.com> | 2016-02-03 11:12:23 +0000 |
---|---|---|
committer | Pavel Labath <labath@google.com> | 2016-02-03 11:12:23 +0000 |
commit | 1b58f5cbbb757bea043b863e52fc10e6e7dd7f90 (patch) | |
tree | c7c5fd121a1d330edf2802663f22c5ebd629b41a /lldb/unittests/Host/SocketTest.cpp | |
parent | 323862e13ca421175b82617977f80b88e9f6cfe9 (diff) | |
download | bcm5719-llvm-1b58f5cbbb757bea043b863e52fc10e6e7dd7f90.tar.gz bcm5719-llvm-1b58f5cbbb757bea043b863e52fc10e6e7dd7f90.zip |
Fix an off-by-one in SocketTest::DecodeHostAndPort
65535 is still a valid port. This should fix the android failures we were getting when we chose
to connect over 65535 to the remote lldb-server.
llvm-svn: 259638
Diffstat (limited to 'lldb/unittests/Host/SocketTest.cpp')
-rw-r--r-- | lldb/unittests/Host/SocketTest.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lldb/unittests/Host/SocketTest.cpp b/lldb/unittests/Host/SocketTest.cpp index ebb2f319a9c..e3e52274476 100644 --- a/lldb/unittests/Host/SocketTest.cpp +++ b/lldb/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 |