Ignore:
Timestamp:
Mar 18, 2013, 6:29:41 PM (13 years ago)
Author:
Frederik Heber <heber@…>
Children:
3f30cc
Parents:
b9273a
git-author:
Frederik Heber <heber@…> (03/18/13 18:22:47)
git-committer:
Frederik Heber <heber@…> (03/18/13 18:29:41)
Message:

Channels and Notifications pass on subjectKilled().

  • if we only sign on to a single notification channel, we miss on subjectKilled() completely. Hence, we have to chance of properly signing off again or, at least, to know that we must not anymore.
  • Hence, Observable's dstor now calls subjectKilled() on its Channels which passes the call on to all its Notifications that in turn use the subjectKilled() slot of their targets along with the passed-through Observable instance.
  • also added observerLog verbosity when signing on/off to channels.
  • explained this in header documentation of Observable, Channels, and Notification.
  • TESTFIX: ObserverUnitTest did not properly signOff() before deleting instances in relayNotificationTest().
File:
1 edited

Legend:

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

    rb9273a r1c291d  
    298298
    299299  RelayNotified->wasNotified=false;
     300  notificationObserver1->wasNotified=false;
    300301
    301302  // operation2
    302303  notificationObservable->operation2();
    303304  CPPUNIT_ASSERT(!RelayNotified->wasNotified);
    304   CPPUNIT_ASSERT(notificationObserver1->wasNotified);
     305  CPPUNIT_ASSERT(!notificationObserver1->wasNotified);
    305306
    306307  // signOff relay from 1 and operation1
     
    313314
    314315  // test kill subject
     316  RelayNotifier->signOff(RelayNotified, NotificationObservable::Operation1Notify);
    315317  delete RelayNotified;
    316318  RelayNotified = NULL; // delete in tearDown is allowed for NULL
    317319  notificationObservable->operation1();
     320  notificationObservable->signOff(RelayNotifier, NotificationObservable::Operation2Notify);
    318321  delete notificationObservable;
    319322  notificationObservable = NULL; // delete in tearDown is allowed for NULL
Note: See TracChangeset for help on using the changeset viewer.