mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-12 21:22:31 +00:00
* Cleanup of old command code.
git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@1156 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -21,32 +21,32 @@ const std::string& cmd_test_convert_const_string(rpc::target_type t, const torre
|
||||
|
||||
void
|
||||
CommandSlotTest::test_basics() {
|
||||
rpc::command_base test_any;
|
||||
test_any.set_function<rpc::any_function>(&cmd_test_a);
|
||||
CPPUNIT_ASSERT(rpc::command_base_call_any(&test_any, rpc::make_target(), (int64_t)1).as_value() == 1);
|
||||
// rpc::command_base test_any;
|
||||
// test_any.set_function<rpc::any_function>(&cmd_test_a);
|
||||
// CPPUNIT_ASSERT(rpc::command_base_call_any(&test_any, rpc::make_target(), (int64_t)1).as_value() == 1);
|
||||
|
||||
test_any.set_function<rpc::any_function>(std::tr1::bind(&cmd_test_b, std::tr1::placeholders::_1, std::tr1::placeholders::_2, (uint64_t)2));
|
||||
CPPUNIT_ASSERT(rpc::command_base_call_any(&test_any, rpc::make_target(), (int64_t)1).as_value() == 2);
|
||||
// test_any.set_function<rpc::any_function>(std::tr1::bind(&cmd_test_b, std::tr1::placeholders::_1, std::tr1::placeholders::_2, (uint64_t)2));
|
||||
// CPPUNIT_ASSERT(rpc::command_base_call_any(&test_any, rpc::make_target(), (int64_t)1).as_value() == 2);
|
||||
|
||||
test_any.set_function<rpc::any_list_function>(&cmd_test_list);
|
||||
CPPUNIT_ASSERT(rpc::command_base_call_any_list(&test_any, rpc::make_target(), (int64_t)3).as_value() == 3);
|
||||
// test_any.set_function<rpc::any_list_function>(&cmd_test_list);
|
||||
// CPPUNIT_ASSERT(rpc::command_base_call_any_list(&test_any, rpc::make_target(), (int64_t)3).as_value() == 3);
|
||||
}
|
||||
|
||||
void
|
||||
CommandSlotTest::test_type_validity() {
|
||||
CPPUNIT_ASSERT((rpc::command_base_is_type<rpc::any_function, &rpc::command_base_call_any>::value));
|
||||
CPPUNIT_ASSERT((rpc::command_base_is_type<rpc::any_string_function, &rpc::command_base_call_any_string>::value));
|
||||
// CPPUNIT_ASSERT((rpc::command_base_is_type<rpc::any_function, &rpc::command_base_call_any>::value));
|
||||
// CPPUNIT_ASSERT((rpc::command_base_is_type<rpc::any_string_function, &rpc::command_base_call_any_string>::value));
|
||||
}
|
||||
|
||||
void
|
||||
CommandSlotTest::test_convert_return() {
|
||||
rpc::command_base test_any;
|
||||
// rpc::command_base test_any;
|
||||
|
||||
test_any.set_function<rpc::any_function>(&cmd_test_convert_string);
|
||||
CPPUNIT_ASSERT(rpc::command_base_call_any(&test_any, rpc::make_target(), (int64_t)1).as_string() == "test_1");
|
||||
// test_any.set_function<rpc::any_function>(&cmd_test_convert_string);
|
||||
// CPPUNIT_ASSERT(rpc::command_base_call_any(&test_any, rpc::make_target(), (int64_t)1).as_string() == "test_1");
|
||||
|
||||
test_any.set_function<rpc::any_function>(&cmd_test_convert_const_string);
|
||||
CPPUNIT_ASSERT(rpc::command_base_call_any(&test_any, rpc::make_target(), (int64_t)1).as_string() == "test_2");
|
||||
// test_any.set_function<rpc::any_function>(&cmd_test_convert_const_string);
|
||||
// CPPUNIT_ASSERT(rpc::command_base_call_any(&test_any, rpc::make_target(), (int64_t)1).as_string() == "test_2");
|
||||
|
||||
// test_any.set_function<rpc::any_function>(object_convert_void(&cmd_test_convert_void));
|
||||
// CPPUNIT_ASSERT(rpc::command_base_call_any(&test_any, rpc::make_target(), (int64_t)1).is_empty());
|
||||
|
||||
Reference in New Issue
Block a user