Ignore:
Timestamp:
Dec 13, 2011, 9:46:12 AM (14 years ago)
Author:
Frederik Heber <heber@…>
Children:
2c11c1
Parents:
75d156
git-author:
Frederik Heber <heber@…> (12/02/11 10:05:36)
git-committer:
Frederik Heber <heber@…> (12/13/11 09:46:12)
Message:

Observable::signOn() now just needs channelno (enum) and not Notification_ptr.

  • this makes life a bit easier and allows for relaying notifications.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Patterns/Observer/unittests/ObserverUnitTest.cpp

    r75d156 r40f2e6  
    160160
    161161void ObserverTest::doesNotifyTest(){
    162   CPPUNIT_ASSERT_EQUAL(
    163       (size_t)NotificationObservable::Operation1Notify,
    164       notificationObservable->getChannel(NotificationObservable::Operation1Notify)->getChannelNo());
    165   CPPUNIT_ASSERT_EQUAL(
    166       (size_t)NotificationObservable::Operation2Notify,
    167       notificationObservable->getChannel(NotificationObservable::Operation2Notify)->getChannelNo());
    168   notificationObservable->signOn(notificationObserver1,
    169                                  notificationObservable->getChannel(NotificationObservable::Operation1Notify));
    170   notificationObservable->signOn(notificationObserver2,
    171                                  notificationObservable->getChannel(NotificationObservable::Operation2Notify));
     162  notificationObservable->signOn(notificationObserver1, NotificationObservable::Operation1Notify);
     163  notificationObservable->signOn(notificationObserver2, NotificationObservable::Operation2Notify);
    172164
    173165  notificationObservable->operation1();
     
    180172  CPPUNIT_ASSERT(!notificationObserver1->wasNotified);
    181173  CPPUNIT_ASSERT(notificationObserver2->wasNotified);
    182 
    183174}
    184175
     
    237228  CPPUNIT_ASSERT_EQUAL( 1, observer2->updates);
    238229
    239 
    240230  obsset->signOff(observer1);
    241231  obsmap->signOff(observer2);
Note: See TracChangeset for help on using the changeset viewer.