diff options
Diffstat (limited to 'ACE/tests')
-rw-r--r-- | ACE/tests/Bug_2820_Regression_Test.cpp | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/ACE/tests/Bug_2820_Regression_Test.cpp b/ACE/tests/Bug_2820_Regression_Test.cpp index 02026185780..9c61d4bde87 100644 --- a/ACE/tests/Bug_2820_Regression_Test.cpp +++ b/ACE/tests/Bug_2820_Regression_Test.cpp @@ -36,6 +36,9 @@ public: /// Constructor Simple_Handler(ACE_Reactor * reactor); + /// Destructor + ~Simple_Handler(); + /// Receive (and ignore) the notifications virtual int handle_exception(ACE_HANDLE); }; @@ -76,6 +79,9 @@ run_main (int, ACE_TCHAR *[]) reactor.reset(); + // Reset the reactor in the event handler, since it is gone.p + v->reactor(0); + ACE_Event_Handler::Reference_Count pos_release_count = v->add_reference(); @@ -90,18 +96,22 @@ run_main (int, ACE_TCHAR *[]) pre_notify_count, pos_release_count)); } - // Remove a reference for each time we explicitly increased it, - // minus one time because the _var will take care of that. + ACE_DEBUG ((LM_INFO, + ACE_TEXT("Ref count results. pre_notify refcount=%d,") + ACE_TEXT(" pos_notify=%d, pos_delete=%d\n"), + pre_notify_count, pos_notify_count, pos_release_count)); + + // Remove a reference for each time we explicitly increased it. v->remove_reference(); v->remove_reference(); + ACE_Event_Handler::Reference_Count pos_remove_count = + v->remove_reference(); - if (result == 0) - { - ACE_DEBUG ((LM_INFO, - ACE_TEXT("Test passed. pre_notify refcount=%d,") - ACE_TEXT(" pos_notify=%d, pos_delete=%d\n"), - pre_notify_count, pos_notify_count, pos_release_count)); - } + ACE_DEBUG ((LM_INFO, + ACE_TEXT("Ref count results. pre_notify refcount=%d,") + ACE_TEXT(" pos_notify=%d, pos_delete=%d, pos_remove=%d\n"), + pre_notify_count, pos_notify_count, pos_release_count, + pos_remove_count)); ACE_END_TEST; @@ -119,6 +129,11 @@ Simple_Handler( ACE_Event_Handler::Reference_Counting_Policy::ENABLED); } +Simple_Handler:: +~Simple_Handler() +{ +} + int Simple_Handler:: handle_exception(ACE_HANDLE) { |