mirror of
https://github.com/aria2/aria2.git
synced 2025-04-05 05:27:38 +03:00
2008-02-08 Tatsuhiro Tsujikawa <tujikawa at rednoah dot com>
Removed "using namespace std;" from all sources. Appended std:: prefix to c++ standard classes. Included string.h where mem* function are used.
This commit is contained in:
parent
d82e183d34
commit
1b7c198289
801 changed files with 12024 additions and 8627 deletions
|
@ -1,8 +1,10 @@
|
|||
#include "BtHaveNoneMessage.h"
|
||||
#include "PeerMessageUtil.h"
|
||||
#include "Peer.h"
|
||||
#include <cstring>
|
||||
#include <cppunit/extensions/HelperMacros.h>
|
||||
|
||||
using namespace std;
|
||||
namespace aria2 {
|
||||
|
||||
class BtHaveNoneMessageTest:public CppUnit::TestFixture {
|
||||
|
||||
|
@ -30,7 +32,7 @@ CPPUNIT_TEST_SUITE_REGISTRATION(BtHaveNoneMessageTest);
|
|||
void BtHaveNoneMessageTest::testCreate() {
|
||||
unsigned char msg[5];
|
||||
PeerMessageUtil::createPeerMessageString(msg, sizeof(msg), 1, 15);
|
||||
BtHaveNoneMessageHandle pm = BtHaveNoneMessage::create(&msg[4], 1);
|
||||
SharedHandle<BtHaveNoneMessage> pm = BtHaveNoneMessage::create(&msg[4], 1);
|
||||
CPPUNIT_ASSERT_EQUAL((int8_t)15, pm->getId());
|
||||
|
||||
// case: payload size is wrong
|
||||
|
@ -60,7 +62,7 @@ void BtHaveNoneMessageTest::testGetMessage() {
|
|||
|
||||
void BtHaveNoneMessageTest::testDoReceivedAction() {
|
||||
BtHaveNoneMessage msg;
|
||||
PeerHandle peer = new Peer("host", 6969);
|
||||
SharedHandle<Peer> peer = new Peer("host", 6969);
|
||||
peer->setFastExtensionEnabled(true);
|
||||
msg.setPeer(peer);
|
||||
msg.doReceivedAction();
|
||||
|
@ -74,5 +76,7 @@ void BtHaveNoneMessageTest::testDoReceivedAction() {
|
|||
|
||||
void BtHaveNoneMessageTest::testToString() {
|
||||
BtHaveNoneMessage msg;
|
||||
CPPUNIT_ASSERT_EQUAL(string("have none"), msg.toString());
|
||||
CPPUNIT_ASSERT_EQUAL(std::string("have none"), msg.toString());
|
||||
}
|
||||
|
||||
} // namespace aria2
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue