2010-10-04 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

Use inet_ntoa if inet_ntop is not available. Since inet_ntoa does
	not handle IPv6 address, IPv6 support is limited in this
	case. Fixed unit test error under mingw32.
	* configure.ac
	* src/AsyncNameResolver.cc
	* src/SocketCore.cc
	* src/bittorrent_helper.cc
	* test/BittorrentHelperTest.cc
	* test/DHTMessageFactoryImplTest.cc
	* test/DHTRoutingTableDeserializerTest.cc
	* test/DHTRoutingTableSerializerTest.cc
	* test/DefaultBtAnnounceTest.cc
	* test/Metalink2RequestGroupTest.cc
	* test/UTPexExtensionMessageTest.cc
This commit is contained in:
Tatsuhiro Tsujikawa 2010-10-04 14:33:49 +00:00
parent 329de2a9b5
commit 5db7b123b5
14 changed files with 98 additions and 6 deletions

View file

@ -31,10 +31,14 @@ class DHTMessageFactoryImplTest:public CppUnit::TestFixture {
CPPUNIT_TEST(testCreatePingReplyMessage);
CPPUNIT_TEST(testCreateFindNodeMessage);
CPPUNIT_TEST(testCreateFindNodeReplyMessage);
#ifdef HAVE_INET_NTOP
CPPUNIT_TEST(testCreateFindNodeReplyMessage6);
#endif // HAVE_INET_NTOP
CPPUNIT_TEST(testCreateGetPeersMessage);
CPPUNIT_TEST(testCreateGetPeersReplyMessage);
#ifdef HAVE_INET_NTOP
CPPUNIT_TEST(testCreateGetPeersReplyMessage6);
#endif // HAVE_INET_NTOP
CPPUNIT_TEST(testCreateAnnouncePeerMessage);
CPPUNIT_TEST(testCreateAnnouncePeerReplyMessage);
CPPUNIT_TEST(testReceivedErrorMessage);
@ -204,6 +208,7 @@ void DHTMessageFactoryImplTest::testCreateFindNodeReplyMessage()
}
}
#ifdef HAVE_INET_NTOP
void DHTMessageFactoryImplTest::testCreateFindNodeReplyMessage6()
{
factory.reset(new DHTMessageFactoryImpl(AF_INET6));
@ -255,6 +260,7 @@ void DHTMessageFactoryImplTest::testCreateFindNodeReplyMessage6()
CPPUNIT_FAIL(e.stackTrace());
}
}
#endif // HAVE_INET_NTOP
void DHTMessageFactoryImplTest::testCreateGetPeersMessage()
{
@ -353,6 +359,7 @@ void DHTMessageFactoryImplTest::testCreateGetPeersReplyMessage()
}
}
#ifdef HAVE_INET_NTOP
void DHTMessageFactoryImplTest::testCreateGetPeersReplyMessage6()
{
factory.reset(new DHTMessageFactoryImpl(AF_INET6));
@ -424,6 +431,7 @@ void DHTMessageFactoryImplTest::testCreateGetPeersReplyMessage6()
CPPUNIT_FAIL(e.stackTrace());
}
}
#endif // HAVE_INET_NTOP
void DHTMessageFactoryImplTest::testCreateAnnouncePeerMessage()
{