diff options
author | Pavel Labath <labath@google.com> | 2017-02-10 12:21:22 +0000 |
---|---|---|
committer | Pavel Labath <labath@google.com> | 2017-02-10 12:21:22 +0000 |
commit | 5f7e583b33759eab244e0e1a29a4e5ebb778d6a8 (patch) | |
tree | 90224a3562f697978ade2c1ee55093c9e69bc4fe /lldb/unittests/Utility | |
parent | 463cb8ac30d0473c96d51bfd279589b1ff920cc8 (diff) | |
download | bcm5719-llvm-5f7e583b33759eab244e0e1a29a4e5ebb778d6a8.tar.gz bcm5719-llvm-5f7e583b33759eab244e0e1a29a4e5ebb778d6a8.zip |
UriParser cleanup
- move the header file to the include folder
- enclose the class in the proper namespace
llvm-svn: 294741
Diffstat (limited to 'lldb/unittests/Utility')
-rw-r--r-- | lldb/unittests/Utility/UriParserTest.cpp | 40 |
1 files changed, 19 insertions, 21 deletions
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" |