diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 2001-07-03 15:33:48 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 2001-07-03 15:33:48 +0000 |
commit | 238dfbfac4c98d7dc1c0c57f88f4e705d915e335 (patch) | |
tree | 4c6a5117fcd79fd58f1d7b090f01830af6362a6c /tests/Reactor_Notify_Test.cpp | |
parent | 7ba0128251a63d0485d1e069cea012d306a21717 (diff) | |
download | ATCD-238dfbfac4c98d7dc1c0c57f88f4e705d915e335.tar.gz |
ChangeLogTag:Tue Jul 3 06:20:13 2001 Douglas C. Schmidt <schmidt@tango.doc.wustl.edu>
Diffstat (limited to 'tests/Reactor_Notify_Test.cpp')
-rw-r--r-- | tests/Reactor_Notify_Test.cpp | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/tests/Reactor_Notify_Test.cpp b/tests/Reactor_Notify_Test.cpp index 2b56d91bb6e..a3ce3f079e2 100644 --- a/tests/Reactor_Notify_Test.cpp +++ b/tests/Reactor_Notify_Test.cpp @@ -380,8 +380,9 @@ run_notify_purge_test (void) ACE_NEW_RETURN (n2, Purged_Notify, -1); auto_ptr<Purged_Notify> ap (n2); - r->notify (&n1); - r->notify (n2); + // First test: + // Notify EXCEPT, and purge ALL + r->notify (&n1); // the mask is EXCEPT_MASK status = r->purge_pending_notifications (&n1); if (status == -1 && errno == ENOTSUP) @@ -390,6 +391,39 @@ run_notify_purge_test (void) ACE_ERROR ((LM_ERROR, ACE_TEXT ("Purged %d notifies; expected 1\n"), status)); + // Second test: + // Notify READ twice, and WRITE once, and purge READ and WRITE - should purge 3 times. + r->notify (&n1, ACE_Event_Handler::READ_MASK); + r->notify (&n1, ACE_Event_Handler::READ_MASK); + r->notify (&n1, ACE_Event_Handler::WRITE_MASK); + status = r->purge_pending_notifications + (&n1, ACE_Event_Handler::READ_MASK | ACE_Event_Handler::WRITE_MASK); + if (status != 3) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("Purged %d notifies; expected 3\n"), + status)); + // Third test: + // Notify READ on 2 handlers, and purge READ|WRITE on all handlers. Should purge 2 + r->notify (&n1, ACE_Event_Handler::READ_MASK); + r->notify (n2, ACE_Event_Handler::READ_MASK); + status = r->purge_pending_notifications + (0, ACE_Event_Handler::READ_MASK | ACE_Event_Handler::WRITE_MASK); + if (status != 2) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("Purged %d notifies; expected 2\n"), + status)); + // Forth test: + // Notify EXCEPT and WRITE, purge READ. Should not purge + r->notify (&n1); // the mask is EXCEPT_MASK + r->notify (&n1, ACE_Event_Handler::WRITE_MASK); + status = r->purge_pending_notifications + (&n1, ACE_Event_Handler::READ_MASK); + if (status != 0) + ACE_ERROR ((LM_ERROR, + ACE_TEXT ("Purged %d notifies; expected 0\n"), + status)); + // Fifth test: + r->notify (n2); // <ap> destructor should cause n2's notify to be cancelled. } |