Rewrite Time with chrono

This commit is contained in:
Tatsuhiro Tsujikawa 2015-06-09 03:04:38 +09:00
parent 99cd73c092
commit b0f440e631
20 changed files with 87 additions and 270 deletions

View file

@ -132,7 +132,7 @@ void ServerStatManTest::testLoad()
CPPUNIT_ASSERT_EQUAL(102, localhost_http->getMultiConnectionAvgSpeed());
CPPUNIT_ASSERT_EQUAL(6, localhost_http->getCounter());
CPPUNIT_ASSERT_EQUAL(static_cast<time_t>(1210000000),
localhost_http->getLastUpdated().getTime());
localhost_http->getLastUpdated().getTimeFromEpoch());
CPPUNIT_ASSERT_EQUAL(ServerStat::OK, localhost_http->getStatus());
std::shared_ptr<ServerStat> mirror = ssm.find("mirror", "http");
@ -159,7 +159,7 @@ void ServerStatManTest::testRemoveStaleServerStat()
CPPUNIT_ASSERT(ssm.add(localhost_ftp));
CPPUNIT_ASSERT(ssm.add(mirror));
ssm.removeStaleServerStat(24*60*60);
ssm.removeStaleServerStat(std::chrono::hours(24));
CPPUNIT_ASSERT(ssm.find("localhost", "http"));
CPPUNIT_ASSERT(!ssm.find("localhost", "ftp"));