summaryrefslogtreecommitdiff
path: root/ACE/tests/Bug_2820_Regression_Test.cpp
diff options
context:
space:
mode:
authorcoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2007-03-06 02:16:54 +0000
committercoryan <coryan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2007-03-06 02:16:54 +0000
commitd7c15e6b90ee1113d65bc621a11c093c3d01ac22 (patch)
treee97e7c73f395f3c00752a6fad9d5d6858a8f9509 /ACE/tests/Bug_2820_Regression_Test.cpp
parent15ea7d66b8a06acba82534d027b13a24762a8669 (diff)
downloadATCD-fix_bug_2820.tar.gz
Tue Mar 6 02:07:43 UTC 2007 Carlos O'Ryan <coryan@atdeesk.com>fix_bug_2820
Diffstat (limited to 'ACE/tests/Bug_2820_Regression_Test.cpp')
-rw-r--r--ACE/tests/Bug_2820_Regression_Test.cpp33
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)
{