}
void testInit() {
- PluginManager::thePluginManager.initialize();
+ PluginManager::instance()->initialize();
CPPUNIT_ASSERT(TestPlugin::theTestPlugin.inited);
}
void testClean() {
- PluginManager::thePluginManager.cleanup();
+ PluginManager::instance()->cleanup();
CPPUNIT_ASSERT(TestPlugin::theTestPlugin.cleaned);
}
};
r = read(fd, buf, 1);
buf[1] = 0;
- ThreadPool::getThreadPool()->exit();
+ ThreadPool::instance()->exit();
}
virtual void onTimeout() {
virtual void onReady() {
int len = recv(fd, buffer, sizeof(buffer), MSG_NOSIGNAL);
- ThreadPool::getThreadPool()->exit();
+ ThreadPool::instance()->exit();
}
virtual void onError() {
nfd = accept(fd, NULL, NULL);
if(nfd < 0) {
} else {
- ThreadPool *pool = ThreadPool::getThreadPool();
+ ThreadPool *pool = ThreadPool::instance();
reader = new TestSocketRead(nfd);
pool->queueWorkRead(reader);
public:
void setUp() {
- pool = ThreadPool::getThreadPool();
+ pool = ThreadPool::instance();
unlink("/tmp/smazat.sock");
pool->startWorkers(2);
}
pool->queueWorkAccept(consumer);
producer = new TestSocketWrite("/tmp/smazat.sock");
- ThreadPool::getThreadPool()->queueWorkWrite(producer);
+ ThreadPool::instance()->queueWorkWrite(producer);
pool->run();
CPPUNIT_ASSERT(consumer->reader != NULL);
CPPUNIT_ASSERT(strcmp(consumer->reader->buffer, TestSocketWrite::buffer) == 0);