Changeset 6073 for branches/newapi
- Timestamp:
- 02/24/08 20:45:56 (9 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
branches/newapi/licq/src/event/test/descriptorsettest.cpp
r6072 r6073 19 19 20 20 #include "event/descriptorset.h" 21 #include "licq/exception/invalidargumentexception.h" 21 22 #include "test/recorder.h" 22 23 #include "util/pipe.h" … … 49 50 { 50 51 reset(); 51 52 52 LicqDaemon::DescriptorSet set(Licq::EventLoop::Read); 53 53 … … 61 61 maxFd = set.getFdSet(&fds); 62 62 BOOST_CHECK_EQUAL(maxFd, pipe.getReadFd()); 63 BOOST_CHECK(FD_ISSET(pipe.getReadFd(), &fds)); 63 64 64 65 pipe.putc('A'); … … 74 75 { 75 76 reset(); 76 77 77 LicqDaemon::DescriptorSet set(Licq::EventLoop::Read); 78 78 … … 86 86 maxFd = set.getFdSet(&fds); 87 87 BOOST_CHECK_EQUAL(maxFd, pipe.getReadFd()); 88 BOOST_CHECK(FD_ISSET(pipe.getReadFd(), &fds)); 88 89 89 90 set.removeBadDescriptors(); 90 91 maxFd = set.getFdSet(&fds); 91 92 BOOST_CHECK_EQUAL(maxFd, pipe.getReadFd()); 93 BOOST_CHECK(FD_ISSET(pipe.getReadFd(), &fds)); 92 94 } 93 95 … … 97 99 } 98 100 101 BOOST_AUTO_TEST_CASE(duplicate) 102 { 103 reset(); 104 LicqDaemon::DescriptorSet set(Licq::EventLoop::Read); 105 106 // A descriptor should only be added once 107 set.addDescriptor(0, this); 108 BOOST_CHECK_THROW(set.addDescriptor(0, this), Licq::InvalidArgumentException); 109 set.removeDescriptor(0); 110 } 111 99 112 BOOST_AUTO_TEST_SUITE_END()
