diff options
author | Remko Tronçon <git@el-tramo.be> | 2010-12-06 21:00:51 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2010-12-06 21:01:49 (GMT) |
commit | 519b8c8767ce938eaa5990d71e5e8901069874f7 (patch) | |
tree | 48862e687ac334d8c04f8aa1d802e329fdaf47f5 /Swiften/QA/NetworkTest/BoostConnectionTest.cpp | |
parent | 4fc7861cebaa82e5057a7ff7d385b49b79e442a4 (diff) | |
download | swift-contrib-519b8c8767ce938eaa5990d71e5e8901069874f7.zip swift-contrib-519b8c8767ce938eaa5990d71e5e8901069874f7.tar.bz2 |
Added IPv6 test.
Diffstat (limited to 'Swiften/QA/NetworkTest/BoostConnectionTest.cpp')
-rw-r--r-- | Swiften/QA/NetworkTest/BoostConnectionTest.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Swiften/QA/NetworkTest/BoostConnectionTest.cpp b/Swiften/QA/NetworkTest/BoostConnectionTest.cpp index 6d6fddf..0f7f742 100644 --- a/Swiften/QA/NetworkTest/BoostConnectionTest.cpp +++ b/Swiften/QA/NetworkTest/BoostConnectionTest.cpp @@ -25,6 +25,9 @@ class BoostConnectionTest : public CppUnit::TestFixture { CPPUNIT_TEST(testDestructor); CPPUNIT_TEST(testDestructor_PendingEvents); CPPUNIT_TEST(testWrite); +#ifdef TEST_IPV6 + CPPUNIT_TEST(testWrite_IPv6); +#endif CPPUNIT_TEST_SUITE_END(); public: @@ -72,6 +75,19 @@ class BoostConnectionTest : public CppUnit::TestFixture { testling->disconnect(); } + void testWrite_IPv6() { + BoostConnection::ref testling(BoostConnection::create(&boostIOServiceThread_->getIOService(), eventLoop_)); + testling->onConnectFinished.connect(boost::bind(&BoostConnectionTest::doWrite, this, testling.get())); + testling->onDataRead.connect(boost::bind(&BoostConnectionTest::handleDataRead, this, _1)); + testling->onDisconnected.connect(boost::bind(&BoostConnectionTest::handleDisconnected, this)); + testling->connect(HostAddressPort(HostAddress("2001:470:1f0e:852::2"), 80)); + while (receivedData.isEmpty()) { + Swift::sleep(10); + eventLoop_->processEvents(); + } + testling->disconnect(); + } + void doWrite(BoostConnection* connection) { connection->write(ByteArray("<stream:stream>")); } |