From: Christian P. <cp...@us...> - 2005-05-06 23:27:53
|
Update of /cvsroot/pclasses/pclasses2/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3234 Modified Files: Makefile.am Added Files: TimerTest.cpp Log Message: - Added TimerTest.cpp Index: Makefile.am =================================================================== RCS file: /cvsroot/pclasses/pclasses2/test/Makefile.am,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- Makefile.am 1 Feb 2005 16:46:35 -0000 1.7 +++ Makefile.am 6 May 2005 23:27:44 -0000 1.8 @@ -2,7 +2,8 @@ METASOURCES = AUTO noinst_HEADERS = Test.h noinst_PROGRAMS = QueueTest StackTest IntTypeTest ListTest ThreadTest \ - StringTest IOTest SignalTest HTTPClientTest LogTest PtrTest CmdLineTest + StringTest IOTest SignalTest HTTPClientTest LogTest \ + PtrTest CmdLineTest SocketTest TimerTest PtrTest_SOURCES = PtrTest.cpp PtrTest_LDADD = $(top_builddir)/src/System/libpclasses_system.la $(top_builddir)/src/libpclasses.la QueueTest_SOURCES = QueueTest.cpp @@ -25,8 +26,9 @@ $(top_builddir)/src/IO/libpclasses_io.la $(top_builddir)/src/libpclasses.la -lz SignalTest_SOURCES = SignalTest.cpp HTTPClientTest_SOURCES = HTTPClientTest.cpp -HTTPClientTest_LDADD = $(top_builddir)/src/Net/libpclasses_net.la\ - $(top_builddir)/src/libpclasses.la +HTTPClientTest_LDADD = $(top_builddir)/src/libpclasses.la\ + $(top_builddir)/src/System/libpclasses_system.la\ + $(top_builddir)/src/Net/libpclasses_net.la LogTest_LDADD = $(top_builddir)/src/App/libpclasses_app.la\ $(top_builddir)/src/libpclasses.la LogTest_SOURCES = LogTest.cpp @@ -37,3 +39,13 @@ $(top_builddir)/src/App/libpclasses_app.la\ $(top_builddir)/src/libpclasses.la SignalTest_LDADD = $(top_builddir)/src/libpclasses.la +SocketTest_LDADD = $(top_builddir)/src/Unicode/libpclasses_unicode.la\ + $(top_builddir)/src/System/libpclasses_system.la\ + $(top_builddir)/src/Net/libpclasses_net.la\ + $(top_builddir)/src/IO/libpclasses_io.la\ + $(top_builddir)/src/libpclasses.la +SocketTest_SOURCES = SocketTest.cpp +TimerTest_LDADD = $(top_builddir)/src/App/libpclasses_app.la\ + $(top_builddir)/src/System/libpclasses_system.la\ + $(top_builddir)/src/libpclasses.la +TimerTest_SOURCES = TimerTest.cpp --- NEW FILE: TimerTest.cpp --- /*************************************************************************** * Copyright (C) 2005 by Christian Prochnow * * cp...@se... * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * * published by the Free Software Foundation; either version 2 of the * * License, or (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU Library General Public * * License along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include "pclasses/App/SimpleApp.h" #include "pclasses/System/Timer.h" #include <iostream> using namespace P; using namespace P::App; using namespace P::System; void timer1_expired() { std::cerr << "timer1 expired" << std::endl; } void timer2_expired() { std::cerr << "timer2 expired" << std::endl; } int main(int argc, char* argv[]) { AppDetails about; SimpleApp app(about); Timer t1; t1.start(2000, false); t1.sigExpired.bind(make_function(&timer1_expired)); Timer t2; t2.start(4000, true); t2.sigExpired.bind(make_function(&timer2_expired)); return app.run(argc, argv); } |