diff options
author | vzykov <vzykov@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2009-09-03 09:20:13 +0000 |
---|---|---|
committer | vzykov <vzykov@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2009-09-03 09:20:13 +0000 |
commit | 84ee820cf5cc4dc00be1e9f910fcb5e608fcf18e (patch) | |
tree | 916067ed39ce1f18e859c54cc1a7247eb24733dc /TAO/tests/Bug_1361_Regression | |
parent | 3a60a4722dd77b744ba2b4c3098681c6dad889b5 (diff) | |
download | ATCD-84ee820cf5cc4dc00be1e9f910fcb5e608fcf18e.tar.gz |
ChangeLogTag: Thu Sep 3 09:01:53 UTC 2009 Vladimir Zykov <vz@prismtech.com>
Diffstat (limited to 'TAO/tests/Bug_1361_Regression')
-rw-r--r-- | TAO/tests/Bug_1361_Regression/Echo.cpp | 7 | ||||
-rw-r--r-- | TAO/tests/Bug_1361_Regression/Echo_Caller.cpp | 3 | ||||
-rw-r--r-- | TAO/tests/Bug_1361_Regression/Server_Thread_Pool.cpp | 2 | ||||
-rw-r--r-- | TAO/tests/Bug_1361_Regression/Server_Timer.cpp | 65 | ||||
-rw-r--r-- | TAO/tests/Bug_1361_Regression/Server_Timer.h | 41 | ||||
-rw-r--r-- | TAO/tests/Bug_1361_Regression/client.cpp | 13 | ||||
-rw-r--r-- | TAO/tests/Bug_1361_Regression/server.cpp | 3 |
7 files changed, 10 insertions, 124 deletions
diff --git a/TAO/tests/Bug_1361_Regression/Echo.cpp b/TAO/tests/Bug_1361_Regression/Echo.cpp index 03cd406e7c4..2a576562d39 100644 --- a/TAO/tests/Bug_1361_Regression/Echo.cpp +++ b/TAO/tests/Bug_1361_Regression/Echo.cpp @@ -29,13 +29,12 @@ Echo::echo_payload(Test::Payload const &) { ACE_DEBUG ((LM_DEBUG, "(%P|%t) Echo::echo_payload, aborting\n")); // Kill the app - ACE_OS::raise(SIGABRT); + ACE::terminate_process (ACE_OS::getpid ()); } } void -Echo::echo_payload_out ( - Test::Payload_out data) +Echo::echo_payload_out (Test::Payload_out data) { int j = ACE_OS::rand() % 40000; data = new Test::Payload(j); @@ -48,7 +47,7 @@ Echo::echo_payload_out ( { ACE_DEBUG ((LM_DEBUG, "(%P|%t) Echo::echo_payload_out, aborting\n")); // Kill the app - ACE_OS::raise(SIGABRT); + ACE::terminate_process (ACE_OS::getpid ()); } } diff --git a/TAO/tests/Bug_1361_Regression/Echo_Caller.cpp b/TAO/tests/Bug_1361_Regression/Echo_Caller.cpp index 1ae9fbefd7b..110a0496f78 100644 --- a/TAO/tests/Bug_1361_Regression/Echo_Caller.cpp +++ b/TAO/tests/Bug_1361_Regression/Echo_Caller.cpp @@ -7,7 +7,6 @@ * */ #include "Echo_Caller.h" -#include "Server_Timer.h" #include "tao/ORB_Core.h" #include "Server_Thread_Pool.h" @@ -22,7 +21,7 @@ Echo_Caller::Echo_Caller(CORBA::ORB_ptr orb, Thread_Pool *pool) void Echo_Caller::start_task(Test::Echo_ptr client) { - pool_->put(Test::Echo::_duplicate(client)); + pool_->put(client); } void diff --git a/TAO/tests/Bug_1361_Regression/Server_Thread_Pool.cpp b/TAO/tests/Bug_1361_Regression/Server_Thread_Pool.cpp index 5e353e9c229..126d54295b2 100644 --- a/TAO/tests/Bug_1361_Regression/Server_Thread_Pool.cpp +++ b/TAO/tests/Bug_1361_Regression/Server_Thread_Pool.cpp @@ -62,7 +62,7 @@ Thread_Pool::shutdown (void) int Thread_Pool::put (Test::Echo_ptr echoptr) { - char * charData = (char *)echoptr; + char * charData = (char *) Test::Echo::_duplicate (echoptr); ACE_Message_Block *mb; ACE_NEW_RETURN(mb, ACE_Message_Block(charData), -1); diff --git a/TAO/tests/Bug_1361_Regression/Server_Timer.cpp b/TAO/tests/Bug_1361_Regression/Server_Timer.cpp deleted file mode 100644 index d7eeb0b45e4..00000000000 --- a/TAO/tests/Bug_1361_Regression/Server_Timer.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/** - * @file Server_Timer.cpp - * - * $Id$ - * - * @author Carlos O'Ryan <coryan@atdesk.com> - * - */ -#include "Server_Timer.h" -#include "ace/Reactor.h" - -ACE_RCSID(Bug_1270_Regression, Server_Timer, "$Id$") - -Server_Timer::Server_Timer(Test::Echo_ptr echo, - ACE_Reactor * reactor) - : ACE_Event_Handler (reactor) - , echo_(Test::Echo::_duplicate(echo)) - , refcnt_ (1) -{ -} - -void -Server_Timer::activate (void) -{ - ACE_Time_Value tv (0, 20000); - this->reactor()->schedule_timer (this, 0, tv, tv); -} - -int -Server_Timer::handle_timeout (ACE_Time_Value const &, void const *) -{ - refcnt_++; - - - Test::Payload pload(1024); pload.length(1024); - ACE_OS::memset(pload.get_buffer(), pload.length(), 0); - try - { - Test::Echo_var echo = Test::Echo::_duplicate(this->echo_.in()); - if(CORBA::is_nil(echo.in())) - return 0; - - echo->echo_payload(pload); - } - catch (const CORBA::Exception& ex) - { - this->echo_ = Test::Echo::_nil (); - - if(this->reactor()->cancel_timer(this) != 0) - refcnt_--; - } - - refcnt_--; - if(refcnt_ == 0) - return -1; - - return 0; -} - -int -Server_Timer::handle_close (ACE_HANDLE, ACE_Reactor_Mask) -{ - delete this; - return 0; -} diff --git a/TAO/tests/Bug_1361_Regression/Server_Timer.h b/TAO/tests/Bug_1361_Regression/Server_Timer.h deleted file mode 100644 index 55d51862464..00000000000 --- a/TAO/tests/Bug_1361_Regression/Server_Timer.h +++ /dev/null @@ -1,41 +0,0 @@ -/** - * @file Server_Timer.h - * - * $Id$ - * - * @author Carlos O'Ryan <coryan@atdesk.com> - * - */ - -#ifndef Server_Timer__h_ -#define Server_Timer__h_ -#include /**/ "ace/pre.h" - -#include "TestC.h" -#include "ace/Event_Handler.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -class Server_Timer : public ACE_Event_Handler -{ -public: - /// Constructor - Server_Timer (Test::Echo_ptr echo, ACE_Reactor * reactor); - - void activate (void); - - /// Thread entry point - int handle_timeout(ACE_Time_Value const & tv, void const *); - int handle_close (ACE_HANDLE, ACE_Reactor_Mask); - -private: - /// Reference to the test interface - Test::Echo_var echo_; - - int refcnt_; -}; - -#include /**/ "ace/post.h" -#endif /* Server_Timer__h_ */ diff --git a/TAO/tests/Bug_1361_Regression/client.cpp b/TAO/tests/Bug_1361_Regression/client.cpp index 760a38b134d..a4ecf15abba 100644 --- a/TAO/tests/Bug_1361_Regression/client.cpp +++ b/TAO/tests/Bug_1361_Regression/client.cpp @@ -25,6 +25,8 @@ public: Client_Timer (ACE_Reactor * reactor) : ACE_Event_Handler (reactor) { + this->reference_counting_policy ().value ( + ACE_Event_Handler::Reference_Counting_Policy::ENABLED); } void activate (void) @@ -36,17 +38,11 @@ public: /// Thread entry point int handle_timeout (ACE_Time_Value const & , void const *) { - // kill the application - ACE_OS::raise (SIGABRT); this->reactor ()->cancel_timer (this); + // kill the application + ACE::terminate_process (ACE_OS::getpid ()); return 0; } - int handle_close (ACE_HANDLE, ACE_Reactor_Mask) - { - delete this; - return 0; - } - }; int @@ -151,6 +147,7 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) Client_Timer * task = new Client_Timer (orb->orb_core()->reactor()); task->activate (); + task->remove_reference (); orb->run (); diff --git a/TAO/tests/Bug_1361_Regression/server.cpp b/TAO/tests/Bug_1361_Regression/server.cpp index 9f4a08a877d..81c79c0a7c2 100644 --- a/TAO/tests/Bug_1361_Regression/server.cpp +++ b/TAO/tests/Bug_1361_Regression/server.cpp @@ -37,9 +37,6 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) PortableServer::POAManager_var poa_manager = root_poa->the_POAManager (); - CORBA::Object_var object = - orb->resolve_initial_references ("PolicyCurrent"); - if (parse_args (argc, argv) != 0) return 1; |