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 int handle_close (ACE_HANDLE
, ACE_Reactor_Mask
) override
25 "Handle close called\n"));
26 handleA_close_called
= true;
31 int handle_signal (int, siginfo_t
*, ucontext_t
*) override
34 "Handle signal called\n"));
40 class My_HandlerB
: public ACE_Event_Handler
43 int handle_close (ACE_HANDLE
, ACE_Reactor_Mask
) override
46 "Handle close called\n"));
47 handleB_close_called
= true;
52 int handle_signal (int, siginfo_t
*, ucontext_t
*) override
55 "Handle signal called\n"));
62 run_main (int, ACE_TCHAR
*[])
64 ACE_START_TEST (ACE_TEXT ("Bug_2368_Regression_Test"));
66 My_HandlerA my_handlerA
;
67 My_HandlerB my_handlerB
;
69 // Set up an ACE signal handler.
70 if (ACE_Reactor::instance ()->register_handler
75 ACE_TEXT ("register_handlerA")));
77 if (ACE_Reactor::instance ()->register_handler
82 ACE_TEXT ("register_handlerB")));
84 ACE_Sig_Action
*new_disp
= 0;
85 if (ACE_Reactor::instance ()->remove_handler
90 ACE_TEXT ("remove_handlerB")));
92 if (ACE_Reactor::instance ()->close () == -1)
97 if (!handleA_close_called
)
99 ACE_TEXT ("Handle close hasn't been called for A.\n")));
101 if (!handleB_close_called
)
102 ACE_ERROR ((LM_ERROR
,
103 ACE_TEXT ("Handle close hasn't been called for B.\n")));