mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-29 04:17:55 +01:00
added NullMutex, extended Events so that mutex is a template param, minor performance optimzation for strategies
This commit is contained in:
@@ -62,11 +62,14 @@ void BasicEventTest::testNoDelegate()
|
||||
EventArgs args;
|
||||
|
||||
assert (_count == 0);
|
||||
assert (Simple.empty());
|
||||
Simple.notify(this, tmp);
|
||||
assert (_count == 0);
|
||||
|
||||
Simple += delegate(this, &BasicEventTest::onSimple);
|
||||
assert (!Simple.empty());
|
||||
Simple -= delegate(this, &BasicEventTest::onSimple);
|
||||
assert (Simple.empty());
|
||||
Simple.notify(this, tmp);
|
||||
assert (_count == 0);
|
||||
|
||||
@@ -166,6 +169,24 @@ void BasicEventTest::testDuplicateRegister()
|
||||
assert (_count == 1);
|
||||
}
|
||||
|
||||
|
||||
void BasicEventTest::testNullMutex()
|
||||
{
|
||||
Poco::BasicEvent<int, NullMutex> ev;
|
||||
int tmp = 0;
|
||||
|
||||
assert (_count == 0);
|
||||
|
||||
ev += delegate(this, &BasicEventTest::onSimple);
|
||||
ev += delegate(this, &BasicEventTest::onSimple);
|
||||
ev.notify(this, tmp);
|
||||
assert (_count == 1);
|
||||
ev -= delegate(this, &BasicEventTest::onSimple);
|
||||
ev.notify(this, tmp);
|
||||
assert (_count == 1);
|
||||
}
|
||||
|
||||
|
||||
void BasicEventTest::testDuplicateUnregister()
|
||||
{
|
||||
// duplicate unregister shouldn't give an error,
|
||||
@@ -406,5 +427,6 @@ CppUnit::Test* BasicEventTest::suite()
|
||||
CppUnit_addTest(pSuite, BasicEventTest, testExpireReRegister);
|
||||
CppUnit_addTest(pSuite, BasicEventTest, testOverwriteDelegate);
|
||||
CppUnit_addTest(pSuite, BasicEventTest, testAsyncNotify);
|
||||
CppUnit_addTest(pSuite, BasicEventTest, testNullMutex);
|
||||
return pSuite;
|
||||
}
|
||||
|
||||
@@ -64,6 +64,7 @@ public:
|
||||
void testReturnParams();
|
||||
void testOverwriteDelegate();
|
||||
void testAsyncNotify();
|
||||
void testNullMutex();
|
||||
|
||||
void setUp();
|
||||
void tearDown();
|
||||
|
||||
Reference in New Issue
Block a user