diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2010-11-11 07:33:43 +0000 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2010-11-11 07:33:43 +0000 |
| commit | bc98e39fe5ed30c03ba3af36f46f74e10f03e635 (patch) | |
| tree | 15b13a4dd63c0f5a3892c80aba7d0a4d72da65f4 /test/DHTMessageFactoryImplTest.cc | |
| parent | bcf4593bda20504f026e359413f226519cbb8d37 (diff) | |
2010-11-11 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>
To match the behavior of friend operator functions in
SharedHandle.h to std::tr1::shared_ptr, we intentionally broke
these functions and modified code so that our code does not depend
on old behavior.
* src/AbstractCommand.cc
* src/DHTAbstractNodeLookupTask.h
* src/DHTBucket.cc
* src/DHTMessageReceiver.cc
* src/DHTNodeLookupEntry.cc
* src/DHTRoutingTable.cc
* src/DefaultBtRequestFactory.cc
* src/DefaultPeerStorage.cc
* src/DefaultPieceStorage.cc
* src/DownloadContext.cc
* src/EpollEventPoll.cc
* src/Event.h
* src/HttpConnection.cc
* src/KqueueEventPoll.cc
* src/MultiDiskAdaptor.cc
* src/PeerAbstractCommand.cc
* src/PieceStatMan.cc
* src/PollEventPoll.cc
* src/PortEventPoll.cc
* src/SegmentMan.cc
* src/SelectEventPoll.cc
* src/SelectEventPoll.h
* src/ServerStatMan.cc
* src/SharedHandle.h
* src/UnknownLengthPieceStorage.cc
* src/a2functional.h
* src/option_processing.cc
* src/version_usage.cc
* test/BNodeTest.cc
* test/DHTAnnouncePeerMessageTest.cc
* test/DHTBucketTest.cc
* test/DHTFindNodeMessageTest.cc
* test/DHTGetPeersMessageTest.cc
* test/DHTIDCloserTest.cc
* test/DHTMessageFactoryImplTest.cc
* test/DHTPingMessageTest.cc
* test/DefaultBtRequestFactoryTest.cc
* test/DefaultPeerStorageTest.cc
* test/SequentialPickerTest.cc
* test/SingletonHolderTest.cc
Diffstat (limited to 'test/DHTMessageFactoryImplTest.cc')
| -rw-r--r-- | test/DHTMessageFactoryImplTest.cc | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/test/DHTMessageFactoryImplTest.cc b/test/DHTMessageFactoryImplTest.cc index c28b80de..f2515158 100644 --- a/test/DHTMessageFactoryImplTest.cc +++ b/test/DHTMessageFactoryImplTest.cc @@ -100,8 +100,8 @@ void DHTMessageFactoryImplTest::testCreatePingMessage() remoteNode->setIPAddress("192.168.0.1"); remoteNode->setPort(6881); - CPPUNIT_ASSERT(localNode == m->getLocalNode()); - CPPUNIT_ASSERT(remoteNode == m->getRemoteNode()); + CPPUNIT_ASSERT(*localNode == *m->getLocalNode()); + CPPUNIT_ASSERT(*remoteNode == *m->getRemoteNode()); CPPUNIT_ASSERT_EQUAL(util::toHex(transactionID, DHT_TRANSACTION_ID_LENGTH), util::toHex(m->getTransactionID())); } @@ -125,8 +125,8 @@ void DHTMessageFactoryImplTest::testCreatePingReplyMessage() remoteNode->getIPAddress(), remoteNode->getPort()))); - CPPUNIT_ASSERT(localNode == m->getLocalNode()); - CPPUNIT_ASSERT(remoteNode == m->getRemoteNode()); + CPPUNIT_ASSERT(*localNode == *m->getLocalNode()); + CPPUNIT_ASSERT(*remoteNode == *m->getRemoteNode()); CPPUNIT_ASSERT_EQUAL(util::toHex(transactionID, DHT_TRANSACTION_ID_LENGTH), util::toHex(m->getTransactionID())); } @@ -151,8 +151,8 @@ void DHTMessageFactoryImplTest::testCreateFindNodeMessage() remoteNode->setIPAddress("192.168.0.1"); remoteNode->setPort(6881); - CPPUNIT_ASSERT(localNode == m->getLocalNode()); - CPPUNIT_ASSERT(remoteNode == m->getRemoteNode()); + CPPUNIT_ASSERT(*localNode == *m->getLocalNode()); + CPPUNIT_ASSERT(*remoteNode == *m->getRemoteNode()); CPPUNIT_ASSERT_EQUAL(util::toHex(transactionID, DHT_TRANSACTION_ID_LENGTH), util::toHex(m->getTransactionID())); CPPUNIT_ASSERT_EQUAL(util::toHex(targetNodeID, DHT_ID_LENGTH), @@ -196,11 +196,11 @@ void DHTMessageFactoryImplTest::testCreateFindNodeReplyMessage() remoteNode->getIPAddress(), remoteNode->getPort()))); - CPPUNIT_ASSERT(localNode == m->getLocalNode()); - CPPUNIT_ASSERT(remoteNode == m->getRemoteNode()); + CPPUNIT_ASSERT(*localNode == *m->getLocalNode()); + CPPUNIT_ASSERT(*remoteNode == *m->getRemoteNode()); CPPUNIT_ASSERT_EQUAL((size_t)DHTBucket::K, m->getClosestKNodes().size()); - CPPUNIT_ASSERT(nodes[0] == m->getClosestKNodes()[0]); - CPPUNIT_ASSERT(nodes[7] == m->getClosestKNodes()[7]); + CPPUNIT_ASSERT(*nodes[0] == *m->getClosestKNodes()[0]); + CPPUNIT_ASSERT(*nodes[7] == *m->getClosestKNodes()[7]); CPPUNIT_ASSERT_EQUAL(util::toHex(transactionID, DHT_TRANSACTION_ID_LENGTH), util::toHex(m->getTransactionID())); } catch(Exception& e) { @@ -249,11 +249,11 @@ void DHTMessageFactoryImplTest::testCreateFindNodeReplyMessage6() remoteNode->getIPAddress(), remoteNode->getPort()))); - CPPUNIT_ASSERT(localNode == m->getLocalNode()); - CPPUNIT_ASSERT(remoteNode == m->getRemoteNode()); + CPPUNIT_ASSERT(*localNode == *m->getLocalNode()); + CPPUNIT_ASSERT(*remoteNode == *m->getRemoteNode()); CPPUNIT_ASSERT_EQUAL((size_t)DHTBucket::K, m->getClosestKNodes().size()); - CPPUNIT_ASSERT(nodes[0] == m->getClosestKNodes()[0]); - CPPUNIT_ASSERT(nodes[7] == m->getClosestKNodes()[7]); + CPPUNIT_ASSERT(*nodes[0] == *m->getClosestKNodes()[0]); + CPPUNIT_ASSERT(*nodes[7] == *m->getClosestKNodes()[7]); CPPUNIT_ASSERT_EQUAL(util::toHex(transactionID, DHT_TRANSACTION_ID_LENGTH), util::toHex(m->getTransactionID())); } catch(Exception& e) { @@ -282,8 +282,8 @@ void DHTMessageFactoryImplTest::testCreateGetPeersMessage() remoteNode->setIPAddress("192.168.0.1"); remoteNode->setPort(6881); - CPPUNIT_ASSERT(localNode == m->getLocalNode()); - CPPUNIT_ASSERT(remoteNode == m->getRemoteNode()); + CPPUNIT_ASSERT(*localNode == *m->getLocalNode()); + CPPUNIT_ASSERT(*remoteNode == *m->getRemoteNode()); CPPUNIT_ASSERT_EQUAL(util::toHex(transactionID, DHT_TRANSACTION_ID_LENGTH), util::toHex(m->getTransactionID())); CPPUNIT_ASSERT_EQUAL(util::toHex(infoHash, DHT_ID_LENGTH), @@ -343,15 +343,15 @@ void DHTMessageFactoryImplTest::testCreateGetPeersReplyMessage() remoteNode->getIPAddress(), remoteNode->getPort()))); - CPPUNIT_ASSERT(localNode == m->getLocalNode()); - CPPUNIT_ASSERT(remoteNode == m->getRemoteNode()); + CPPUNIT_ASSERT(*localNode == *m->getLocalNode()); + CPPUNIT_ASSERT(*remoteNode == *m->getRemoteNode()); CPPUNIT_ASSERT_EQUAL(std::string("token"), m->getToken()); CPPUNIT_ASSERT_EQUAL((size_t)DHTBucket::K, m->getClosestKNodes().size()); - CPPUNIT_ASSERT(nodes[0] == m->getClosestKNodes()[0]); - CPPUNIT_ASSERT(nodes[7] == m->getClosestKNodes()[7]); + CPPUNIT_ASSERT(*nodes[0] == *m->getClosestKNodes()[0]); + CPPUNIT_ASSERT(*nodes[7] == *m->getClosestKNodes()[7]); CPPUNIT_ASSERT_EQUAL((size_t)4, m->getValues().size()); - CPPUNIT_ASSERT(peers[0] == m->getValues()[0]); - CPPUNIT_ASSERT(peers[3] == m->getValues()[3]); + CPPUNIT_ASSERT(*peers[0] == *m->getValues()[0]); + CPPUNIT_ASSERT(*peers[3] == *m->getValues()[3]); CPPUNIT_ASSERT_EQUAL(util::toHex(transactionID, DHT_TRANSACTION_ID_LENGTH), util::toHex(m->getTransactionID())); } catch(Exception& e) { @@ -416,15 +416,15 @@ void DHTMessageFactoryImplTest::testCreateGetPeersReplyMessage6() remoteNode->getIPAddress(), remoteNode->getPort()))); - CPPUNIT_ASSERT(localNode == m->getLocalNode()); - CPPUNIT_ASSERT(remoteNode == m->getRemoteNode()); + CPPUNIT_ASSERT(*localNode == *m->getLocalNode()); + CPPUNIT_ASSERT(*remoteNode == *m->getRemoteNode()); CPPUNIT_ASSERT_EQUAL(std::string("token"), m->getToken()); CPPUNIT_ASSERT_EQUAL((size_t)DHTBucket::K, m->getClosestKNodes().size()); - CPPUNIT_ASSERT(nodes[0] == m->getClosestKNodes()[0]); - CPPUNIT_ASSERT(nodes[7] == m->getClosestKNodes()[7]); + CPPUNIT_ASSERT(*nodes[0] == *m->getClosestKNodes()[0]); + CPPUNIT_ASSERT(*nodes[7] == *m->getClosestKNodes()[7]); CPPUNIT_ASSERT_EQUAL((size_t)4, m->getValues().size()); - CPPUNIT_ASSERT(peers[0] == m->getValues()[0]); - CPPUNIT_ASSERT(peers[3] == m->getValues()[3]); + CPPUNIT_ASSERT(*peers[0] == *m->getValues()[0]); + CPPUNIT_ASSERT(*peers[3] == *m->getValues()[3]); CPPUNIT_ASSERT_EQUAL(util::toHex(transactionID, DHT_TRANSACTION_ID_LENGTH), util::toHex(m->getTransactionID())); } catch(Exception& e) { @@ -458,8 +458,8 @@ void DHTMessageFactoryImplTest::testCreateAnnouncePeerMessage() remoteNode->setIPAddress("192.168.0.1"); remoteNode->setPort(6882); - CPPUNIT_ASSERT(localNode == m->getLocalNode()); - CPPUNIT_ASSERT(remoteNode == m->getRemoteNode()); + CPPUNIT_ASSERT(*localNode == *m->getLocalNode()); + CPPUNIT_ASSERT(*remoteNode == *m->getRemoteNode()); CPPUNIT_ASSERT_EQUAL(token, m->getToken()); CPPUNIT_ASSERT_EQUAL(util::toHex(transactionID, DHT_TRANSACTION_ID_LENGTH), util::toHex(m->getTransactionID())); @@ -490,8 +490,8 @@ void DHTMessageFactoryImplTest::testCreateAnnouncePeerReplyMessage() remoteNode->getIPAddress(), remoteNode->getPort()))); - CPPUNIT_ASSERT(localNode == m->getLocalNode()); - CPPUNIT_ASSERT(remoteNode == m->getRemoteNode()); + CPPUNIT_ASSERT(*localNode == *m->getLocalNode()); + CPPUNIT_ASSERT(*remoteNode == *m->getRemoteNode()); CPPUNIT_ASSERT_EQUAL(util::toHex(transactionID, DHT_TRANSACTION_ID_LENGTH), util::toHex(m->getTransactionID())); } |
