MCPcopy Create free account
hub / github.com/aria2/aria2 / testAddMetalink_withPosition

Method testAddMetalink_withPosition

test/RpcMethodTest.cc:551–572  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

549}
550
551void RpcMethodTest::testAddMetalink_withPosition()
552{
553 AddUriRpcMethod m1;
554 auto req1 = createReq(AddUriRpcMethod::getMethodName());
555 auto urisParam1 = List::g();
556 urisParam1->append("http://uri");
557 req1.params->append(std::move(urisParam1));
558 auto res1 = m1.execute(std::move(req1), e_.get());
559 CPPUNIT_ASSERT_EQUAL(0, res1.code);
560
561 AddMetalinkRpcMethod m2;
562 auto req2 = createReq(AddMetalinkRpcMethod::getMethodName());
563 req2.params->append(readFile(A2_TEST_DIR "/2files.metalink"));
564 req2.params->append(Dict::g());
565 req2.params->append(Integer::g(0));
566 auto res2 = m2.execute(std::move(req2), e_.get());
567 CPPUNIT_ASSERT_EQUAL(0, res2.code);
568
569 CPPUNIT_ASSERT_EQUAL(
570 e_->getOption()->get(PREF_DIR) + "/aria2-5.0.0.tar.bz2",
571 getReservedGroup(e_->getRequestGroupMan().get(), 0)->getFirstFilePath());
572}
573
574#endif // ENABLE_METALINK
575

Callers

nothing calls this directly

Calls 9

createReqFunction · 0.85
getReservedGroupFunction · 0.85
getOptionMethod · 0.80
getFirstFilePathMethod · 0.80
getRequestGroupManMethod · 0.80
readFileFunction · 0.70
appendMethod · 0.45
executeMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected