17 #ifndef AsyncInvoker_cpp 18 #define AsyncInvoker_cpp 24 #include <cppunit/ui/text/TestRunner.h> 25 #include <cppunit/TextOutputter.h> 26 #include <cppunit/extensions/TestFactoryRegistry.h> 27 #include <cppunit/extensions/HelperMacros.h> 28 #include <cppunit/TestAssert.h> 30 #include <coil/Async.h> 31 #include <coil/Time.h> 42 for (
int i(0); i < 4; ++i)
44 std::cout <<
"," << std::flush;
54 for (
int i(0); i < 4; ++i)
56 std::cout <<
"," << std::flush;
66 for (
int i(0); i < 4; ++i)
68 std::cout <<
"," << std::flush;
110 :
public CppUnit::TestFixture
113 CPPUNIT_TEST(test_memfun);
114 CPPUNIT_TEST(test_memfun_oneway);
115 CPPUNIT_TEST(test_bind2nd);
116 CPPUNIT_TEST(test_bind2nd_oneway);
117 CPPUNIT_TEST(test_myfunctor);
118 CPPUNIT_TEST(test_myfunctor_oneway);
119 CPPUNIT_TEST_SUITE_END();
191 std::bind2nd(std::mem_fun(&
A::munya),
203 std::bind2nd(std::mem_fun(&
A::munya),
223 CPPUNIT_ASSERT(aof.
get_ret() == (val + 1));
236 CPPUNIT_ASSERT(aof.
get_ret() == (val + 1));
247 int main(
int argc,
char* argv[])
249 CppUnit::TextUi::TestRunner runner;
250 runner.addTest(CppUnit::TestFactoryRegistry::getRegistry().makeTest());
251 CppUnit::Outputter* outputter =
252 new CppUnit::TextOutputter(&runner.result(), std::cout);
253 runner.setOutputter(outputter);
258 #endif // AsyncInvoker_cpp void test_myfunctor_oneway()
int main(int argc, char **argv)
virtual void setUp()
Test initialization.
unsigned int sleep(unsigned int seconds)
Stop a processing at specified second time.
void test_memfun_oneway()
void munya(const char *msg)
~AsyncInvokerTests()
Destructor.
virtual int wait(void)
Waiting for the thread terminate.
AsyncInvokerTests()
Constructor.
virtual void tearDown()
Test finalization.
virtual void invoke()=0
Asynchronous invocation.
CPPUNIT_TEST_SUITE_REGISTRATION(AsyncInvoker::AsyncInvokerTests)
void test_bind2nd_oneway()
int usleep(useconds_t usec)
Stop a processing at specified micro second time.
Async_t< Object, Func > * AsyncInvoker(Object *obj, Func func, bool auto_delete=false)
Helper function for async member function summons.