summaryrefslogtreecommitdiff
path: root/ACE/tests/Bug_2540_Regression_Test.cpp
diff options
context:
space:
mode:
authorSteve Huston <shuston@riverace.com>2007-04-04 17:11:25 +0000
committerSteve Huston <shuston@riverace.com>2007-04-04 17:11:25 +0000
commit4659172870074734774f3d92ba46fb6effcc617c (patch)
treefdbe91073e84ad816af2f48723b4f6e3a9f75e05 /ACE/tests/Bug_2540_Regression_Test.cpp
parentc3b7f386df3809f2f85ac2768521d66cd85869cb (diff)
downloadATCD-4659172870074734774f3d92ba46fb6effcc617c.tar.gz
ChangeLogTag:Wed Apr 4 16:32:03 UTC 2007 Steve Huston <shuston@riverace.com>
Diffstat (limited to 'ACE/tests/Bug_2540_Regression_Test.cpp')
-rw-r--r--ACE/tests/Bug_2540_Regression_Test.cpp24
1 files changed, 15 insertions, 9 deletions
diff --git a/ACE/tests/Bug_2540_Regression_Test.cpp b/ACE/tests/Bug_2540_Regression_Test.cpp
index 4847d4e6ae1..694504b7e4a 100644
--- a/ACE/tests/Bug_2540_Regression_Test.cpp
+++ b/ACE/tests/Bug_2540_Regression_Test.cpp
@@ -15,6 +15,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,
@@ -99,27 +100,32 @@ run_main (int, ACE_TCHAR *[])
{
ACE_START_TEST (ACE_TEXT ("Bug_2540_Regression_Test"));
- ACE_Reactor * reactor = ACE_Reactor::instance();
+ // Bug 2540 is all about ACE_Select_Reactor, so run it on that reactor
+ // regardless of platform. In particular, this test relies on a handler
+ // that doesn't consume ready-to-read data being called back - this won't
+ // happen with ACE_WFMO_Reactor.
+ 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())
- {
+ if (!timer->check_expected_results ())
+ {
ACE_ERROR_RETURN ((LM_ERROR, "Test failed\n"), -1);
- }
+ }
// Cleanup
- timer->close();
+ timer->close ();
delete timer;
ACE_END_TEST;