mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-05 17:52:29 +00:00
Fixed threaded tracker feature compatibility.
This commit is contained in:
@@ -6,8 +6,8 @@ CPPUNIT_TEST_SUITE_REGISTRATION(CommandTest);
|
||||
|
||||
bool
|
||||
command_stack_all_empty() {
|
||||
return std::find_if(rpc::command_base::stack_begin(), rpc::command_base::stack_end(),
|
||||
std::mem_fun_ref(&torrent::Object::is_not_empty)) == rpc::command_base::stack_end();
|
||||
return std::all_of(rpc::command_base::stack_begin(), rpc::command_base::stack_end(),
|
||||
[](auto& obj) { return obj.is_empty(); });
|
||||
}
|
||||
|
||||
void
|
||||
@@ -31,7 +31,7 @@ CommandTest::test_stack() {
|
||||
last_stack = rpc::command_base::push_stack(args, &stack);
|
||||
CPPUNIT_ASSERT(!command_stack_all_empty());
|
||||
CPPUNIT_ASSERT(rpc::command_base::stack_begin()->as_value() == 1);
|
||||
|
||||
|
||||
rpc::command_base::pop_stack(&stack, last_stack);
|
||||
CPPUNIT_ASSERT(command_stack_all_empty());
|
||||
|
||||
@@ -44,7 +44,7 @@ CommandTest::test_stack() {
|
||||
CPPUNIT_ASSERT(!command_stack_all_empty());
|
||||
CPPUNIT_ASSERT(rpc::command_base::current_stack[0].as_value() == 2);
|
||||
CPPUNIT_ASSERT(rpc::command_base::current_stack[1].as_value() == 3);
|
||||
|
||||
|
||||
rpc::command_base::pop_stack(&stack, last_stack);
|
||||
CPPUNIT_ASSERT(command_stack_all_empty());
|
||||
}
|
||||
@@ -59,7 +59,7 @@ CommandTest::test_stack_double() {
|
||||
|
||||
// Test double-stacked.
|
||||
args.push_back(int64_t(1));
|
||||
|
||||
|
||||
last_stack_first = rpc::command_base::push_stack(args, &stack_first);
|
||||
CPPUNIT_ASSERT(!command_stack_all_empty());
|
||||
CPPUNIT_ASSERT(rpc::command_base::current_stack[0].as_value() == 1);
|
||||
@@ -67,17 +67,17 @@ CommandTest::test_stack_double() {
|
||||
args.clear();
|
||||
args.push_back(int64_t(2));
|
||||
args.push_back(int64_t(3));
|
||||
|
||||
|
||||
last_stack_second = rpc::command_base::push_stack(args, &stack_second);
|
||||
CPPUNIT_ASSERT(!command_stack_all_empty());
|
||||
|
||||
|
||||
CPPUNIT_ASSERT(rpc::command_base::current_stack[0].as_value() == 2);
|
||||
CPPUNIT_ASSERT(rpc::command_base::current_stack[1].as_value() == 3);
|
||||
|
||||
rpc::command_base::pop_stack(&stack_second, last_stack_second);
|
||||
CPPUNIT_ASSERT(!command_stack_all_empty());
|
||||
CPPUNIT_ASSERT(rpc::command_base::current_stack[0].as_value() == 1);
|
||||
|
||||
|
||||
rpc::command_base::pop_stack(&stack_first, last_stack_first);
|
||||
CPPUNIT_ASSERT(command_stack_all_empty());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user