diff options
| -rw-r--r-- | lldb/include/lldb/Utility/UriParser.h (renamed from lldb/source/Utility/UriParser.h) | 8 | ||||
| -rw-r--r-- | lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp | 5 | ||||
| -rw-r--r-- | lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp | 2 | ||||
| -rw-r--r-- | lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp | 3 | ||||
| -rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp | 2 | ||||
| -rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp | 2 | ||||
| -rw-r--r-- | lldb/source/Utility/UriParser.cpp | 11 | ||||
| -rw-r--r-- | lldb/tools/lldb-server/Acceptor.cpp | 3 | ||||
| -rw-r--r-- | lldb/unittests/Utility/UriParserTest.cpp | 40 |
9 files changed, 28 insertions, 48 deletions
diff --git a/lldb/source/Utility/UriParser.h b/lldb/include/lldb/Utility/UriParser.h index 7ebf76f89ca..db0049d9684 100644 --- a/lldb/source/Utility/UriParser.h +++ b/lldb/include/lldb/Utility/UriParser.h @@ -10,14 +10,9 @@ #ifndef utility_UriParser_h_ #define utility_UriParser_h_ -// C Includes -// C++ Includes - -// Other libraries and framework includes #include "llvm/ADT/StringRef.h" -// Project includes - +namespace lldb_private { class UriParser { public: // Parses @@ -32,5 +27,6 @@ public: llvm::StringRef &hostname, int &port, llvm::StringRef &path); }; +} #endif // utility_UriParser_h_ diff --git a/lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp b/lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp index 64a320f8c3f..94dc564988c 100644 --- a/lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp +++ b/lldb/source/Plugins/Platform/Android/PlatformAndroid.cpp @@ -7,10 +7,6 @@ // //===----------------------------------------------------------------------===// -// C Includes -// C++ Includes -// Other libraries and framework includes -#include "Utility/UriParser.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" #include "lldb/Core/PluginManager.h" @@ -19,6 +15,7 @@ #include "lldb/Core/ValueObject.h" #include "lldb/Host/HostInfo.h" #include "lldb/Host/StringConvert.h" +#include "lldb/Utility/UriParser.h" // Project includes #include "AdbClient.h" diff --git a/lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp b/lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp index 7f824ba8901..3e075d25d49 100644 --- a/lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp +++ b/lldb/source/Plugins/Platform/Android/PlatformAndroidRemoteGDBServer.cpp @@ -12,9 +12,9 @@ #include "lldb/Host/ConnectionFileDescriptor.h" #include "lldb/Host/common/TCPSocket.h" #include "lldb/Utility/Error.h" +#include "lldb/Utility/UriParser.h" #include "PlatformAndroidRemoteGDBServer.h" -#include "Utility/UriParser.h" #include <sstream> diff --git a/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp b/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp index 607d3fded39..d7800db5f2f 100644 --- a/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp +++ b/lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp @@ -30,8 +30,7 @@ #include "lldb/Target/Target.h" #include "lldb/Utility/Error.h" #include "lldb/Utility/StreamString.h" - -#include "Utility/UriParser.h" +#include "lldb/Utility/UriParser.h" #include "Plugins/Process/Utility/GDBRemoteSignals.h" diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp index 498f2df0f10..2debf6d1af0 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp @@ -42,6 +42,7 @@ #include "lldb/Utility/JSON.h" #include "lldb/Utility/LLDBAssert.h" #include "lldb/Utility/StreamString.h" +#include "lldb/Utility/UriParser.h" #include "llvm/ADT/Triple.h" #include "llvm/Support/ScopedPrinter.h" @@ -49,7 +50,6 @@ #include "ProcessGDBRemote.h" #include "ProcessGDBRemoteLog.h" #include "Utility/StringExtractorGDBRemote.h" -#include "Utility/UriParser.h" using namespace lldb; using namespace lldb_private; diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp index 67e4c653946..43129d407e9 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerPlatform.cpp @@ -36,10 +36,10 @@ #include "lldb/Target/UnixSignals.h" #include "lldb/Utility/JSON.h" #include "lldb/Utility/StreamString.h" +#include "lldb/Utility/UriParser.h" // Project includes #include "Utility/StringExtractorGDBRemote.h" -#include "Utility/UriParser.h" using namespace lldb; using namespace lldb_private; diff --git a/lldb/source/Utility/UriParser.cpp b/lldb/source/Utility/UriParser.cpp index a1d6e4c3d85..081d189f7f5 100644 --- a/lldb/source/Utility/UriParser.cpp +++ b/lldb/source/Utility/UriParser.cpp @@ -7,16 +7,7 @@ // //===----------------------------------------------------------------------===// -#include "Utility/UriParser.h" - -// C Includes - -// C++ Includes -#include <cstring> - -// Other libraries and framework includes -// Project includes -#include "lldb/Host/StringConvert.h" +#include "lldb/Utility/UriParser.h" using namespace lldb_private; diff --git a/lldb/tools/lldb-server/Acceptor.cpp b/lldb/tools/lldb-server/Acceptor.cpp index 46096549921..e6e73f8bdb6 100644 --- a/lldb/tools/lldb-server/Acceptor.cpp +++ b/lldb/tools/lldb-server/Acceptor.cpp @@ -15,8 +15,7 @@ #include "lldb/Host/ConnectionFileDescriptor.h" #include "lldb/Host/common/TCPSocket.h" #include "lldb/Utility/StreamString.h" - -#include "Utility/UriParser.h" +#include "lldb/Utility/UriParser.h" using namespace lldb; using namespace lldb_private; diff --git a/lldb/unittests/Utility/UriParserTest.cpp b/lldb/unittests/Utility/UriParserTest.cpp index 8b08e63eb8c..c07d59a55e0 100644 --- a/lldb/unittests/Utility/UriParserTest.cpp +++ b/lldb/unittests/Utility/UriParserTest.cpp @@ -1,9 +1,7 @@ -#include "Utility/UriParser.h" +#include "lldb/Utility/UriParser.h" #include "gtest/gtest.h" -namespace { -class UriParserTest : public ::testing::Test {}; -} +using namespace lldb_private; // result strings (scheme/hostname/port/path) passed into UriParser::Parse // are initialized to kAsdf so we can verify that they are unmodified if the @@ -41,12 +39,12 @@ public: EXPECT_EQ(testCase.m_port, port); \ EXPECT_STREQ(testCase.m_path, path.str().c_str()); -TEST_F(UriParserTest, Minimal) { +TEST(UriParserTest, Minimal) { const UriTestCase testCase("x://y", "x", "y", -1, "/"); VALIDATE } -TEST_F(UriParserTest, MinimalPort) { +TEST(UriParserTest, MinimalPort) { const UriTestCase testCase("x://y:1", "x", "y", 1, "/"); llvm::StringRef scheme(kAsdf); llvm::StringRef hostname(kAsdf); @@ -61,28 +59,28 @@ TEST_F(UriParserTest, MinimalPort) { EXPECT_STREQ(testCase.m_path, path.str().c_str()); } -TEST_F(UriParserTest, MinimalPath) { +TEST(UriParserTest, MinimalPath) { const UriTestCase testCase("x://y/", "x", "y", -1, "/"); VALIDATE } -TEST_F(UriParserTest, MinimalPortPath) { +TEST(UriParserTest, MinimalPortPath) { const UriTestCase testCase("x://y:1/", "x", "y", 1, "/"); VALIDATE } -TEST_F(UriParserTest, LongPath) { +TEST(UriParserTest, LongPath) { const UriTestCase testCase("x://y/abc/def/xyz", "x", "y", -1, "/abc/def/xyz"); VALIDATE } -TEST_F(UriParserTest, TypicalPortPath) { +TEST(UriParserTest, TypicalPortPath) { const UriTestCase testCase("connect://192.168.100.132:5432/", "connect", "192.168.100.132", 5432, "/"); VALIDATE; } -TEST_F(UriParserTest, BracketedHostnamePort) { +TEST(UriParserTest, BracketedHostnamePort) { const UriTestCase testCase("connect://[192.168.100.132]:5432/", "connect", "192.168.100.132", 5432, "/"); llvm::StringRef scheme(kAsdf); @@ -98,54 +96,54 @@ TEST_F(UriParserTest, BracketedHostnamePort) { EXPECT_STREQ(testCase.m_path, path.str().c_str()); } -TEST_F(UriParserTest, BracketedHostname) { +TEST(UriParserTest, BracketedHostname) { const UriTestCase testCase("connect://[192.168.100.132]", "connect", "192.168.100.132", -1, "/"); VALIDATE } -TEST_F(UriParserTest, BracketedHostnameWithColon) { +TEST(UriParserTest, BracketedHostnameWithColon) { const UriTestCase testCase("connect://[192.168.100.132:5555]:1234", "connect", "192.168.100.132:5555", 1234, "/"); VALIDATE } -TEST_F(UriParserTest, SchemeHostSeparator) { +TEST(UriParserTest, SchemeHostSeparator) { const UriTestCase testCase("x:/y"); VALIDATE } -TEST_F(UriParserTest, SchemeHostSeparator2) { +TEST(UriParserTest, SchemeHostSeparator2) { const UriTestCase testCase("x:y"); VALIDATE } -TEST_F(UriParserTest, SchemeHostSeparator3) { +TEST(UriParserTest, SchemeHostSeparator3) { const UriTestCase testCase("x//y"); VALIDATE } -TEST_F(UriParserTest, SchemeHostSeparator4) { +TEST(UriParserTest, SchemeHostSeparator4) { const UriTestCase testCase("x/y"); VALIDATE } -TEST_F(UriParserTest, BadPort) { +TEST(UriParserTest, BadPort) { const UriTestCase testCase("x://y:a/"); VALIDATE } -TEST_F(UriParserTest, BadPort2) { +TEST(UriParserTest, BadPort2) { const UriTestCase testCase("x://y:5432a/"); VALIDATE } -TEST_F(UriParserTest, Empty) { +TEST(UriParserTest, Empty) { const UriTestCase testCase(""); VALIDATE } -TEST_F(UriParserTest, PortOverflow) { +TEST(UriParserTest, PortOverflow) { const UriTestCase testCase("x://" "y:" "0123456789012345678901234567890123456789012345678" |

