mirror of
https://github.com/aria2/aria2.git
synced 2025-04-04 21:17:41 +03:00
clang-format-5.0
This commit is contained in:
parent
20a7c43f2d
commit
795a0474df
48 changed files with 595 additions and 284 deletions
|
@ -149,53 +149,38 @@ void RequestGroupManTest::testChangeReservedGroupPosition()
|
|||
std::make_shared<RequestGroup>(GroupId::create(), util::copy(option_))};
|
||||
RequestGroupMan rm(gs, 0, option_.get());
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(
|
||||
(size_t)0,
|
||||
rm.changeReservedGroupPosition(gs[0]->getGID(), 0, OFFSET_MODE_SET));
|
||||
CPPUNIT_ASSERT_EQUAL(
|
||||
(size_t)1,
|
||||
rm.changeReservedGroupPosition(gs[0]->getGID(), 1, OFFSET_MODE_SET));
|
||||
CPPUNIT_ASSERT_EQUAL(
|
||||
(size_t)3,
|
||||
rm.changeReservedGroupPosition(gs[0]->getGID(), 10, OFFSET_MODE_SET));
|
||||
CPPUNIT_ASSERT_EQUAL(
|
||||
(size_t)0,
|
||||
rm.changeReservedGroupPosition(gs[0]->getGID(), -10, OFFSET_MODE_SET));
|
||||
CPPUNIT_ASSERT_EQUAL((size_t)0, rm.changeReservedGroupPosition(
|
||||
gs[0]->getGID(), 0, OFFSET_MODE_SET));
|
||||
CPPUNIT_ASSERT_EQUAL((size_t)1, rm.changeReservedGroupPosition(
|
||||
gs[0]->getGID(), 1, OFFSET_MODE_SET));
|
||||
CPPUNIT_ASSERT_EQUAL((size_t)3, rm.changeReservedGroupPosition(
|
||||
gs[0]->getGID(), 10, OFFSET_MODE_SET));
|
||||
CPPUNIT_ASSERT_EQUAL((size_t)0, rm.changeReservedGroupPosition(
|
||||
gs[0]->getGID(), -10, OFFSET_MODE_SET));
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(
|
||||
(size_t)1,
|
||||
rm.changeReservedGroupPosition(gs[1]->getGID(), 0, OFFSET_MODE_CUR));
|
||||
CPPUNIT_ASSERT_EQUAL(
|
||||
(size_t)2,
|
||||
rm.changeReservedGroupPosition(gs[1]->getGID(), 1, OFFSET_MODE_CUR));
|
||||
CPPUNIT_ASSERT_EQUAL(
|
||||
(size_t)1,
|
||||
rm.changeReservedGroupPosition(gs[1]->getGID(), -1, OFFSET_MODE_CUR));
|
||||
CPPUNIT_ASSERT_EQUAL(
|
||||
(size_t)0,
|
||||
rm.changeReservedGroupPosition(gs[1]->getGID(), -10, OFFSET_MODE_CUR));
|
||||
CPPUNIT_ASSERT_EQUAL(
|
||||
(size_t)1,
|
||||
rm.changeReservedGroupPosition(gs[1]->getGID(), 1, OFFSET_MODE_CUR));
|
||||
CPPUNIT_ASSERT_EQUAL(
|
||||
(size_t)3,
|
||||
rm.changeReservedGroupPosition(gs[1]->getGID(), 10, OFFSET_MODE_CUR));
|
||||
CPPUNIT_ASSERT_EQUAL(
|
||||
(size_t)1,
|
||||
rm.changeReservedGroupPosition(gs[1]->getGID(), -2, OFFSET_MODE_CUR));
|
||||
CPPUNIT_ASSERT_EQUAL((size_t)1, rm.changeReservedGroupPosition(
|
||||
gs[1]->getGID(), 0, OFFSET_MODE_CUR));
|
||||
CPPUNIT_ASSERT_EQUAL((size_t)2, rm.changeReservedGroupPosition(
|
||||
gs[1]->getGID(), 1, OFFSET_MODE_CUR));
|
||||
CPPUNIT_ASSERT_EQUAL((size_t)1, rm.changeReservedGroupPosition(
|
||||
gs[1]->getGID(), -1, OFFSET_MODE_CUR));
|
||||
CPPUNIT_ASSERT_EQUAL((size_t)0, rm.changeReservedGroupPosition(
|
||||
gs[1]->getGID(), -10, OFFSET_MODE_CUR));
|
||||
CPPUNIT_ASSERT_EQUAL((size_t)1, rm.changeReservedGroupPosition(
|
||||
gs[1]->getGID(), 1, OFFSET_MODE_CUR));
|
||||
CPPUNIT_ASSERT_EQUAL((size_t)3, rm.changeReservedGroupPosition(
|
||||
gs[1]->getGID(), 10, OFFSET_MODE_CUR));
|
||||
CPPUNIT_ASSERT_EQUAL((size_t)1, rm.changeReservedGroupPosition(
|
||||
gs[1]->getGID(), -2, OFFSET_MODE_CUR));
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL(
|
||||
(size_t)3,
|
||||
rm.changeReservedGroupPosition(gs[3]->getGID(), 0, OFFSET_MODE_END));
|
||||
CPPUNIT_ASSERT_EQUAL(
|
||||
(size_t)2,
|
||||
rm.changeReservedGroupPosition(gs[3]->getGID(), -1, OFFSET_MODE_END));
|
||||
CPPUNIT_ASSERT_EQUAL(
|
||||
(size_t)0,
|
||||
rm.changeReservedGroupPosition(gs[3]->getGID(), -10, OFFSET_MODE_END));
|
||||
CPPUNIT_ASSERT_EQUAL(
|
||||
(size_t)3,
|
||||
rm.changeReservedGroupPosition(gs[3]->getGID(), 10, OFFSET_MODE_END));
|
||||
CPPUNIT_ASSERT_EQUAL((size_t)3, rm.changeReservedGroupPosition(
|
||||
gs[3]->getGID(), 0, OFFSET_MODE_END));
|
||||
CPPUNIT_ASSERT_EQUAL((size_t)2, rm.changeReservedGroupPosition(
|
||||
gs[3]->getGID(), -1, OFFSET_MODE_END));
|
||||
CPPUNIT_ASSERT_EQUAL((size_t)0, rm.changeReservedGroupPosition(
|
||||
gs[3]->getGID(), -10, OFFSET_MODE_END));
|
||||
CPPUNIT_ASSERT_EQUAL((size_t)3, rm.changeReservedGroupPosition(
|
||||
gs[3]->getGID(), 10, OFFSET_MODE_END));
|
||||
|
||||
CPPUNIT_ASSERT_EQUAL((size_t)4, rm.getReservedGroups().size());
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue