Use user-defined literal for k, m, and g (powers of 1024)

This commit is contained in:
Tatsuhiro Tsujikawa 2015-06-21 18:04:30 +09:00
parent 8ba9b04747
commit 318c804504
99 changed files with 482 additions and 453 deletions

View file

@ -15,7 +15,7 @@ private:
public:
void setUp() {
peer.reset(new Peer("localhost", 6969));
peer->allocateSessionResource(1024, 1024*1024);
peer->allocateSessionResource(1_k, 1_m);
}
void testPeerAllowedIndexSet();
@ -48,7 +48,7 @@ void PeerTest::testCountSeeder()
peers[4].reset(new Peer("192.168.0.5", 7000));
for(std::vector<std::shared_ptr<Peer> >::iterator i = peers.begin();
i != peers.end(); ++i) {
(*i)->allocateSessionResource(1024, 1024*8);
(*i)->allocateSessionResource(1_k, 8_k);
}
unsigned char bitfield[] = { 0xff };
peers[1]->setBitfield(bitfield, 1);