diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2005-05-30 13:13:58 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2005-05-30 13:13:58 +0000 |
commit | dab927d7afc40d43e4d4174bee9693ee5aaeee68 (patch) | |
tree | d6b5d6e8e8ead2145760a36cd675be18e9967771 | |
parent | f74136012d5065243d95ae85ae25576dbf320c78 (diff) | |
download | ATCD-dab927d7afc40d43e4d4174bee9693ee5aaeee68.tar.gz |
ChangeLogTag: Mon May 30 12:25:12 UTC 2005 Johnny Willemsen <jwillemsen@remedy.nl>
-rw-r--r-- | TAO/tao/ORBInitializer_Registry.cpp | 30 | ||||
-rw-r--r-- | TAO/tests/Portable_Interceptors/Bug_2088/Bug_2088.mpc | 11 | ||||
-rw-r--r-- | TAO/tests/Portable_Interceptors/Bug_2088/Client_ORBInitializer.cpp | 37 | ||||
-rw-r--r-- | TAO/tests/Portable_Interceptors/Bug_2088/Client_ORBInitializer.h | 51 | ||||
-rw-r--r-- | TAO/tests/Portable_Interceptors/Bug_2088/client.cpp | 58 | ||||
-rwxr-xr-x | TAO/tests/Portable_Interceptors/Bug_2088/run_test.pl | 26 | ||||
-rw-r--r-- | bin/tao_orb_tests.lst | 1 |
7 files changed, 208 insertions, 6 deletions
diff --git a/TAO/tao/ORBInitializer_Registry.cpp b/TAO/tao/ORBInitializer_Registry.cpp index 7a9bb00e595..e73dc6f7cfd 100644 --- a/TAO/tao/ORBInitializer_Registry.cpp +++ b/TAO/tao/ORBInitializer_Registry.cpp @@ -99,9 +99,18 @@ TAO::ORBInitializer_Registry::pre_init ( size_t const initializer_count (this->initializers_.size ()); for (size_t i = 0; i < initializer_count; ++i) { - this->initializers_[i]->pre_init (info - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; + ACE_TRY + { + this->initializers_[i]->pre_init (info + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + } + ACE_CATCHALL + { + // Ignore errors from pre_init, just continue with the next + // initializer + } + ACE_ENDTRY; } } @@ -117,9 +126,18 @@ TAO::ORBInitializer_Registry::post_init ( size_t const initializer_count (this->initializers_.size ()); for (size_t i = 0; i < initializer_count; ++i) { - this->initializers_[i]->post_init (info - ACE_ENV_ARG_PARAMETER); - ACE_CHECK; + ACE_TRY + { + this->initializers_[i]->post_init (info + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + } + ACE_CATCHALL + { + // Ignore errors from post_init, just continue with the next + // initializer + } + ACE_ENDTRY; } } diff --git a/TAO/tests/Portable_Interceptors/Bug_2088/Bug_2088.mpc b/TAO/tests/Portable_Interceptors/Bug_2088/Bug_2088.mpc new file mode 100644 index 00000000000..08db9a4a3f8 --- /dev/null +++ b/TAO/tests/Portable_Interceptors/Bug_2088/Bug_2088.mpc @@ -0,0 +1,11 @@ +// -*- MPC -*- +// $Id$ + +project(*Client): taoclient { + requires += interceptors + Source_Files { + Client_ORBInitializer.cpp + client.cpp + } +} + diff --git a/TAO/tests/Portable_Interceptors/Bug_2088/Client_ORBInitializer.cpp b/TAO/tests/Portable_Interceptors/Bug_2088/Client_ORBInitializer.cpp new file mode 100644 index 00000000000..db9719164d0 --- /dev/null +++ b/TAO/tests/Portable_Interceptors/Bug_2088/Client_ORBInitializer.cpp @@ -0,0 +1,37 @@ +// -*- C++ -*- +// +// $Id$ +// + +#include "Client_ORBInitializer.h" + +ACE_RCSID (Bug_2088, Client_ORBInitializer, "$Id$") + +Client_ORBInitializer::Client_ORBInitializer (void) : + pre_init_called (false), + post_init_called (false) +{ +} + +void +Client_ORBInitializer::pre_init ( + PortableInterceptor::ORBInitInfo_ptr + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + pre_init_called = true; + + ACE_THROW (CORBA::NO_MEMORY ()); +} + +void +Client_ORBInitializer::post_init ( + PortableInterceptor::ORBInitInfo_ptr + ACE_ENV_ARG_DECL) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + post_init_called = true; + + ACE_THROW (CORBA::NO_MEMORY ()); +} + diff --git a/TAO/tests/Portable_Interceptors/Bug_2088/Client_ORBInitializer.h b/TAO/tests/Portable_Interceptors/Bug_2088/Client_ORBInitializer.h new file mode 100644 index 00000000000..be3545b69ac --- /dev/null +++ b/TAO/tests/Portable_Interceptors/Bug_2088/Client_ORBInitializer.h @@ -0,0 +1,51 @@ +// -*- C++ -*- +// +// $Id$ +// + +#ifndef TAO_CLIENT_ORB_INITIALIZER_H +#define TAO_CLIENT_ORB_INITIALIZER_H +#include /**/ "ace/pre.h" + +#include "tao/PortableInterceptorC.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/LocalObject.h" + +// This is to remove "inherits via dominance" warnings from MSVC. +// MSVC is being a little too paranoid. +#if defined(_MSC_VER) +#pragma warning(push) +#pragma warning(disable:4250) +#endif /* _MSC_VER */ + +/// Client ORB initializer. +class Client_ORBInitializer : + public virtual PortableInterceptor::ORBInitializer, + public virtual TAO_Local_RefCounted_Object +{ +public: + /// Constructor + Client_ORBInitializer (void); + + virtual void pre_init (PortableInterceptor::ORBInitInfo_ptr info + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + virtual void post_init (PortableInterceptor::ORBInitInfo_ptr info + ACE_ENV_ARG_DECL_WITH_DEFAULTS) + ACE_THROW_SPEC ((CORBA::SystemException)); + + bool pre_init_called; + bool post_init_called; +}; + +#if defined(_MSC_VER) +#pragma warning(pop) +#endif /* _MSC_VER */ + +#include /**/ "ace/post.h" +#endif /* TAO_CLIENT_ORB_INITIALIZER_H */ diff --git a/TAO/tests/Portable_Interceptors/Bug_2088/client.cpp b/TAO/tests/Portable_Interceptors/Bug_2088/client.cpp new file mode 100644 index 00000000000..d561d7914d4 --- /dev/null +++ b/TAO/tests/Portable_Interceptors/Bug_2088/client.cpp @@ -0,0 +1,58 @@ +// $Id$ + +#include "ace/Get_Opt.h" +#include "Client_ORBInitializer.h" +#include "tao/ORBInitializer_Registry.h" + +ACE_RCSID(Interceptors, client, "$Id$") + +int +main (int argc, char *argv[]) +{ + ACE_TRY_NEW_ENV + { + Client_ORBInitializer* initializer1 = 0; + Client_ORBInitializer* initializer2 = 0; + + ACE_NEW_RETURN (initializer1, + Client_ORBInitializer, + -1); // No exceptions yet! + + ACE_NEW_RETURN (initializer2, + Client_ORBInitializer, + -1); // No exceptions yet! + + PortableInterceptor::ORBInitializer_var initializer_var1 = + initializer1; + + PortableInterceptor::ORBInitializer_var initializer_var2 = + initializer2; + + PortableInterceptor::register_orb_initializer (initializer_var1.in () + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + PortableInterceptor::register_orb_initializer (initializer_var2.in () + ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + CORBA::ORB_var orb = + CORBA::ORB_init (argc, argv, "" ACE_ENV_ARG_PARAMETER); + ACE_TRY_CHECK; + + // For both initializers pre/post must be called. + ACE_ASSERT (initializer1->pre_init_called == true); + ACE_ASSERT (initializer2->pre_init_called == true); + ACE_ASSERT (initializer1->post_init_called == true); + ACE_ASSERT (initializer2->post_init_called == true); + } + ACE_CATCHANY + { + ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, + "Caught exception in client:"); + return 1; + } + ACE_ENDTRY; + + return 0; +} diff --git a/TAO/tests/Portable_Interceptors/Bug_2088/run_test.pl b/TAO/tests/Portable_Interceptors/Bug_2088/run_test.pl new file mode 100755 index 00000000000..6cbfb81a45c --- /dev/null +++ b/TAO/tests/Portable_Interceptors/Bug_2088/run_test.pl @@ -0,0 +1,26 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# $Id$ +# -*- perl -*- + +use lib '../../../../bin'; +use PerlACE::Run_Test; + +if (PerlACE::is_vxworks_test()) { + $CL = new PerlACE::ProcessVX ("client"); +} +else { + $CL = new PerlACE::Process ("client"); +} +print STDERR "\n==== Running bug 2088 test\n"; + +$client = $CL->SpawnWaitKill (5); + +if ($client != 0) { + print STDERR "ERROR: client returned $client\n"; + $status = 1; +} + +exit $status; diff --git a/bin/tao_orb_tests.lst b/bin/tao_orb_tests.lst index 9f7854ebae9..9ce37906751 100644 --- a/bin/tao_orb_tests.lst +++ b/bin/tao_orb_tests.lst @@ -155,6 +155,7 @@ TAO/tests/Portable_Interceptors/PICurrent/run_test.pl: !MINIMUM !DISABLE_INTERCE TAO/tests/Portable_Interceptors/AMI/run_test.pl: !MINIMUM !DISABLE_INTERCEPTORS TAO/tests/Portable_Interceptors/ORB_Shutdown/run_test.pl: !MINIMUM !DISABLE_INTERCEPTORS TAO/tests/Portable_Interceptors/PolicyFactory/run_test.pl: !MINIMUM !DISABLE_INTERCEPTORS +TAO/tests/Portable_Interceptors/Bug_2088/run_test.pl: !MINIMUM !DISABLE_INTERCEPTORS TAO/tests/ORT/run_test.pl: !MINIMUM !DISABLE_INTERCEPTORS TAO/tests/Object_Loader/run_test.pl: !VxWorks !STATIC TAO/tests/Two_Objects/run_test.pl: !ST |