mirror of
https://github.com/aria2/aria2.git
synced 2025-04-04 21:17:41 +03:00
Implement IndexedList::iterator
It is dangerous to expose internal iterator to the outside, which is easily misused.
This commit is contained in:
parent
421ae13d40
commit
d4ba562710
11 changed files with 583 additions and 133 deletions
|
@ -253,10 +253,10 @@ void RequestGroupManTest::testFillRequestGroupFromReserver_uriParser()
|
|||
|
||||
rgman_->fillRequestGroupFromReserver(e_.get());
|
||||
|
||||
RequestGroupList::SeqType::const_iterator itr;
|
||||
RequestGroupList::const_iterator itr;
|
||||
CPPUNIT_ASSERT_EQUAL((size_t)1, rgman_->getReservedGroups().size());
|
||||
itr = rgman_->getReservedGroups().begin();
|
||||
CPPUNIT_ASSERT_EQUAL(rgs[0]->getGID(), (*itr).second->getGID());
|
||||
CPPUNIT_ASSERT_EQUAL(rgs[0]->getGID(), (*itr)->getGID());
|
||||
CPPUNIT_ASSERT_EQUAL((size_t)3, rgman_->getRequestGroups().size());
|
||||
}
|
||||
|
||||
|
@ -277,18 +277,18 @@ void RequestGroupManTest::testInsertReservedGroup()
|
|||
std::vector<SharedHandle<RequestGroup> > groups(vbegin(rgs1), vend(rgs1));
|
||||
rgman_->insertReservedGroup(0, groups);
|
||||
CPPUNIT_ASSERT_EQUAL((size_t)2, rgman_->getReservedGroups().size());
|
||||
RequestGroupList::SeqType::const_iterator itr;
|
||||
RequestGroupList::const_iterator itr;
|
||||
itr = rgman_->getReservedGroups().begin();
|
||||
CPPUNIT_ASSERT_EQUAL(rgs1[0]->getGID(), (*itr++).second->getGID());
|
||||
CPPUNIT_ASSERT_EQUAL(rgs1[1]->getGID(), (*itr++).second->getGID());
|
||||
CPPUNIT_ASSERT_EQUAL(rgs1[0]->getGID(), (*itr++)->getGID());
|
||||
CPPUNIT_ASSERT_EQUAL(rgs1[1]->getGID(), (*itr++)->getGID());
|
||||
|
||||
groups.assign(vbegin(rgs2), vend(rgs2));
|
||||
rgman_->insertReservedGroup(1, groups);
|
||||
CPPUNIT_ASSERT_EQUAL((size_t)4, rgman_->getReservedGroups().size());
|
||||
itr = rgman_->getReservedGroups().begin();
|
||||
++itr;
|
||||
CPPUNIT_ASSERT_EQUAL(rgs2[0]->getGID(), (*itr++).second->getGID());
|
||||
CPPUNIT_ASSERT_EQUAL(rgs2[1]->getGID(), (*itr++).second->getGID());
|
||||
CPPUNIT_ASSERT_EQUAL(rgs2[0]->getGID(), (*itr++)->getGID());
|
||||
CPPUNIT_ASSERT_EQUAL(rgs2[1]->getGID(), (*itr++)->getGID());
|
||||
}
|
||||
|
||||
void RequestGroupManTest::testAddDownloadResult()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue