diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/BtPostDownloadHandlerTest.cc | 3 | ||||
| -rw-r--r-- | test/MetalinkPostDownloadHandlerTest.cc | 4 | ||||
| -rw-r--r-- | test/RpcMethodTest.cc | 7 | ||||
| -rw-r--r-- | test/UTMetadataPostDownloadHandlerTest.cc | 1 |
4 files changed, 15 insertions, 0 deletions
diff --git a/test/BtPostDownloadHandlerTest.cc b/test/BtPostDownloadHandlerTest.cc index 3dff44cb..467b82ab 100644 --- a/test/BtPostDownloadHandlerTest.cc +++ b/test/BtPostDownloadHandlerTest.cc @@ -82,6 +82,9 @@ void BtPostDownloadHandlerTest::testGetNextRequestGroups() bittorrent::getInfoHashString(groups.front()->getDownloadContext())); CPPUNIT_ASSERT(std::find(rg.followedBy().begin(), rg.followedBy().end(), groups.front()->getGID()) != rg.followedBy().end()); + for (auto& nrg : groups) { + CPPUNIT_ASSERT_EQUAL(rg.getGID(), nrg->following()); + } } } // namespace aria2 diff --git a/test/MetalinkPostDownloadHandlerTest.cc b/test/MetalinkPostDownloadHandlerTest.cc index 1f225bb6..66f813b0 100644 --- a/test/MetalinkPostDownloadHandlerTest.cc +++ b/test/MetalinkPostDownloadHandlerTest.cc @@ -83,6 +83,10 @@ void MetalinkPostDownloadHandlerTest::testGetNextRequestGroups() #else CPPUNIT_ASSERT_EQUAL((size_t)5, groups.size()); #endif // ENABLE_BITTORRENT + + for (auto& nrg : groups) { + CPPUNIT_ASSERT_EQUAL(rg.getGID(), nrg->following()); + } } void MetalinkPostDownloadHandlerTest::testGetNextRequestGroups_withBaseUri() diff --git a/test/RpcMethodTest.cc b/test/RpcMethodTest.cc index 80b0c1ae..1bcac3af 100644 --- a/test/RpcMethodTest.cc +++ b/test/RpcMethodTest.cc @@ -924,6 +924,7 @@ void RpcMethodTest::testGatherStoppedDownload() d->sessionTime = 1_s; d->result = error_code::FINISHED; d->followedBy = followedBy; + d->following = 1; d->belongsTo = 2; auto entry = Dict::g(); std::vector<std::string> keys; @@ -934,6 +935,8 @@ void RpcMethodTest::testGatherStoppedDownload() downcast<String>(followedByRes->get(0))->s()); CPPUNIT_ASSERT_EQUAL(GroupId::toHex(4), downcast<String>(followedByRes->get(1))->s()); + CPPUNIT_ASSERT_EQUAL(GroupId::toHex(1), + downcast<String>(entry->get("following"))->s()); CPPUNIT_ASSERT_EQUAL(GroupId::toHex(2), downcast<String>(entry->get("belongsTo"))->s()); @@ -960,6 +963,8 @@ void RpcMethodTest::testGatherProgressCommon() } group->followedBy(followedBy.begin(), followedBy.end()); + auto leader = GroupId::create(); + group->following(leader->getNumericId()); auto parent = GroupId::create(); group->belongsTo(parent->getNumericId()); @@ -972,6 +977,8 @@ void RpcMethodTest::testGatherProgressCommon() downcast<String>(followedByRes->get(0))->s()); CPPUNIT_ASSERT_EQUAL(GroupId::toHex(followedBy[1]->getGID()), downcast<String>(followedByRes->get(1))->s()); + CPPUNIT_ASSERT_EQUAL(leader->toHex(), + downcast<String>(entry->get("following"))->s()); CPPUNIT_ASSERT_EQUAL(parent->toHex(), downcast<String>(entry->get("belongsTo"))->s()); const List* files = downcast<List>(entry->get("files")); diff --git a/test/UTMetadataPostDownloadHandlerTest.cc b/test/UTMetadataPostDownloadHandlerTest.cc index eb0b9258..65f26387 100644 --- a/test/UTMetadataPostDownloadHandlerTest.cc +++ b/test/UTMetadataPostDownloadHandlerTest.cc @@ -117,6 +117,7 @@ void UTMetadataPostDownloadHandlerTest::testGetNextRequestGroups() requestGroup_->followedBy().end(), newRg->getGID()) != requestGroup_->followedBy().end()); + CPPUNIT_ASSERT_EQUAL(requestGroup_->getGID(), newRg->following()); CPPUNIT_ASSERT(!trfile.exists()); results.clear(); |
