mirror of
https://github.com/pocoproject/poco.git
synced 2025-10-27 11:06:50 +01:00
Poco 1.9.1 assert true (#2255)
* Rename assert by assertTrue * Update submodules * Missing assertTrue * Rename poco_assertTrue to poco_assert * Rename poco_assertTrue to poco_assert
This commit is contained in:
committed by
Aleksandar Fabijanic
parent
5a1bf5eb4a
commit
960ecb38f0
@@ -51,16 +51,16 @@ void NotificationCenterTest::test2()
|
||||
NotificationCenter nc;
|
||||
Observer<NotificationCenterTest, Notification> o(*this, &NotificationCenterTest::handle1);
|
||||
nc.addObserver(o);
|
||||
assert (nc.hasObserver(o));
|
||||
assert (nc.hasObservers());
|
||||
assert (nc.countObservers() == 1);
|
||||
assertTrue (nc.hasObserver(o));
|
||||
assertTrue (nc.hasObservers());
|
||||
assertTrue (nc.countObservers() == 1);
|
||||
nc.postNotification(new Notification);
|
||||
assert (_set.size() == 1);
|
||||
assert (_set.find("handle1") != _set.end());
|
||||
assertTrue (_set.size() == 1);
|
||||
assertTrue (_set.find("handle1") != _set.end());
|
||||
nc.removeObserver(Observer<NotificationCenterTest, Notification>(*this, &NotificationCenterTest::handle1));
|
||||
assert (!nc.hasObserver(o));
|
||||
assert (!nc.hasObservers());
|
||||
assert (nc.countObservers() == 0);
|
||||
assertTrue (!nc.hasObserver(o));
|
||||
assertTrue (!nc.hasObservers());
|
||||
assertTrue (nc.countObservers() == 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -70,21 +70,21 @@ void NotificationCenterTest::test3()
|
||||
Observer<NotificationCenterTest, Notification> o1(*this, &NotificationCenterTest::handle1);
|
||||
Observer<NotificationCenterTest, Notification> o2(*this, &NotificationCenterTest::handle2);
|
||||
nc.addObserver(o1);
|
||||
assert (nc.hasObserver(o1));
|
||||
assertTrue (nc.hasObserver(o1));
|
||||
nc.addObserver(o2);
|
||||
assert (nc.hasObserver(o2));
|
||||
assert (nc.hasObservers());
|
||||
assert (nc.countObservers() == 2);
|
||||
assertTrue (nc.hasObserver(o2));
|
||||
assertTrue (nc.hasObservers());
|
||||
assertTrue (nc.countObservers() == 2);
|
||||
nc.postNotification(new Notification);
|
||||
assert (_set.size() == 2);
|
||||
assert (_set.find("handle1") != _set.end());
|
||||
assert (_set.find("handle2") != _set.end());
|
||||
assertTrue (_set.size() == 2);
|
||||
assertTrue (_set.find("handle1") != _set.end());
|
||||
assertTrue (_set.find("handle2") != _set.end());
|
||||
nc.removeObserver(Observer<NotificationCenterTest, Notification>(*this, &NotificationCenterTest::handle1));
|
||||
assert (!nc.hasObserver(o1));
|
||||
assertTrue (!nc.hasObserver(o1));
|
||||
nc.removeObserver(Observer<NotificationCenterTest, Notification>(*this, &NotificationCenterTest::handle2));
|
||||
assert (!nc.hasObserver(o2));
|
||||
assert (!nc.hasObservers());
|
||||
assert (nc.countObservers() == 0);
|
||||
assertTrue (!nc.hasObserver(o2));
|
||||
assertTrue (!nc.hasObservers());
|
||||
assertTrue (nc.countObservers() == 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -94,28 +94,28 @@ void NotificationCenterTest::test4()
|
||||
Observer<NotificationCenterTest, Notification> o1(*this, &NotificationCenterTest::handle1);
|
||||
Observer<NotificationCenterTest, Notification> o2(*this, &NotificationCenterTest::handle2);
|
||||
nc.addObserver(o1);
|
||||
assert (nc.hasObserver(o1));
|
||||
assertTrue (nc.hasObserver(o1));
|
||||
nc.addObserver(o2);
|
||||
assert (nc.hasObserver(o2));
|
||||
assertTrue (nc.hasObserver(o2));
|
||||
nc.postNotification(new Notification);
|
||||
assert (_set.size() == 2);
|
||||
assert (_set.find("handle1") != _set.end());
|
||||
assert (_set.find("handle2") != _set.end());
|
||||
assertTrue (_set.size() == 2);
|
||||
assertTrue (_set.find("handle1") != _set.end());
|
||||
assertTrue (_set.find("handle2") != _set.end());
|
||||
nc.removeObserver(Observer<NotificationCenterTest, Notification>(*this, &NotificationCenterTest::handle1));
|
||||
assert (!nc.hasObserver(o1));
|
||||
assertTrue (!nc.hasObserver(o1));
|
||||
nc.removeObserver(Observer<NotificationCenterTest, Notification>(*this, &NotificationCenterTest::handle2));
|
||||
assert (!nc.hasObserver(o2));
|
||||
assertTrue (!nc.hasObserver(o2));
|
||||
_set.clear();
|
||||
nc.postNotification(new Notification);
|
||||
assert (_set.empty());
|
||||
assertTrue (_set.empty());
|
||||
Observer<NotificationCenterTest, Notification> o3(*this, &NotificationCenterTest::handle3);
|
||||
nc.addObserver(o3);
|
||||
assert (nc.hasObserver(o3));
|
||||
assertTrue (nc.hasObserver(o3));
|
||||
nc.postNotification(new Notification);
|
||||
assert (_set.size() == 1);
|
||||
assert (_set.find("handle3") != _set.end());
|
||||
assertTrue (_set.size() == 1);
|
||||
assertTrue (_set.find("handle3") != _set.end());
|
||||
nc.removeObserver(Observer<NotificationCenterTest, Notification>(*this, &NotificationCenterTest::handle3));
|
||||
assert (!nc.hasObserver(o3));
|
||||
assertTrue (!nc.hasObserver(o3));
|
||||
}
|
||||
|
||||
|
||||
@@ -125,13 +125,13 @@ void NotificationCenterTest::test5()
|
||||
nc.addObserver(Observer<NotificationCenterTest, Notification>(*this, &NotificationCenterTest::handle1));
|
||||
nc.addObserver(Observer<NotificationCenterTest, TestNotification>(*this, &NotificationCenterTest::handleTest));
|
||||
nc.postNotification(new Notification);
|
||||
assert (_set.size() == 1);
|
||||
assert (_set.find("handle1") != _set.end());
|
||||
assertTrue (_set.size() == 1);
|
||||
assertTrue (_set.find("handle1") != _set.end());
|
||||
_set.clear();
|
||||
nc.postNotification(new TestNotification);
|
||||
assert (_set.size() == 2);
|
||||
assert (_set.find("handle1") != _set.end());
|
||||
assert (_set.find("handleTest") != _set.end());
|
||||
assertTrue (_set.size() == 2);
|
||||
assertTrue (_set.find("handle1") != _set.end());
|
||||
assertTrue (_set.find("handleTest") != _set.end());
|
||||
nc.removeObserver(Observer<NotificationCenterTest, Notification>(*this, &NotificationCenterTest::handle1));
|
||||
nc.removeObserver(Observer<NotificationCenterTest, TestNotification>(*this, &NotificationCenterTest::handleTest));
|
||||
}
|
||||
@@ -142,8 +142,8 @@ void NotificationCenterTest::testAuto()
|
||||
NotificationCenter nc;
|
||||
nc.addObserver(NObserver<NotificationCenterTest, Notification>(*this, &NotificationCenterTest::handleAuto));
|
||||
nc.postNotification(new Notification);
|
||||
assert (_set.size() == 1);
|
||||
assert (_set.find("handleAuto") != _set.end());
|
||||
assertTrue (_set.size() == 1);
|
||||
assertTrue (_set.find("handleAuto") != _set.end());
|
||||
nc.removeObserver(NObserver<NotificationCenterTest, Notification>(*this, &NotificationCenterTest::handleAuto));
|
||||
}
|
||||
|
||||
@@ -153,8 +153,8 @@ void NotificationCenterTest::testDefaultCenter()
|
||||
NotificationCenter& nc = NotificationCenter::defaultCenter();
|
||||
nc.addObserver(Observer<NotificationCenterTest, Notification>(*this, &NotificationCenterTest::handle1));
|
||||
nc.postNotification(new Notification);
|
||||
assert (_set.size() == 1);
|
||||
assert (_set.find("handle1") != _set.end());
|
||||
assertTrue (_set.size() == 1);
|
||||
assertTrue (_set.find("handle1") != _set.end());
|
||||
nc.removeObserver(Observer<NotificationCenterTest, Notification>(*this, &NotificationCenterTest::handle1));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user