mirror of
https://github.com/aria2/aria2.git
synced 2025-04-05 13:37:40 +03:00
Use user-defined literals for time units
This commit is contained in:
parent
dd277b33af
commit
0b48bb1dbd
44 changed files with 108 additions and 88 deletions
|
@ -270,7 +270,7 @@ void UDPTrackerClientTest::testConnectFollowedByAnnounce()
|
|||
req4->infohash = "bittorrent-infohash4";
|
||||
tr.addRequest(req4);
|
||||
Timer future = now;
|
||||
future.advance(std::chrono::hours(1));
|
||||
future.advance(1_h);
|
||||
rv = tr.createRequest(data, sizeof(data), remoteAddr, remotePort,
|
||||
future);
|
||||
// connection ID is stale because of the timeout
|
||||
|
@ -384,7 +384,7 @@ void UDPTrackerClientTest::testTimeout()
|
|||
CPPUNIT_ASSERT_EQUAL((int)UDPT_ACT_CONNECT,
|
||||
(int)bittorrent::getIntParam(data, 8));
|
||||
tr.requestSent(now);
|
||||
now.advance(std::chrono::seconds(20));
|
||||
now.advance(20_s);
|
||||
// 15 seconds 1st stage timeout passed
|
||||
tr.handleTimeout(now);
|
||||
CPPUNIT_ASSERT(tr.getConnectRequests().empty());
|
||||
|
@ -396,7 +396,7 @@ void UDPTrackerClientTest::testTimeout()
|
|||
CPPUNIT_ASSERT_EQUAL((int)UDPT_ACT_CONNECT,
|
||||
(int)bittorrent::getIntParam(data, 8));
|
||||
tr.requestSent(now);
|
||||
now.advance(std::chrono::seconds(65));
|
||||
now.advance(65_s);
|
||||
// 60 seconds 2nd stage timeout passed
|
||||
tr.handleTimeout(now);
|
||||
CPPUNIT_ASSERT(tr.getConnectRequests().empty());
|
||||
|
@ -428,7 +428,7 @@ void UDPTrackerClientTest::testTimeout()
|
|||
CPPUNIT_ASSERT_EQUAL((int)UDPT_ACT_ANNOUNCE,
|
||||
(int)bittorrent::getIntParam(data, 8));
|
||||
tr.requestSent(now);
|
||||
now.advance(std::chrono::seconds(20));
|
||||
now.advance(20_s);
|
||||
// 15 seconds 1st stage timeout passed
|
||||
tr.handleTimeout(now);
|
||||
CPPUNIT_ASSERT(tr.getConnectRequests().empty());
|
||||
|
@ -439,7 +439,7 @@ void UDPTrackerClientTest::testTimeout()
|
|||
CPPUNIT_ASSERT_EQUAL((int)UDPT_ACT_ANNOUNCE,
|
||||
(int)bittorrent::getIntParam(data, 8));
|
||||
tr.requestSent(now);
|
||||
now.advance(std::chrono::seconds(65));
|
||||
now.advance(65_s);
|
||||
// 60 seconds 2nd stage timeout passed
|
||||
tr.handleTimeout(now);
|
||||
CPPUNIT_ASSERT(tr.getConnectRequests().empty());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue