summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2012-09-17 11:52:40 (GMT)
committerRemko Tronçon <git@el-tramo.be>2012-09-17 18:01:27 (GMT)
commitd1aaf7fc9b9da32f04f84eef06bc0ee731e79223 (patch)
tree14ecd64cfd4b44e2664170983a5a0fefc47a03fd /Swiften/Base/UnitTest/URLTest.cpp
parent3d6aa3b50090c19b50ae488494f1459bade88da3 (diff)
downloadswift-contrib-d1aaf7fc9b9da32f04f84eef06bc0ee731e79223.zip
swift-contrib-d1aaf7fc9b9da32f04f84eef06bc0ee731e79223.tar.bz2
Fixed URL parsing/serializing.
Resolves: #1157,#1158
Diffstat (limited to 'Swiften/Base/UnitTest/URLTest.cpp')
-rw-r--r--Swiften/Base/UnitTest/URLTest.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/Swiften/Base/UnitTest/URLTest.cpp b/Swiften/Base/UnitTest/URLTest.cpp
index 4de1d33..55c81f6 100644
--- a/Swiften/Base/UnitTest/URLTest.cpp
+++ b/Swiften/Base/UnitTest/URLTest.cpp
@@ -21,6 +21,8 @@ class URLTest : public CppUnit::TestFixture {
CPPUNIT_TEST(testFromString_WithUserInfo);
CPPUNIT_TEST(testFromString_NonASCIIHost);
CPPUNIT_TEST(testFromString_NonASCIIPath);
+ CPPUNIT_TEST(testToString);
+ CPPUNIT_TEST(testToString_WithPort);
CPPUNIT_TEST_SUITE_END();
public:
@@ -79,6 +81,14 @@ class URLTest : public CppUnit::TestFixture {
CPPUNIT_ASSERT_EQUAL(std::string("/baz/tron\xc3\xa7on/bam"), url.getPath());
}
+
+ void testToString() {
+ CPPUNIT_ASSERT_EQUAL(std::string("http://foo.bar/baz/bam"), URL("http", "foo.bar", "/baz/bam").toString());
+ }
+
+ void testToString_WithPort() {
+ CPPUNIT_ASSERT_EQUAL(std::string("http://foo.bar:1234/baz/bam"), URL("http", "foo.bar", 1234, "/baz/bam").toString());
+ }
};
CPPUNIT_TEST_SUITE_REGISTRATION(URLTest);