summaryrefslogtreecommitdiff
path: root/ACE/tests/Bug_2540_Regression_Test.cpp
diff options
context:
space:
mode:
authorelliott_c <elliott_c@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2007-01-08 18:44:32 +0000
committerelliott_c <elliott_c@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2007-01-08 18:44:32 +0000
commit298edff473547f17a17fde324ba4088f6156ca37 (patch)
treeee982a7e46f07793b316763312cd99bec5e35b63 /ACE/tests/Bug_2540_Regression_Test.cpp
parentcc8733c945ba1649663af77785f77ebccfa12669 (diff)
downloadATCD-298edff473547f17a17fde324ba4088f6156ca37.tar.gz
ChangeLogTag: Mon Jan 8 18:43:36 UTC 2007 Chad Elliott <elliott_c@ociweb.com>
Diffstat (limited to 'ACE/tests/Bug_2540_Regression_Test.cpp')
-rw-r--r--ACE/tests/Bug_2540_Regression_Test.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/ACE/tests/Bug_2540_Regression_Test.cpp b/ACE/tests/Bug_2540_Regression_Test.cpp
index 72cd831cd8f..8999ee851c2 100644
--- a/ACE/tests/Bug_2540_Regression_Test.cpp
+++ b/ACE/tests/Bug_2540_Regression_Test.cpp
@@ -14,7 +14,7 @@
#include "ace/Pipe.h"
#include "ace/Event_Handler.h"
-#include "ace/Reactor.h"
+#include "ace/Select_Reactor.h"
ACE_RCSID (tests,
Bug_2540_Regression_Test,
@@ -67,7 +67,7 @@ private:
* in a repeating interval. On the first @c initial_iterations the Timer
* writes data through all of its handlers. On iteration @c initial_iteration
* it triggers bug 2540 by removing two handlers from the reactor.
- *
+ *
*/
class Timer : public ACE_Event_Handler
{
@@ -99,18 +99,19 @@ run_main (int, ACE_TCHAR *[])
{
ACE_START_TEST (ACE_TEXT ("Bug_2540_Regression_Test"));
- ACE_Reactor * reactor = ACE_Reactor::instance();
+ ACE_Select_Reactor select_reactor;
+ ACE_Reactor reactor (&select_reactor);
// Create the timer, this is the main driver for the test
Timer * timer = new Timer;
// Initialize the timer and register with the reactor
- if (-1 == timer->open(reactor))
+ if (-1 == timer->open(&reactor))
{
ACE_ERROR_RETURN ((LM_ERROR, "Cannot initialize timer\n"), -1);
}
- reactor->run_reactor_event_loop();
+ reactor.run_reactor_event_loop();
// Verify that the results are what we expect
if (!timer->check_expected_results())
@@ -120,6 +121,7 @@ run_main (int, ACE_TCHAR *[])
// Cleanup
timer->close();
+ delete timer;
ACE_END_TEST;
@@ -254,7 +256,7 @@ int Timer::handle_timeout(ACE_Time_Value const &, void const *)
// The first iterations are there just to prime things.
return 0;
}
-
+
if (iteration_ == initial_iterations)
{
// We expect the special_handler() to work normally after this
@@ -279,7 +281,7 @@ int Timer::handle_timeout(ACE_Time_Value const &, void const *)
return 0;
}
- reactor()->end_event_loop();
+ reactor()->end_reactor_event_loop();
return 0;
}