2 * @file Bug_2368_Regression_Test.cpp
4 * Reproduces the problems reported in bug 2368:
5 * http://bugzilla.dre.vanderbilt.edu/show_bug.cgi?id=2368
7 * @author Johnny Willemsen <jwillemsen@remedy.nl>
10 #include "test_config.h"
11 #include "ace/Service_Config.h"
12 #include "ace/Reactor.h"
13 #include "ace/Log_Msg.h"
14 #include "ace/Signal.h"
16 static bool handleA_close_called
= false;
17 static bool handleB_close_called
= false;
19 class My_HandlerA
: public ACE_Event_Handler
22 virtual int handle_close (ACE_HANDLE
,
26 "Handle close called\n"));
27 handleA_close_called
= true;
32 virtual int handle_signal (int,
37 "Handle signal called\n"));
43 class My_HandlerB
: public ACE_Event_Handler
46 virtual int handle_close (ACE_HANDLE
,
50 "Handle close called\n"));
51 handleB_close_called
= true;
56 virtual int handle_signal (int,
61 "Handle signal called\n"));
68 run_main (int, ACE_TCHAR
*[])
70 ACE_START_TEST (ACE_TEXT ("Bug_2368_Regression_Test"));
72 My_HandlerA my_handlerA
;
73 My_HandlerB my_handlerB
;
75 // Set up an ACE signal handler.
76 if (ACE_Reactor::instance ()->register_handler
81 ACE_TEXT ("register_handlerA")));
83 if (ACE_Reactor::instance ()->register_handler
88 ACE_TEXT ("register_handlerB")));
90 ACE_Sig_Action
*new_disp
= 0;
91 if (ACE_Reactor::instance ()->remove_handler
96 ACE_TEXT ("remove_handlerB")));
98 if (ACE_Reactor::instance ()->close () == -1)
101 ACE_TEXT ("close")));
103 if (!handleA_close_called
)
104 ACE_ERROR ((LM_ERROR
,
105 ACE_TEXT ("Handle close hasn't been called for A.\n")));
107 if (!handleB_close_called
)
108 ACE_ERROR ((LM_ERROR
,
109 ACE_TEXT ("Handle close hasn't been called for B.\n")));