From: Christian P. <cp...@us...> - 2005-01-28 19:08:25
|
Update of /cvsroot/pclasses/pclasses2/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6988 Modified Files: ThreadTest.cpp SignalTest.cpp Log Message: Fixed ThredTest and SignalTest. Index: ThreadTest.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/test/ThreadTest.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ThreadTest.cpp 28 Jan 2005 11:57:12 -0000 1.2 +++ ThreadTest.cpp 28 Jan 2005 17:41:36 -0000 1.3 @@ -67,7 +67,11 @@ sem.wait(); delete thread; - System::Thread::spawn(method(this, &ThreadTest::spawnedTest), &sem); + System::Thread::spawn(make_method(this, &ThreadTest::spawnedTest), &sem); + sem.wait(); sem.wait(); + + System::Thread::spawn(make_method(this, &ThreadTest::spawnedTest2), + make_args((int)12345), &sem); sem.wait(); sem.wait(); } @@ -75,7 +79,12 @@ { std::cout << "Hello from spawned callback!" << std::endl; } - + + void spawnedTest2(int arg) + { + std::cout << "Hello from spawned callback! arg=" << arg << std::endl; + } + static System::Semaphore sem; }; Index: SignalTest.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/test/SignalTest.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- SignalTest.cpp 6 Jan 2005 17:00:38 -0000 1.1 +++ SignalTest.cpp 28 Jan 2005 17:41:36 -0000 1.2 @@ -41,8 +41,8 @@ // bind signals and see if methods did run Signal0<void> sig; - sig.bind(function(&testFuncStatic)); - sig.bind(method(this, &Signal0Test::testFunc)); + sig.bind(make_function(&testFuncStatic)); + sig.bind(make_method(this, &Signal0Test::testFunc)); sig.fire(); P_TEST(_testFunc == true); @@ -52,8 +52,8 @@ _testFunc = false; _testFuncStatic = false; - sig.unbind(function(&testFuncStatic)); - sig.unbind(method(this, &Signal0Test::testFunc)); + sig.unbind(make_function(&testFuncStatic)); + sig.unbind(make_method(this, &Signal0Test::testFunc)); sig.fire(); P_TEST(_testFunc == false); @@ -61,9 +61,11 @@ // test signal with bool return-type Signal0<bool> sig2; - sig2.bind(function(&testFunc2Static)); - sig2.bind(method(this, &Signal0Test::testFunc2)); + sig2.bind(make_function(&testFunc2Static)); + sig2.bind(make_method(this, &Signal0Test::testFunc2)); P_TEST(sig2.fire() == true); + + make_args(1); } private: |