summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2013-06-22 17:53:39 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2013-06-22 17:53:39 +0900
commite791eb9ca334e7746bc0735cebcda09e30fa65df (patch)
tree52a501343b31e55a0d71700171599fd94f969580 /test
parent50dcd6394c645fdd9e7fbe879f511888bfa88423 (diff)
Cleanup a2functional.h
Remove mem_fun_sh in favor of std::mem_fun. Remove unused functions. Use std::mem_fn instead of mem_fun_sh
Diffstat (limited to 'test')
-rw-r--r--test/a2functionalTest.cc48
1 files changed, 0 insertions, 48 deletions
diff --git a/test/a2functionalTest.cc b/test/a2functionalTest.cc
index 85e12404..2fcca3d5 100644
--- a/test/a2functionalTest.cc
+++ b/test/a2functionalTest.cc
@@ -11,42 +11,13 @@ namespace aria2 {
class a2functionalTest:public CppUnit::TestFixture {
CPPUNIT_TEST_SUITE(a2functionalTest);
- CPPUNIT_TEST(testMemFunSh);
- CPPUNIT_TEST(testAdopt2nd);
CPPUNIT_TEST(testStrjoin);
CPPUNIT_TEST(testLeastRecentAccess);
CPPUNIT_TEST_SUITE_END();
public:
- void testMemFunSh();
- void testAdopt2nd();
void testStrjoin();
void testLeastRecentAccess();
- class Greeting {
- public:
- virtual ~Greeting() {}
-
- virtual std::string sayGreeting() = 0;
-
- virtual std::string sayGreetingConst() const = 0;
- };
-
- typedef std::shared_ptr<Greeting> GreetingHandle;
-
- class JapaneseGreeting:public Greeting
- {
- virtual std::string sayGreeting()
- {
- return "HAROO WAARUDO";
- }
-
- virtual std::string sayGreetingConst() const
- {
- return "HAROO WAARUDO";
- }
-
- };
-
struct LastAccess {
time_t lastAccess_;
LastAccess(time_t lastAccess):lastAccess_(lastAccess) {}
@@ -58,27 +29,8 @@ public:
};
};
-
CPPUNIT_TEST_SUITE_REGISTRATION(a2functionalTest);
-void a2functionalTest::testMemFunSh()
-{
- GreetingHandle greeting(new JapaneseGreeting());
-
- CPPUNIT_ASSERT_EQUAL(std::string("HAROO WAARUDO"), mem_fun_sh(&Greeting::sayGreeting)(greeting));
-
- CPPUNIT_ASSERT_EQUAL(std::string("HAROO WAARUDO"), mem_fun_sh(&Greeting::sayGreetingConst)(greeting));
-
-}
-
-void a2functionalTest::testAdopt2nd()
-{
- GreetingHandle greeting(new JapaneseGreeting());
-
- CPPUNIT_ASSERT_EQUAL(std::string("A Japanese said:HAROO WAARUDO"),
- adopt2nd(std::plus<std::string>(), mem_fun_sh(&Greeting::sayGreeting))("A Japanese said:", greeting));
-}
-
void a2functionalTest::testStrjoin()
{
std::vector<std::string> v;