diff options
Diffstat (limited to 'tests')
73 files changed, 2325 insertions, 1276 deletions
diff --git a/tests/AMI/run_mt_noupcall.pl b/tests/AMI/run_mt_noupcall.pl index 76ce949dbdd..72efcaa386b 100755 --- a/tests/AMI/run_mt_noupcall.pl +++ b/tests/AMI/run_mt_noupcall.pl @@ -11,7 +11,12 @@ use PerlACE::TestTarget; my $server = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n"; my $client = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n"; -$client_conf = $client->LocalFile ("mt_noupcall$PerlACE::svcconf_ext"); +$client_conf_base = "mt_noupcall$PerlACE::svcconf_ext"; +$client_conf = $client->LocalFile ($client_conf_base); +if ($client->PutFile ($client_conf_base) == -1) { + print STDERR "ERROR: cannot set file <$client_conf>\n"; + exit 1; +} $server_debug_level = '0'; $client_debug_level = '0'; diff --git a/tests/AMI/run_test.pl b/tests/AMI/run_test.pl index 29fe59a71aa..c02a5175c5d 100755 --- a/tests/AMI/run_test.pl +++ b/tests/AMI/run_test.pl @@ -11,25 +11,28 @@ use PerlACE::TestTarget; my $server = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n"; my $client = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n"; -$client_conf = $client->LocalFile ("muxed$PerlACE::svcconf_ext"); $server_debug_level = '0'; $client_debug_level = '0'; $iterations = '1'; +$conf_file = "muxed$PerlACE::svcconf_ext"; + foreach $i (@ARGV) { if ($i eq '-mux') { - $client_conf = $client->LocalFile ("muxed$PerlACE::svcconf_ext"); + $conf_file = "muxed$PerlACE::svcconf_ext"; } elsif ($i eq '-debug') { $server_debug_level = '1'; $client_debug_level = '1'; } elsif ($i eq '-exclusive') { - $client_conf = $client->LocalFile ("exclusive$PerlACE::svcconf_ext"); + $conf_file = "exclusive$PerlACE::svcconf_ext"; } } +$client_conf = $client->LocalFile ($conf_file); + my $iorbase = "server.ior"; my $server_iorfile = $server->LocalFile ($iorbase); my $client_iorfile = $client->LocalFile ($iorbase); @@ -61,6 +64,12 @@ if ($client->PutFile ($iorbase) == -1) { $SV->Kill (); $SV->TimedWait (1); exit 1; } +# copy the configruation file. +if ($client->PutFile ($conf_file) == -1) { + print STDERR "ERROR: cannot set file <$client_conf>\n"; + $SV->Kill (); $SV->TimedWait (1); + exit 1; +} $CL = $client->CreateProcess ("simple_client", "-ORBsvcconf $client_conf " diff --git a/tests/Bug_1383_Regression/SimpleClient.cpp b/tests/Bug_1383_Regression/SimpleClient.cpp index ea3fa36e0bf..4b9cc99d591 100644 --- a/tests/Bug_1383_Regression/SimpleClient.cpp +++ b/tests/Bug_1383_Regression/SimpleClient.cpp @@ -7,122 +7,128 @@ #include "Callee_i.h" #include "tao/IORManipulation/IORManip_Loader.h" -CORBA::ORB_var orb; +CORBA::ORB_var _orb; ACE_THR_FUNC_RETURN RunFunc(void *) { - ACE_DEBUG ((LM_DEBUG, "running the orb\n")); - orb->run(); - ACE_DEBUG ((LM_DEBUG, "done running orb\n")); + ACE_DEBUG ((LM_DEBUG, "running the _orb\n")); + _orb->run(); + ACE_DEBUG ((LM_DEBUG, "done running _orb\n")); return 0; } int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) { - // initialize the ORB - orb = CORBA::ORB_init (argc, argv); - - // Get the "RootPOA" - CORBA::Object_var obj = orb->resolve_initial_references("RootPOA"); - PortableServer::POA_var poa = PortableServer::POA::_narrow(obj.in ()); - - // activate its managers so it can handle incoming requests - poa->the_POAManager()->activate(); - - // get a thread going to handle incoming requests - ACE_Thread::spawn(RunFunc); - - // we could also use the corbaloc syntax to get a reference to the - // object. This will cause the orb to talk directly to the other - // orb with no name service or common file involved. - obj = orb->string_to_object("corbaloc::localhost:9999/Simple"); - - if (CORBA::is_nil(obj.in ())) + try { - ACE_ERROR ((LM_ERROR, "could not get reference\n")); - return 1; + // initialize the ORB + _orb = CORBA::ORB_init (argc, argv); + + // Get the "RootPOA" + CORBA::Object_var obj = _orb->resolve_initial_references("RootPOA"); + PortableServer::POA_var poa = PortableServer::POA::_narrow(obj.in ()); + + // activate its managers so it can handle incoming requests + poa->the_POAManager()->activate(); + + // get a thread going to handle incoming requests + ACE_Thread::spawn(RunFunc); + + // we could also use the c_orbaloc syntax to get a reference to the + // object. This will cause the _orb to talk directly to the other + // _orb with no name service or common file involved. + obj = _orb->string_to_object("c_orbaloc::localhost:9999/Simple"); + + if (CORBA::is_nil(obj.in ())) + { + ACE_ERROR ((LM_ERROR, "could not get reference\n")); + return 1; + } + + // narrow the reference to the particular type we wish to deal with + Simple_var simple = Simple::_narrow(obj.in ()); + if (CORBA::is_nil(simple.in ())) + { + ACE_ERROR ((LM_ERROR, "could not get reference\n")); + return 1; + } + + // create an object reference that has a bogus value for the first + // profile + obj = _orb->resolve_initial_references("IORManipulation"); + TAO_IOP::TAO_IOR_Manipulation_var iorm = + TAO_IOP::TAO_IOR_Manipulation::_narrow(obj.in()); + + // Status: The following scenarios appear to work: + // - first profile invalid host name, second profile valid. + // - first profile invalid ip number, second profiel valid. + // - first profiel invalid port number, second profile valid. + // + // The following causes a core dump of the server: + // - first and second invalid + // + // Note that he iormanip is being used since it is not practical + // to have a test case that depends on a VPN being present. + // + CORBA::Object_var name1 = + _orb->string_to_object ("c_orbaloc:iiop:10.0.2.3:6060/xyz"); + CORBA::Object_var name2 = + _orb->string_to_object ("c_orbaloc:iiop:daisnot:7070/xyz"); + CORBA::String_var name1_ior = _orb->object_to_string(name1.in()); + CORBA::String_var name2_ior = _orb->object_to_string(name2.in()); + + // create a callback object + Callee_i * callee_i = new Callee_i; + // get the CORBA reference + PortableServer::ObjectId_var id = + poa->activate_object (callee_i); + + CORBA::Object_var object_act = poa->id_to_reference (id.in ()); + + Callee_var callee = Callee::_narrow (object_act.in ()); + + if (CORBA::is_nil(callee.in ())) + { + ACE_ERROR ((LM_ERROR, "could not get callback object\n")); + return 1; + } + else + { + CORBA::String_var str = _orb->object_to_string(callee.in ()); + FILE *output_file= ACE_OS::fopen ("ior", "w"); + if (output_file == 0) + ACE_ERROR_RETURN ((LM_ERROR, + "Cannot open output file for writing IOR: ior\n"), + 1); + ACE_OS::fprintf (output_file, "%s", str.in ()); + ACE_OS::fclose (output_file); + } + + // create a reference with two profiles with the first on being + // bogus. If things work as they should the callback should be + // succesful with the ORB trying the second profile. + TAO_IOP::TAO_IOR_Manipulation::IORList iors (2); + iors.length (2); + iors [0] = name1; + iors [1] = name2; + + CORBA::Object_var merged = iorm->merge_iors(iors); + Callee_var doubleCallee = Callee::_unchecked_narrow(merged.in()); + + ACE_DEBUG ((LM_DEBUG, "Profile count is %d\n", + iorm->get_profile_count(merged.in()))); + + simple->registerCallee(doubleCallee.in ()); + + ACE_OS::sleep(120); + + ACE_DEBUG ((LM_DEBUG, "done sleeping\n")); + + _orb->shutdown(1); } - - // narrow the reference to the particular type we wish to deal with - Simple_var simple = Simple::_narrow(obj.in ()); - if (CORBA::is_nil(simple.in ())) + catch (const ::CORBA::Exception &ex) { - ACE_ERROR ((LM_ERROR, "could not get reference\n")); - return 1; + ex._tao_print_exception("Caught unexpected CORBA exception :"); } - - // create an object reference that has a bogus value for the first - // profile - obj = orb->resolve_initial_references("IORManipulation"); - TAO_IOP::TAO_IOR_Manipulation_var iorm = - TAO_IOP::TAO_IOR_Manipulation::_narrow(obj.in()); - - // Status: The following scenarios appear to work: - // - first profile invalid host name, second profile valid. - // - first profile invalid ip number, second profiel valid. - // - first profiel invalid port number, second profile valid. - // - // The following causes a core dump of the server: - // - first and second invalid - // - // Note that he iormanip is being used since it is not practical - // to have a test case that depends on a VPN being present. - // - CORBA::Object_var name1 = - orb->string_to_object ("corbaloc:iiop:10.0.2.3:6060/xyz"); - CORBA::Object_var name2 = - orb->string_to_object ("corbaloc:iiop:daisnot:7070/xyz"); - CORBA::String_var name1_ior = orb->object_to_string(name1.in()); - CORBA::String_var name2_ior = orb->object_to_string(name2.in()); - - // create a callback object - Callee_i * callee_i = new Callee_i; - // get the CORBA reference - PortableServer::ObjectId_var id = - poa->activate_object (callee_i); - - CORBA::Object_var object_act = poa->id_to_reference (id.in ()); - - Callee_var callee = Callee::_narrow (object_act.in ()); - - if (CORBA::is_nil(callee.in ())) - { - ACE_ERROR ((LM_ERROR, "could not get callback object\n")); - return 1; - } - else - { - CORBA::String_var str = orb->object_to_string(callee.in ()); - FILE *output_file= ACE_OS::fopen ("ior", "w"); - if (output_file == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Cannot open output file for writing IOR: ior\n"), - 1); - ACE_OS::fprintf (output_file, "%s", str.in ()); - ACE_OS::fclose (output_file); - } - - // create a reference with two profiles with the first on being - // bogus. If things work as they should the callback should be - // succesful with the ORB trying the second profile. - TAO_IOP::TAO_IOR_Manipulation::IORList iors (2); - iors.length (2); - iors [0] = name1; - iors [1] = name2; - - CORBA::Object_var merged = iorm->merge_iors(iors); - Callee_var doubleCallee = Callee::_unchecked_narrow(merged.in()); - - ACE_DEBUG ((LM_DEBUG, "Profile count is %d\n", - iorm->get_profile_count(merged.in()))); - - simple->registerCallee(doubleCallee.in ()); - - ACE_OS::sleep(120); - - ACE_DEBUG ((LM_DEBUG, "done slpeeing\n")); - - orb->shutdown(1); - return 0; } diff --git a/tests/Bug_2183_Regression/run_test.pl b/tests/Bug_2183_Regression/run_test.pl index 46af18e1354..a201bdb4861 100755 --- a/tests/Bug_2183_Regression/run_test.pl +++ b/tests/Bug_2183_Regression/run_test.pl @@ -15,9 +15,12 @@ my $client = PerlACE::TestTarget::create_target (2) || die "Create target 2 fail # The server IOR file $iorbase = "server.ior"; - -$server_conf = $server->LocalFile ("server.conf"); $server_ior_file = $server->LocalFile ($iorbase); + +# The server configuration file +$server_conf_file = "server.conf"; +$server_conf = $server->LocalFile ($server_conf_file); + $server->DeleteFile ($iorbase); # The client and server processes @@ -29,6 +32,13 @@ if ($^O == 'VMS') { $port = '15000'; +# copy the configuation file +if ($server->PutFile ($server_conf_file) == -1) { + print STDERR "ERROR: cannot set file <$server_conf>\n"; + $SV->Kill (); $SV->TimedWait (1); + return 1; +} + $SV = $server->CreateProcess ("server", "-o $server_ior_file " . "-ORBEndpoint iiop://:$port " . diff --git a/tests/Bug_2186_Regression/run_test.pl b/tests/Bug_2186_Regression/run_test.pl index 5b158671660..14e5a634f72 100755 --- a/tests/Bug_2186_Regression/run_test.pl +++ b/tests/Bug_2186_Regression/run_test.pl @@ -31,7 +31,16 @@ $client->DeleteFile($iorbase); my $client_iorbase_file = $client->LocalFile ($client_iorbase); $client->DeleteFile($client_iorbase); -my $server_conf = $server->LocalFile ("server.conf"); +my $server_conf_file = "server.conf"; +my $server_conf = $server->LocalFile ($server_conf_file); + + +# copy the configuation file +if ($server->PutFile ($server_conf_file) == -1) { + print STDERR "ERROR: cannot set file <$server_conf>\n"; + $SV->Kill (); $SV->TimedWait (1); + return 1; +} $SV = $server->CreateProcess ("server", "-ORBdebuglevel $debug_level " . diff --git a/tests/Bug_2241_Regression/Bug_2241_Regression.mpc b/tests/Bug_2241_Regression/Bug_2241_Regression.mpc new file mode 100644 index 00000000000..9a975cb5ea0 --- /dev/null +++ b/tests/Bug_2241_Regression/Bug_2241_Regression.mpc @@ -0,0 +1,6 @@ +// -*- MPC -*- +// $Id$ + +project(Bug_2241_Regression): taoserver { + exename = Bug_2241_Regression +} diff --git a/tests/Bug_2241_Regression/Client_Task.cpp b/tests/Bug_2241_Regression/Client_Task.cpp new file mode 100644 index 00000000000..e39e0d96191 --- /dev/null +++ b/tests/Bug_2241_Regression/Client_Task.cpp @@ -0,0 +1,53 @@ +// +// $Id$ +// + +#include "Client_Task.h" +#include "TestC.h" + +Client_Task::Client_Task (const ACE_TCHAR *ior, + CORBA::ORB_ptr corb, + ACE_Thread_Manager *thr_mgr) + : ACE_Task_Base (thr_mgr) + , input_ (ior) + , corb_ (CORBA::ORB::_duplicate (corb)) + +{ +} + +int +Client_Task::svc (void) +{ + try + { + CORBA::Object_var tmp = + this->corb_->string_to_object (input_); + + Test::Hello_var hello = + Test::Hello::_narrow(tmp.in ()); + + if (CORBA::is_nil (hello.in ())) + { + ACE_ERROR_RETURN ((LM_DEBUG, + "Nil Test::Hello reference <%s>\n", + input_), + 1); + } + + CORBA::String_var the_string = + hello->get_string (); + + ACE_DEBUG ((LM_DEBUG, "(%P|%t) - string returned <%C>\n", + the_string.in ())); + + hello->shutdown (); + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("Exception caught:"); + return 1; + } + + return 0; + +} diff --git a/tests/Bug_2241_Regression/Client_Task.h b/tests/Bug_2241_Regression/Client_Task.h new file mode 100644 index 00000000000..8f6557cdec8 --- /dev/null +++ b/tests/Bug_2241_Regression/Client_Task.h @@ -0,0 +1,37 @@ +// +// $Id$ +// + +#ifndef COLLOCATED_TEST_CLIENT_TASK_H +#define COLLOCATED_TEST_CLIENT_TASK_H +#include /**/ "ace/pre.h" +#include "ace/Task.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ +#include "tao/ORB.h" + + +/// Implement a Task to run the client as a thread +class Client_Task : public ACE_Task_Base +{ +public: + + /// Constructor + Client_Task (const ACE_TCHAR *input, + CORBA::ORB_ptr corb, + ACE_Thread_Manager *thr_mgr); + + /// Thread entry point + int svc (void); + +private: + const ACE_TCHAR *input_; + + CORBA::ORB_var corb_; + +}; + +#include /**/ "ace/post.h" +#endif /* COLLOCATED_TEST_CLIENT_TASK_H */ diff --git a/tests/Bug_2241_Regression/Collocated_Test.cpp b/tests/Bug_2241_Regression/Collocated_Test.cpp new file mode 100644 index 00000000000..282295ad5e3 --- /dev/null +++ b/tests/Bug_2241_Regression/Collocated_Test.cpp @@ -0,0 +1,106 @@ +//$Id$ +#include "Server_Task.h" +#include "Client_Task.h" +#include "ace/Get_Opt.h" +#include "ace/Argv_Type_Converter.h" +#include "ace/SString.h" +#include "ace/Manual_Event.h" + +const ACE_TCHAR *output = ACE_TEXT("test.ior"); +const ACE_TCHAR *input = ACE_TEXT("file://test.ior"); +// static int named_orbs = 0; +ACE_CString server_orb; +ACE_CString client_orb; +int +parse_args (int argc, ACE_TCHAR *argv[]) +{ + ACE_Get_Opt get_opts (argc, argv, ACE_TEXT("k:o:n")); + int c; + + while ((c = get_opts ()) != -1) + switch (c) + { + case 'o': + output = get_opts.opt_arg (); + break; + case 'k': + input = get_opts.opt_arg (); + break; + case 'n': + // named_orbs = 1; + server_orb.set ("server_orb"); + client_orb.set ("client_orb"); + break; + case '?': + default: + // This is a hack but that is okay! + return 0; + } + // Indicates successful parsing of the command line + return 0; +} + +int +ACE_TMAIN(int argc, ACE_TCHAR *argv[]) +{ + if (parse_args (argc, + argv) == -1) + return -1; + + try + { + ACE_Argv_Type_Converter satc (argc, argv); + CORBA::ORB_var sorb = + CORBA::ORB_init (satc.get_argc (), + satc.get_TCHAR_argv (), + server_orb.c_str ()); + + ACE_Manual_Event me; + Server_Task server_task (output, + sorb.in (), + me, + ACE_Thread_Manager::instance ()); + + if (server_task.activate (THR_NEW_LWP | THR_JOINABLE, + 1, + 1) == -1) + { + ACE_ERROR ((LM_ERROR, "Error activating server task\n")); + } + + // Wait for the server thread to do some processing + me.wait (); + + ACE_Argv_Type_Converter catc (argc, argv); + CORBA::ORB_var corb = + CORBA::ORB_init (catc.get_argc (), + catc.get_TCHAR_argv (), + client_orb.c_str ()); + + Client_Task client_task (input, + corb.in (), + ACE_Thread_Manager::instance ()); + + if (client_task.activate (THR_NEW_LWP | THR_JOINABLE, + 1, + 1) == -1) + { + ACE_ERROR ((LM_ERROR, "Error activating client task\n")); + } + + // Wait for the client and server to finish + ACE_Thread_Manager::instance ()->wait (); + + // Now that all threads have completed we can destroy the ORB + sorb->destroy (); + if (server_orb != client_orb) + { + corb->destroy (); + } + } + catch (const CORBA::Exception&) + { + // Ignore exceptions.. + } + return 0; +} diff --git a/tests/Bug_2241_Regression/Hello.cpp b/tests/Bug_2241_Regression/Hello.cpp new file mode 100644 index 00000000000..cabcd9145d9 --- /dev/null +++ b/tests/Bug_2241_Regression/Hello.cpp @@ -0,0 +1,67 @@ +// +// $Id$ +// +#include "Hello.h" +#include "tao/ORB_Core.h" +#include "tao/ORB_Table.h" +#include "tao/ORB_Core_Auto_Ptr.h" + + Hello::Hello (CORBA::ORB_ptr orb, + ACE_thread_t thrid) + : orb_ (CORBA::ORB::_duplicate (orb)) + , thr_id_ (thrid) +{ +} + +char * +Hello::get_string (void) +{ + ACE_DEBUG ((LM_DEBUG, + "(%P|%t) Upcall in process ..\n")); + + // Use portable thread IDs + ACE_Thread_ID self_ID; + ACE_Thread_ID this_ID; + this_ID.id(this->thr_id_); + + if (self_ID == this_ID) + { + if (this->orb_->orb_core ()->optimize_collocation_objects () && + this->orb_->orb_core ()->use_global_collocation ()) + { + ACE_ERROR ((LM_ERROR, + "(%P|%t) ERROR: A remote call has been made " + " exiting ..\n")); + ACE_OS::abort (); + } + else if (this->orb_->orb_core ()->optimize_collocation_objects () && + this->orb_->orb_core ()->use_global_collocation () == 0) + { + TAO::ORB_Table * const orb_table = + TAO::ORB_Table::instance (); + + TAO_ORB_Core_Auto_Ptr tmp (orb_table->find ("server_orb")); + if (tmp.get () == 0) + { + // We are running on a single ORB and this is an error. + ACE_ERROR ((LM_ERROR, + "(%P|%t) ERROR: A remote call has been made " + " with a single ORB " + " exiting ..\n")); + ACE_OS::abort (); + } + } + } + + return CORBA::string_dup ("Hello there!"); +} + +void +Hello::shutdown (void) +{ + // Give the client thread time to return from the collocated + // call to this method before shutting down the ORB. We sleep + // to avoid BAD_INV_ORDER exceptions on fast dual processor machines. + ACE_OS::sleep (1); + this->orb_->shutdown (0); +} diff --git a/tests/Bug_2241_Regression/Hello.h b/tests/Bug_2241_Regression/Hello.h new file mode 100644 index 00000000000..1d5e27d075f --- /dev/null +++ b/tests/Bug_2241_Regression/Hello.h @@ -0,0 +1,34 @@ +// +// $Id$ +// + +#ifndef HELLO_H +#define HELLO_H +#include /**/ "ace/pre.h" + +#include "TestS.h" + +/// Implement the Test::Hello interface +class Hello + : public virtual POA_Test::Hello +{ +public: + /// Constructor + Hello (CORBA::ORB_ptr orb, + ACE_thread_t thr_id); + + // = The skeleton methods + virtual char * get_string (void); + + virtual void shutdown (void); + +private: + /// Use an ORB reference to conver strings to objects and shutdown + /// the application. + CORBA::ORB_var orb_; + + ACE_thread_t thr_id_; +}; + +#include /**/ "ace/post.h" +#endif /* HELLO_H */ diff --git a/tests/Bug_2241_Regression/Server_Task.cpp b/tests/Bug_2241_Regression/Server_Task.cpp new file mode 100644 index 00000000000..98f37e052e3 --- /dev/null +++ b/tests/Bug_2241_Regression/Server_Task.cpp @@ -0,0 +1,87 @@ +// +// $Id$ +// +#include "Server_Task.h" +#include "TestS.h" +#include "Hello.h" + +#include "ace/Manual_Event.h" + +Server_Task::Server_Task (const ACE_TCHAR *output, + CORBA::ORB_ptr sorb, + ACE_Manual_Event &me, + ACE_Thread_Manager *thr_mgr) + : ACE_Task_Base (thr_mgr) + , output_ (output) + , me_ (me) + , sorb_ (CORBA::ORB::_duplicate (sorb)) +{ +} + +int +Server_Task::svc (void) +{ + try + { + CORBA::Object_var poa_object = + this->sorb_->resolve_initial_references("RootPOA"); + + PortableServer::POA_var root_poa = + PortableServer::POA::_narrow (poa_object.in ()); + + if (CORBA::is_nil (root_poa.in ())) + ACE_ERROR_RETURN ((LM_ERROR, + " (%P|%t) Panic: nil RootPOA\n"), + 1); + + PortableServer::POAManager_var poa_manager = + root_poa->the_POAManager (); + + Hello *hello_impl; + ACE_NEW_RETURN (hello_impl, + Hello (this->sorb_.in (), + ACE_Thread::self ()), + 1); + + PortableServer::ServantBase_var owner_transfer(hello_impl); + + PortableServer::ObjectId_var id = + root_poa->activate_object (hello_impl); + + CORBA::Object_var object = root_poa->id_to_reference (id.in ()); + + Test::Hello_var hello = + Test::Hello::_narrow (object.in ()); + + CORBA::String_var ior = + this->sorb_->object_to_string (hello.in ()); + + // Output the IOR to the <this->output_> + FILE *output_file= ACE_OS::fopen (this->output_, + "w"); + if (output_file == 0) + ACE_ERROR_RETURN ((LM_ERROR, + "Cannot open output file for writing IOR: %s", + this->output_), + 1); + + ACE_OS::fprintf (output_file, "%s", ior.in ()); + ACE_OS::fclose (output_file); + + poa_manager->activate (); + + // Signal the main thread before we call orb->run (); + this->me_.signal (); + + this->sorb_->run (); + + ACE_DEBUG ((LM_DEBUG, "(%P|%t) server - event loop finished\n")); + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("Exception caught:"); + return 1; + } + + return 0; +} diff --git a/tests/Bug_2241_Regression/Server_Task.h b/tests/Bug_2241_Regression/Server_Task.h new file mode 100644 index 00000000000..e42043c0711 --- /dev/null +++ b/tests/Bug_2241_Regression/Server_Task.h @@ -0,0 +1,48 @@ +// -*- C++ -*- +// +// $Id$ + +#ifndef COLLOCATED_SERVER_TASK_H +#define COLLOCATED_SERVER_TASK_H + +#include /**/ "ace/pre.h" + +#include "ace/Task.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/ORB.h" + +ACE_BEGIN_VERSIONED_NAMESPACE_DECL +class ACE_Manual_Event; +ACE_END_VERSIONED_NAMESPACE_DECL + +/// Implement a Task to run the server in a single thread +class Server_Task : public ACE_Task_Base +{ +public: + /// Constructor + Server_Task (const ACE_TCHAR *output, + CORBA::ORB_ptr sorb, + ACE_Manual_Event &me, + ACE_Thread_Manager *thr_mgr); + + /// Thread entry point + int svc (void); + +private: + /// Output file for IOR + const ACE_TCHAR *output_; + + /// Manual event to wake up the main thread to create a client + /// thread. + ACE_Manual_Event &me_; + + CORBA::ORB_var sorb_; +}; + +#include /**/ "ace/post.h" + +#endif /* COLLOCATED_SERVER_TASK_H */ diff --git a/tests/Bug_2241_Regression/Test.idl b/tests/Bug_2241_Regression/Test.idl new file mode 100644 index 00000000000..3c0976e106d --- /dev/null +++ b/tests/Bug_2241_Regression/Test.idl @@ -0,0 +1,20 @@ +// +// $Id$ +// + +/// Put the interfaces in a module, to avoid global namespace pollution +module Test +{ + /// A very simple interface + interface Hello + { + /// Return a simple string + string get_string (); + + /// A method to shutdown the ORB + /** + * This method is used to simplify the test shutdown process + */ + oneway void shutdown (); + }; +}; diff --git a/tests/Bug_2241_Regression/run_test.pl b/tests/Bug_2241_Regression/run_test.pl new file mode 100755 index 00000000000..e9c473e8341 --- /dev/null +++ b/tests/Bug_2241_Regression/run_test.pl @@ -0,0 +1,63 @@ +eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}' + & eval 'exec perl -S $0 $argv:q' + if 0; + +# $Id$ +# -*- perl -*- + +use lib "$ENV{ACE_ROOT}/bin"; +use PerlACE::TestTarget; + +my $server = PerlACE::TestTarget::create_target(1) || die "Create target 1 failed\n"; + +$iorbase = "test.ior"; +my $server_iorfile = $server->LocalFile ($iorbase); +$server->DeleteFile($iorbase); + +$status = 0; + +$SV = $server->CreateProcess ("Bug_2241_Regression"); + +print STDERR "======== Running in Default Mode \n"; +$SV->Arguments ("-o $server_iorfile -k file://$server_iorfile"); +$sv = $SV->SpawnWaitKill ($server->ProcessStartWaitInterval()); + +if ($sv != 0) { + print STDERR "ERROR in Collocated_Test\n"; + $status = 1; +} +$server->DeleteFile($iorbase); + +print STDERR "======== Running with global ORBCollocationStrategy\n"; +$SV->Arguments ("-o $server_iorfile -k file://$server_iorfile -ORBCollocation global"); +$sv = $SV->SpawnWaitKill ($server->ProcessStartWaitInterval()); + +if ($sv != 0) { + print STDERR "ERROR in Collocated_Test\n"; + $status = 1; +} +$server->DeleteFile($iorbase); + +print STDERR "======== Running with global ORBCollocationStrategy thru_poa\n"; +$SV->Arguments ("-o $server_iorfile -k file://$server_iorfile -ORBCollocation global -ORBCollocationStrategy thru_poa"); +$sv = $SV->SpawnWaitKill ($server->ProcessStartWaitInterval()); + +if ($sv != 0) { + print STDERR "ERROR in Collocated_Test\n"; + $status = 1; +} +$server->DeleteFile($iorbase); + +print STDERR "======== Running with -ORBCollocation global -ORBCollocationStrategy direct \n"; +$SV->Arguments ("-o $server_iorfile -k file://$server_iorfile -ORBCollocation global -ORBCollocationStrategy direct"); +$sv = $SV->SpawnWaitKill ($server->ProcessStartWaitInterval()); + +if ($sv != 0) { + print STDERR "ERROR in Collocated_Test\n"; + $status = 1; +} + +$server->DeleteFile($iorbase); +$server->GetStderrLog(); + +exit $status; diff --git a/tests/Bug_2935_Regression/run_test.pl b/tests/Bug_2935_Regression/run_test.pl index 64a4acd9aa6..d74177e77a7 100755 --- a/tests/Bug_2935_Regression/run_test.pl +++ b/tests/Bug_2935_Regression/run_test.pl @@ -49,8 +49,19 @@ $middle->DeleteFile ($middlelogfilebase); $source->DeleteFile ($sourcelogfilebase); +my $middleconffilebase = "middle.conf"; +my $middleconffile = $middle->LocalFile ($middleconffilebase); + +# copy the configuation file +if ($middle->PutFile ($middleconffilebase) == -1) { + print STDERR "ERROR: cannot set file <$middleconffile>\n"; + $SV->Kill (); $SV->TimedWait (1); + return 1; +} + + $SV = $sink->CreateProcess ("sink", "-o $sinkiorfile -orblogfile $sinklogfile -orbdebuglevel 9"); -$MD = $middle->CreateProcess ("middle", "-o $middleiorfile -f $sinkiorfile -ORBSvcConf middle.conf -orblogfile $middlelogfile -orbdebuglevel 9"); +$MD = $middle->CreateProcess ("middle", "-o $middleiorfile -f $sinkiorfile -ORBSvcConf $middleconffile -orblogfile $middlelogfile -orbdebuglevel 9"); $CL = $source->CreateProcess ("source", "-f $middleiorfile -orblogfile $sourcelogfile -orbdebuglevel 9"); $SV->Spawn (); diff --git a/tests/Bug_3068_Regression/run_test.pl b/tests/Bug_3068_Regression/run_test.pl index 74ef14252e6..456f2895ad2 100755 --- a/tests/Bug_3068_Regression/run_test.pl +++ b/tests/Bug_3068_Regression/run_test.pl @@ -26,8 +26,21 @@ my $client_iorfile = $client->LocalFile ($iorbase); $server->DeleteFile($iorbase); $client->DeleteFile($iorbase); -my $server_conf = $server->LocalFile ("server.conf"); -my $client_conf = $client->LocalFile ("client.conf"); +my $server_conf_base = "server.conf"; +my $client_conf_base = "client.conf"; +my $server_conf = $server->LocalFile ($server_conf_base); +my $client_conf = $client->LocalFile ($client_conf_base); + +if ($server->PutFile ($server_conf_base) == -1) { + print STDERR "ERROR: cannot set file <$server_conf>\n"; + $SV->Kill (); $SV->TimedWait (1); + exit 1; +} +if ($client->PutFile ($client_conf_base) == -1) { + print STDERR "ERROR: cannot set file <$client_conf>\n"; + $SV->Kill (); $SV->TimedWait (1); + exit 1; +} $SV = $server->CreateProcess ("server", "-ORBdebuglevel $debug_level " . diff --git a/tests/Bug_3163_Regression/run_test.pl b/tests/Bug_3163_Regression/run_test.pl index 57a4cf1d82a..fa73fd42065 100755 --- a/tests/Bug_3163_Regression/run_test.pl +++ b/tests/Bug_3163_Regression/run_test.pl @@ -21,13 +21,22 @@ my $server = PerlACE::TestTarget::create_target (1) || die "Create target 1 fail my $client = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n"; my $iorbase = "server.ior"; -my $svcconf = "server.conf"; my $server_iorfile = $server->LocalFile ($iorbase); + +my $svcconf = "server.conf"; my $server_svcconf = $server->LocalFile ($svcconf); + my $client_iorfile = $client->LocalFile ($iorbase); + $server->DeleteFile($iorbase); $client->DeleteFile($iorbase); +if ($server->PutFile ($svcconf) == -1) { + print STDERR "ERROR: cannot set file <$server_svcconf>\n"; + exit 1; +} + + $SV = $server->CreateProcess ("server", "-ORBdebuglevel $debug_level -o $server_iorfile -ORBStdProfileComponents 0 -ORBSvcConf $server_svcconf"); $CL = $client->CreateProcess ("client", "-v 131401 -k file://$client_iorfile"); $server_status = $SV->Spawn (); diff --git a/tests/Bug_3506_Regression/client.cpp b/tests/Bug_3506_Regression/client.cpp index 34f24b89e24..fdf9f73ddf7 100644 --- a/tests/Bug_3506_Regression/client.cpp +++ b/tests/Bug_3506_Regression/client.cpp @@ -119,12 +119,20 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) { int retval = 0; - m_ORB_p = CORBA::ORB_init (argc, argv); - IF_Test_client testclient; + try + { + m_ORB_p = CORBA::ORB_init (argc, argv); + IF_Test_client testclient; - for (int i = 0; i < 10; i++) + for (int i = 0; i < 10; i++) + { + retval += testclient.foo (argc, argv, i == 9); + } + } + catch (const ::CORBA::Exception &ex) { - retval += testclient.foo (argc, argv, i == 9); + ex._tao_print_exception("ERROR : unexpected CORBA exception caugth :"); + ++retval; } return retval; } diff --git a/tests/Bug_3548_Regression/client.cpp b/tests/Bug_3548_Regression/client.cpp index 7a98848dfb4..55e78601833 100644 --- a/tests/Bug_3548_Regression/client.cpp +++ b/tests/Bug_3548_Regression/client.cpp @@ -6,37 +6,45 @@ //--------------------------------------------------------------------------- -MEMEATER::StringSeq* message_buffer = 0; +MEMEATER::StringSeq* _message_buffer = 0; #define MAX_MSG_BUF 100 void eat_my_memory() { const char * output_string = "Eat my Memory! Eat my Memory! Eat my Memory! Eat my Memory!"; - CORBA::ULong msg_count = message_buffer->length(); + CORBA::ULong msg_count = _message_buffer->length(); if (msg_count < MAX_MSG_BUF) { - message_buffer->length(msg_count+1); - (*message_buffer)[msg_count] = CORBA::string_dup( output_string); + _message_buffer->length(msg_count+1); + (*_message_buffer)[msg_count] = CORBA::string_dup( output_string); } else { - message_buffer->length(1); - (*message_buffer)[0] = CORBA::string_dup( output_string ); + _message_buffer->length(1); + (*_message_buffer)[0] = CORBA::string_dup( output_string ); } } int ACE_TMAIN(int, ACE_TCHAR*[]) { - message_buffer = new MEMEATER::StringSeq; - message_buffer->length(0); + _message_buffer = new MEMEATER::StringSeq; + _message_buffer->length(0); - for (int i = 0; i < 1000; i++) + try { - eat_my_memory(); + for (int i = 0; i < 1000; i++) + { + eat_my_memory(); + } + } + catch (const ::CORBA::Exception &ex) + { + ex._tao_print_exception("ERROR : unexpected CORBA exception caugth :"); + return 1; } - delete message_buffer; + delete _message_buffer; return 0; } diff --git a/tests/Bug_3630_Regression/run_test.pl b/tests/Bug_3630_Regression/run_test.pl index 55adb524064..2b5d3559de4 100755 --- a/tests/Bug_3630_Regression/run_test.pl +++ b/tests/Bug_3630_Regression/run_test.pl @@ -10,6 +10,15 @@ use PerlACE::TestTarget; my $server = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n"; +my $srvconf = "TAO Conf File.conf"; +my $server_svcconf = $server->LocalFile ($svcconf); + +if ($server->PutFile ($svcconf) == -1) { + print STDERR "ERROR: cannot set file <$server_svcconf>\n"; + exit 1; +} + + $SV = $server->CreateProcess ("server"); $server_status = $SV->Spawn (); diff --git a/tests/Bug_3630_Regression/server.cpp b/tests/Bug_3630_Regression/server.cpp index 55ff6e69e3d..99119586e4a 100644 --- a/tests/Bug_3630_Regression/server.cpp +++ b/tests/Bug_3630_Regression/server.cpp @@ -94,7 +94,7 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) if (result == 0) ACE_DEBUG ((LM_DEBUG, - ACE_TEXT ("Test passed!"))); + ACE_TEXT ("Test passed!\n"))); else ACE_ERROR ((LM_ERROR, ACE_TEXT ("Test failed. Result: %d\n"), diff --git a/tests/Bug_3683_Regression/Echo_i.h b/tests/Bug_3683_Regression/Echo_i.h index 5afd29de0b1..f626d509794 100644 --- a/tests/Bug_3683_Regression/Echo_i.h +++ b/tests/Bug_3683_Regression/Echo_i.h @@ -55,8 +55,7 @@ private: /// ORB pointer. CORBA::ORB_var orb_; - /// Keeping g++ 2.7.2 happy.. - ACE_UNIMPLEMENTED_FUNC (void operator= (const Echo_i&)) + void operator= (const Echo_i&); }; #endif /* ECHO_I_H */ diff --git a/tests/Bug_3683_Regression/run_test.pl b/tests/Bug_3683_Regression/run_test.pl index 6b1960d9b26..5605748ea5d 100755 --- a/tests/Bug_3683_Regression/run_test.pl +++ b/tests/Bug_3683_Regression/run_test.pl @@ -26,8 +26,16 @@ my $client_iorfile = $client->LocalFile ($iorbase); $server->DeleteFile($iorbase); $client->DeleteFile($iorbase); +my $clientconf = "svc.conf"; +my $clientconffile = $client->LocalFile ($clientconf); + +if ($client->PutFile ($clientconf) == -1) { + print STDERR "ERROR: cannot set file <$clientconffile>\n"; + exit 1; +} + $SV = $server->CreateProcess ("server", "-ORBdebuglevel $debug_level -o $server_iorfile"); -$CL = $client->CreateProcess ("client", "-f $client_iorfile -x -ORBSvcConf svc.conf -p 16"); +$CL = $client->CreateProcess ("client", "-f $client_iorfile -x -ORBSvcConf $clientconffile -p 16"); $server_status = $SV->Spawn (); if ($server_status != 0) { diff --git a/tests/CDR/allocator.cpp b/tests/CDR/allocator.cpp index 59feefc454c..87320568722 100644 --- a/tests/CDR/allocator.cpp +++ b/tests/CDR/allocator.cpp @@ -67,133 +67,142 @@ private: int ACE_TMAIN(int argc, ACE_TCHAR *argv[]) { - CORBA::ORB_var orb = - CORBA::ORB_init (argc, argv); - - int tss = 0; - int iterations = 500; - int repeat = 100; - int max_fragments = 2048; - int max_fragment_size = 1024; - int max_arguments = 16; - int max_argument_size = 1024; - int quiet = 0; - unsigned int seed = static_cast<unsigned int> (ACE_OS::time(0)); - - ACE_Get_Opt get_opt (argc, argv, ACE_TEXT("tn:f:m:s:a:b:r:q")); - int opt; - - while ((opt = get_opt ()) != EOF) + try { - switch (opt) + CORBA::ORB_var orb = + CORBA::ORB_init (argc, argv); + + int tss = 0; + int iterations = 500; + int repeat = 100; + int max_fragments = 2048; + int max_fragment_size = 1024; + int max_arguments = 16; + int max_argument_size = 1024; + int quiet = 0; + unsigned int seed = static_cast<unsigned int> (ACE_OS::time(0)); + + ACE_Get_Opt get_opt (argc, argv, ACE_TEXT("tn:f:m:s:a:b:r:q")); + int opt; + + while ((opt = get_opt ()) != EOF) { - case 't': - tss = 1; - break; - case 'n': - iterations = ACE_OS::atoi (get_opt.opt_arg ()); - break; - case 'r': - repeat = ACE_OS::atoi (get_opt.opt_arg ()); - break; - case 'f': - max_fragments = ACE_OS::atoi (get_opt.opt_arg ()); - break; - case 'm': - max_fragment_size = ACE_OS::atoi (get_opt.opt_arg ()); - break; - case 's': - seed = ACE_OS::atoi (get_opt.opt_arg ()); - break; - case 'a': - max_arguments = ACE_OS::atoi (get_opt.opt_arg ()); - break; - case 'b': - max_argument_size = ACE_OS::atoi (get_opt.opt_arg ()); - break; - case 'q': - quiet = 1; - break; - case '?': - default: - ACE_DEBUG ((LM_DEBUG, - "Usage: %s " - "-n iterations " - "-n repeat " - "-f max_fragments " - "-m max_fragment_size " - "-s seed " - "-a max_arguments " - "-b max_argument_size " - "\n", - argv[0])); - return -1; + switch (opt) + { + case 't': + tss = 1; + break; + case 'n': + iterations = ACE_OS::atoi (get_opt.opt_arg ()); + break; + case 'r': + repeat = ACE_OS::atoi (get_opt.opt_arg ()); + break; + case 'f': + max_fragments = ACE_OS::atoi (get_opt.opt_arg ()); + break; + case 'm': + max_fragment_size = ACE_OS::atoi (get_opt.opt_arg ()); + break; + case 's': + seed = ACE_OS::atoi (get_opt.opt_arg ()); + break; + case 'a': + max_arguments = ACE_OS::atoi (get_opt.opt_arg ()); + break; + case 'b': + max_argument_size = ACE_OS::atoi (get_opt.opt_arg ()); + break; + case 'q': + quiet = 1; + break; + case '?': + default: + ACE_DEBUG ((LM_DEBUG, + "Usage: %s " + "-n iterations " + "-n repeat " + "-f max_fragments " + "-m max_fragment_size " + "-s seed " + "-a max_arguments " + "-b max_argument_size " + "\n", + argv[0])); + return -1; + } } - } - ACE_DEBUG ((LM_DEBUG, "SEED = %d\n", seed)); + ACE_DEBUG ((LM_DEBUG, "SEED = %d\n", seed)); - ACE_Allocator* buffer_allocator = - ACE_Allocator::instance (); - ACE_Allocator* dblock_allocator = - ACE_Allocator::instance (); - if (tss) - { - buffer_allocator = - TAO_ORB_Core_instance ()->output_cdr_buffer_allocator (); - dblock_allocator = - TAO_ORB_Core_instance ()->output_cdr_dblock_allocator (); - } - - Application_Simulator simulator (max_fragments, - max_fragment_size); - char* argument_buffer; - ACE_NEW_RETURN (argument_buffer, char[max_argument_size], 1); + ACE_Allocator* buffer_allocator = + ACE_Allocator::instance (); + ACE_Allocator* dblock_allocator = + ACE_Allocator::instance (); + if (tss) + { + buffer_allocator = + TAO_ORB_Core_instance ()->output_cdr_buffer_allocator (); + dblock_allocator = + TAO_ORB_Core_instance ()->output_cdr_dblock_allocator (); + } - int* argument_sizes; - ACE_NEW_RETURN (argument_sizes, int[max_arguments], 1); + Application_Simulator simulator (max_fragments, + max_fragment_size); + char* argument_buffer; + ACE_NEW_RETURN (argument_buffer, char[max_argument_size], 1); - int n = ACE_OS::rand_r (&seed) % max_arguments + 1; - for (int k = 0; k < n; ++k) - argument_sizes[k] = ACE_OS::rand_r (&seed) % max_argument_size + 1; + int* argument_sizes; + ACE_NEW_RETURN (argument_sizes, int[max_arguments], 1); - for (int i = 0; i < iterations; ++i) - { - simulator.upcall (&seed); + int n = ACE_OS::rand_r (&seed) % max_arguments + 1; + for (int k = 0; k < n; ++k) + argument_sizes[k] = ACE_OS::rand_r (&seed) % max_argument_size + 1; - // @@ TODO this is the place to put the other allocators. - ACE_High_Res_Timer cdr_encoding; - for (int j = 0; j < repeat; ++j) + for (int i = 0; i < iterations; ++i) { - cdr_encoding.start_incr (); + simulator.upcall (&seed); - char buffer[DEFAULT_BUFFER_SIZE]; - ACE_OutputCDR cdr (buffer, sizeof(buffer), - TAO_ENCAP_BYTE_ORDER, - buffer_allocator, - dblock_allocator); - - for (int k = 0; k < n; ++k) + // @@ TODO this is the place to put the other allocators. + ACE_High_Res_Timer cdr_encoding; + for (int j = 0; j < repeat; ++j) { - cdr.write_char_array (argument_buffer, - argument_sizes[k]); + cdr_encoding.start_incr (); + + char buffer[DEFAULT_BUFFER_SIZE]; + ACE_OutputCDR cdr (buffer, sizeof(buffer), + TAO_ENCAP_BYTE_ORDER, + buffer_allocator, + dblock_allocator); + + for (int k = 0; k < n; ++k) + { + cdr.write_char_array (argument_buffer, + argument_sizes[k]); + } + + cdr_encoding.stop_incr (); } - cdr_encoding.stop_incr (); - } + ACE_Time_Value tv; + cdr_encoding.elapsed_time_incr (tv); + ACE_hrtime_t usecs = tv.sec (); + usecs *= static_cast<ACE_UINT32> (ACE_ONE_SECOND_IN_USECS); + usecs += tv.usec (); + double average = + static_cast<double> (ACE_HRTIME_CONVERSION(usecs)) / repeat; - ACE_Time_Value tv; - cdr_encoding.elapsed_time_incr (tv); - ACE_hrtime_t usecs = tv.sec (); - usecs *= static_cast<ACE_UINT32> (ACE_ONE_SECOND_IN_USECS); - usecs += tv.usec (); - double average = - static_cast<double> (ACE_HRTIME_CONVERSION(usecs)) / repeat; + if (!quiet) + ACE_OS::printf ("AVE: %d %f\n", + i, average); - if (!quiet) - ACE_OS::printf ("AVE: %d %f\n", - i, average); + } + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("Caught unexpected CORBA exception:"); + return 1; } return 0; } diff --git a/tests/CSD_Collocation/run_test.pl b/tests/CSD_Collocation/run_test.pl index d8a46d5d5af..ee93aa41e11 100755 --- a/tests/CSD_Collocation/run_test.pl +++ b/tests/CSD_Collocation/run_test.pl @@ -9,8 +9,14 @@ use lib "$ENV{ACE_ROOT}/bin"; use PerlACE::TestTarget; my $server = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n"; + my $svcconf = "svc.conf.csd"; my $server_svcconf = $server->LocalFile ($svcconf); +if ($server->PutFile ($svcconf) == -1) { + print STDERR "ERROR: cannot set file <$server_svcconf>\n"; + exit 1; +} + $SV = $server->CreateProcess ("Collocation", "-ORBSvcConf $server_svcconf"); diff --git a/tests/Connect_Strategy_Test/run_test.pl b/tests/Connect_Strategy_Test/run_test.pl index 01ee992887d..ae333b28998 100755 --- a/tests/Connect_Strategy_Test/run_test.pl +++ b/tests/Connect_Strategy_Test/run_test.pl @@ -21,15 +21,25 @@ my $server = PerlACE::TestTarget::create_target (1) || die "Create target 1 fail my $client = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n"; my $iorbase = "server.ior"; -my $reactor_conf = "reactor$PerlACE::svcconf_ext"; -my $blocked_conf = "blocked$PerlACE::svcconf_ext"; my $server_iorfile = $server->LocalFile ($iorbase); my $client_iorfile = $client->LocalFile ($iorbase); -my $client_reactor_conf = $client->LocalFile ($reactor_conf); -my $client_blocked_conf = $client->LocalFile ($blocked_conf); $server->DeleteFile($iorbase); $client->DeleteFile($iorbase); +my $reactor_conf = "reactor$PerlACE::svcconf_ext"; +my $client_reactor_conf = $client->LocalFile ($reactor_conf); +if ($client->PutFile ($reactor_conf) == -1) { + print STDERR "ERROR: cannot set file <$client_reactor_conf>\n"; + exit 1; +} + +my $blocked_conf = "blocked$PerlACE::svcconf_ext"; +my $client_blocked_conf = $client->LocalFile ($blocked_conf); +if ($client->PutFile ($blocked_conf) == -1) { + print STDERR "ERROR: cannot set file <$client_blocked_conf>\n"; + exit 1; +} + $SV = $server->CreateProcess ("server", "-ORBdebuglevel $debug_level -o $server_iorfile"); $CL = $client->CreateProcess ("client", "-k file://$client_iorfile"); $server_status = $SV->Spawn (); diff --git a/tests/Connection_Failure/client.cpp b/tests/Connection_Failure/client.cpp index 0f33ce2fa4e..3f7bb372923 100644 --- a/tests/Connection_Failure/client.cpp +++ b/tests/Connection_Failure/client.cpp @@ -29,7 +29,10 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) "_narrow() to non-existent object failed correctly. Test succeeded.\n")); return 0; } - + catch (const ::CORBA::Exception &ex) + { + ex._tao_print_exception("ERROR : unexpected CORBA exception caugth :"); + } // Should not reach here. ACE_ERROR_RETURN ((LM_ERROR, "_narrow() succeeded to non-existent object when it should not have...\n"), diff --git a/tests/Connection_Purging/run_test.pl b/tests/Connection_Purging/run_test.pl index 7355ed2174a..610f042cbd9 100755 --- a/tests/Connection_Purging/run_test.pl +++ b/tests/Connection_Purging/run_test.pl @@ -70,7 +70,12 @@ for($i = 0; $i < $server_count; $i++) { $servers_endpoint[$i] = "-ORBEndpoint uiop://$servers_socket[$i]"; } elsif ($use_shmiop) { - $server_shmiop_conf = $servers[$i]->LocalFile ("server_shmiop$PerlACE::svcconf_ext"); + $server_conf_base = "server_shmiop$PerlACE::svcconf_ext"; + $server_shmiop_conf = $servers[$i]->LocalFile ($server_shmiop_conf); + if ($servers[$i]->PutFile ($server_conf_base) == -1) { + print STDERR "ERROR: cannot set file <$server_shmiop_conf>\n"; + exit 1; + } $servers_endpoint[$i] = "-ORBEndpoint shmiop:// -ORBSvcConf $server_shmiop_conf"; } else { @@ -114,9 +119,13 @@ for($i = 0; $i < $clients_count; $i++) { if ($debug_level < 1) { $debug_level = 1; #min value for debug level is one } + $client_conf_file = $clients[$i]->LocalFile ($clients_conf[$i]); + if ($clients[$i]->PutFile ($clients_conf[$i]) == -1) { + print STDERR "ERROR: cannot set file <$client_conf_file>\n"; + } $CLS[$i] = $clients[$i]->CreateProcess ("client", "-ORBDebugLevel $debug_level ". "-k $clients_iorfile[$i] ". - "-ORBSvcConf $clients_conf[$i]"); + "-ORBSvcConf $client_conf_file"); my $client_status = $CLS[$i]->SpawnWaitKill ($clients[$i]->ProcessStartWaitInterval() + 75); diff --git a/tests/DII_AMI_Forward/client.cpp b/tests/DII_AMI_Forward/client.cpp index 93db338da7d..a299e0124c0 100644 --- a/tests/DII_AMI_Forward/client.cpp +++ b/tests/DII_AMI_Forward/client.cpp @@ -102,37 +102,46 @@ int do_shutdown_test (CORBA::Object_var &server) int ACE_TMAIN(int argc, ACE_TCHAR *argv[]) { - CORBA::ORB_var orb = CORBA::ORB_init (argc, argv); - if (parse_args (argc, argv) != 0) - return 1; int result = 0; + try + { + CORBA::ORB_var orb = CORBA::ORB_init (argc, argv); - ACE_DEBUG ((LM_DEBUG,"Client using ior source %s\n", ior)); - CORBA::Object_var server = orb->string_to_object (ior); + if (parse_args (argc, argv) != 0) + return 1; - CORBA::Object_var obj = orb->resolve_initial_references ("RootPOA"); - PortableServer::POA_var root = - PortableServer::POA::_narrow (obj.in()); + ACE_DEBUG ((LM_DEBUG,"Client using ior source %s\n", ior)); + CORBA::Object_var server = orb->string_to_object (ior); - PortableServer::POAManager_var pm = root->the_POAManager(); - pm->activate(); - bool got_reply = false; - Messaging::ReplyHandler_var callback = new DII_ReplyHandler(got_reply); + CORBA::Object_var obj = orb->resolve_initial_references ("RootPOA"); + PortableServer::POA_var root = + PortableServer::POA::_narrow (obj.in()); - do_primary_test (server,callback); + PortableServer::POAManager_var pm = root->the_POAManager(); + pm->activate(); + bool got_reply = false; + Messaging::ReplyHandler_var callback = new DII_ReplyHandler(got_reply); - for (int i = 0; i < 100 && !got_reply; i++) - { - ACE_Time_Value t(0,10000); - orb->perform_work(t); - } + do_primary_test (server,callback); + + for (int i = 0; i < 100 && !got_reply; i++) + { + ACE_Time_Value t(0,10000); + orb->perform_work(t); + } - if (do_shutdown) - result = do_shutdown_test (server); + if (do_shutdown) + result = do_shutdown_test (server); - ACE_DEBUG ((LM_DEBUG,"Shutting down and destrying ORB.\n")); - orb->destroy(); - ACE_DEBUG ((LM_DEBUG,"ORB destroyed\n")); + ACE_DEBUG ((LM_DEBUG,"Shutting down and destrying ORB.\n")); + orb->destroy(); + ACE_DEBUG ((LM_DEBUG,"ORB destroyed\n")); + } + catch (const ::CORBA::Exception &ex) + { + ex._tao_print_exception("ERROR : unexpected CORBA exception caugth :"); + ++result; + } return result; } diff --git a/tests/DynAny_Test/driver.cpp b/tests/DynAny_Test/driver.cpp index 40de75a5f49..e143ff00d6b 100644 --- a/tests/DynAny_Test/driver.cpp +++ b/tests/DynAny_Test/driver.cpp @@ -27,23 +27,33 @@ int ACE_TMAIN (int argc, ACE_TCHAR *argv[]) { - Driver driver; + int error_count = 0; + try + { + Driver driver; - // initialize the driver - if (driver.init (argc, argv) == -1) - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) driver.cpp - " - "Driver initialization failed\n"), - -1); + // initialize the driver + if (driver.init (argc, argv) == -1) + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) driver.cpp - " + "Driver initialization failed\n"), + -1); - // run the tests - int error_count = driver.run (); - if (error_count != 0) + // run the tests + error_count = driver.run (); + if (error_count != 0) + { + ACE_ERROR ((LM_ERROR, + "(%N:%l) driver.cpp - " + "%d tests failed\n", + error_count)); + } + } + catch (const CORBA::Exception& ex) { - ACE_ERROR ((LM_ERROR, - "(%N:%l) driver.cpp - " - "%d tests failed\n", - error_count)); + ex._tao_print_exception ("Caught unexpected CORBA exception:"); + + ++error_count; } return error_count; diff --git a/tests/Faults/run_test.pl b/tests/Faults/run_test.pl index 393567ec1a6..d90e6dfd7e9 100755 --- a/tests/Faults/run_test.pl +++ b/tests/Faults/run_test.pl @@ -23,9 +23,7 @@ my $middle = PerlACE::TestTarget::create_target (3) || die "Create target 3 fail my $iorbase = "server.ior"; my $midiorbase = "middle.ior"; -my $svcconf = "server$PerlACE::svcconf_ext"; my $server_iorfile = $server->LocalFile ($iorbase); -my $server_svcfile = $server->LocalFile ($svcconf); my $client_iorfile = $client->LocalFile ($iorbase); my $client_midiorfile = $client->LocalFile ($midiorbase); my $middle_iorfile = $middle->LocalFile ($iorbase); @@ -36,6 +34,14 @@ $client->DeleteFile($midiorbase); $middle->DeleteFile($iorbase); $middle->DeleteFile($midiorbase); +my $svcconf = "server$PerlACE::svcconf_ext"; +my $server_svcfile = $server->LocalFile ($svcconf); +if ($server->PutFile ($svcconf) == -1) { + print STDERR "ERROR: cannot set file <$server_svcfile>\n"; + exit 1; +} + + ############################################################################### print STDERR "################ Default ORB Config###############\n"; print STDERR "===== Base test, no crashes\n"; diff --git a/tests/Faults/run_test_pp.pl b/tests/Faults/run_test_pp.pl index 38a0f51a5b7..5e348fd00b7 100755 --- a/tests/Faults/run_test_pp.pl +++ b/tests/Faults/run_test_pp.pl @@ -21,13 +21,20 @@ my $server = PerlACE::TestTarget::create_target (1) || die "Create target 1 fail my $client = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n"; my $iorbase = "server.ior"; -my $svcconf = "server$PerlACE::svcconf_ext"; my $server_iorfile = $server->LocalFile ($iorbase); -my $server_svcfile = $server->LocalFile ($svcconf); my $client_iorfile = $client->LocalFile ($iorbase); $server->DeleteFile($iorbase); $client->DeleteFile($iorbase); +my $svcconf = "server$PerlACE::svcconf_ext"; +my $server_svcfile = $server->LocalFile ($svcconf); +if ($server->PutFile ($svcconf) == -1) { + print STDERR "ERROR: cannot set file <$server_svcfile>\n"; + exit 1; +} + + + $SV = $server->CreateProcess ("ping", "-ORBdebuglevel $debug_level -o $server_iorfile"); $CL = $client->CreateProcess ("pong", diff --git a/tests/HandleExhaustion/run_test.pl b/tests/HandleExhaustion/run_test.pl index b63d8cb3c3c..3d2dc31b097 100755 --- a/tests/HandleExhaustion/run_test.pl +++ b/tests/HandleExhaustion/run_test.pl @@ -62,6 +62,11 @@ if ($server_status != 0) { $status = 1; } +if ($server->GetFile ($logbase) == -1) { + print STDERR "ERROR: cannot retrieve file <$server_logfile>\n"; + exit 1; +} + if ($status == 0) { if (open(FH, $server_logfile)) { my $error_achieved = 0; diff --git a/tests/Hang_Shutdown/run_test.pl b/tests/Hang_Shutdown/run_test.pl index 30053fac738..fc72acb06b6 100755 --- a/tests/Hang_Shutdown/run_test.pl +++ b/tests/Hang_Shutdown/run_test.pl @@ -50,8 +50,16 @@ $client->DeleteFile($iorbase); ################################ print STDERR "===== Client with RW handler\n"; +my $svcconf = "client.conf"; +my $client_svcfile = $client->LocalFile ($svcconf); + +if ($client->PutFile ($svcconf) == -1) { + print STDERR "ERROR: cannot set file <$client_svcfile>\n"; + exit 1; +} + $SV2 = $server->CreateProcess ("server"); -$CL2 = $client->CreateProcess ("client", " -ORBSvcConf client.conf"); +$CL2 = $client->CreateProcess ("client", " -ORBSvcConf $client_svcfile"); $SV2->Spawn (); diff --git a/tests/IDL_Test/typedef.idl b/tests/IDL_Test/typedef.idl index 5385c5ef936..ee2493ce3e8 100644 --- a/tests/IDL_Test/typedef.idl +++ b/tests/IDL_Test/typedef.idl @@ -44,7 +44,7 @@ typedef TAO_V5 TAO_Z5[5]; // typedef has a unique #ifndef guard. module TestModule { - typedef string<32> typedef_1; + typedef string<32> typedef_1; typedef string<32> typedef_2; interface TestInterface @@ -120,3 +120,5 @@ module CommaList + + diff --git a/tests/Leader_Followers/run_test.pl b/tests/Leader_Followers/run_test.pl index 8935ffa36c4..ba7cf1d9d8e 100755 --- a/tests/Leader_Followers/run_test.pl +++ b/tests/Leader_Followers/run_test.pl @@ -24,11 +24,15 @@ my $iorbase = "lf.ior"; my $tp_conf_base = "tp$PerlACE::svcconf_ext"; my $select_mt_conf_base = "select_mt$PerlACE::svcconf_ext"; +# init server configuration files my $server_tp_conf_file = $server->LocalFile ($tp_conf_base); my $server_select_mt_conf_file = $server->LocalFile ($select_mt_conf_base); + +# init client configuration files my $client_tp_conf_file = $client->LocalFile ($tp_conf_base); my $client_select_mt_conf_file = $client->LocalFile ($select_mt_conf_base); +# init ior files my $server_iorfile = $server->LocalFile ($iorbase); my $client_iorfile = $client->LocalFile ($iorbase); $server->DeleteFile($iorbase); @@ -177,6 +181,29 @@ for ($i = 0; $i <= $#ARGV; $i++) { } } +# Copy configuration files to the targets +if ($server->PutFile ($tp_conf_base) == -1) { + print STDERR "ERROR: cannot set file <$server_tp_conf_file>\n"; + $SV->Kill (); $SV->TimedWait (1); + return 1; +} +if ($server->PutFile ($select_mt_conf_base) == -1) { + print STDERR "ERROR: cannot set file <$server_select_mt_conf_file>\n"; + $SV->Kill (); $SV->TimedWait (1); + return 1; +} + +if ($client->PutFile ($tp_conf_base) == -1) { + print STDERR "ERROR: cannot set file <$client_tp_conf_file>\n"; + $SV->Kill (); $SV->TimedWait (1); + return 1; +} +if ($client->PutFile ($select_mt_conf_base) == -1) { + print STDERR "ERROR: cannot set file <$client_select_mt_conf_file>\n"; + $SV->Kill (); $SV->TimedWait (1); + return 1; +} + if ($single == 1) { print STDERR "\n\n*** Single threaded server ***\n\n\n"; $run_status = run_server("-ORBsvcconf $server_select_mt_conf_file"); diff --git a/tests/LongUpcalls/run_test.pl b/tests/LongUpcalls/run_test.pl index 16f79a0d149..8f2d8989e02 100755 --- a/tests/LongUpcalls/run_test.pl +++ b/tests/LongUpcalls/run_test.pl @@ -21,14 +21,25 @@ my $server = PerlACE::TestTarget::create_target (1) || die "Create target 1 fail my $client = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n"; my $iorbase = "server.ior"; -my $svcconf = "svc$PerlACE::svcconf_ext"; my $server_iorfile = $server->LocalFile ($iorbase); -my $server_svcfile = $server->LocalFile ($svcconf); my $client_iorfile = $client->LocalFile ($iorbase); -my $client_svcfile = $client->LocalFile ($svcconf); $server->DeleteFile($iorbase); $client->DeleteFile($iorbase); +my $svcconf = "svc$PerlACE::svcconf_ext"; +my $server_svcfile = $server->LocalFile ($svcconf); +my $client_svcfile = $client->LocalFile ($svcconf); + +if ($client->PutFile ($svcconf) == -1) { + print STDERR "ERROR: cannot set file <$client_svcfile>\n"; + exit 1; +} +if ($server->PutFile ($svcconf) == -1) { + print STDERR "ERROR: cannot set file <$server_svcfile>\n"; + exit 1; +} + + print STDERR "==== Server upcall waits for operations on other threads\n"; $SV = $server->CreateProcess ("blocking_server", diff --git a/tests/MT_BiDir/run_test.pl b/tests/MT_BiDir/run_test.pl index 1d7ba7e9b5b..4134c5f8e59 100755 --- a/tests/MT_BiDir/run_test.pl +++ b/tests/MT_BiDir/run_test.pl @@ -32,7 +32,14 @@ $client1->DeleteFile($iorbase); $client2->DeleteFile($iorbase); $client3->DeleteFile($iorbase); -my $server_conf = $server->LocalFile ("server$PerlACE::svcconf_ext"); +my $server_conf_base = "server$PerlACE::svcconf_ext"; +my $server_conf = $server->LocalFile ($server_conf_base); + +# Copy the configuration file to the target. +if ($server->PutFile ($server_conf_base) == -1) { + print STDERR "ERROR: cannot set file <$server_conf>\n"; + exit 1; +} $SV = $server->CreateProcess ("server", "-ORBdebuglevel $debug_level -ORBSvcConf $server_conf " . diff --git a/tests/MT_Client/run_test.pl b/tests/MT_Client/run_test.pl index de410bbb050..2d6638925cb 100755 --- a/tests/MT_Client/run_test.pl +++ b/tests/MT_Client/run_test.pl @@ -15,16 +15,14 @@ $conf = $PerlACE::svcconf_ext; $client_process = "client"; -$client_conf = "client.global" . $conf; +$client_conf = "client" . $conf; $server_conf = "server" . $conf; $threads = '4'; $iterations = '1000'; foreach $i (@ARGV) { - if ($i eq '-tss') { - $client_conf = "client.tss" . $PerlACE::svcconf_ext; - } elsif ($i eq '-debug') { + if ($i eq '-debug') { $debug_level = '10'; } elsif ($i eq '-creation') { $client_process = 'orb_creation'; @@ -43,6 +41,10 @@ $client->DeleteFile($iorbase); $server_conf1 = $server->LocalFile ($server_conf); +if ($server->PutFile ($server_conf) == -1) { + print STDERR "ERROR: cannot set file <$server_conf1>\n"; + exit 1; +} $SV = $server->CreateProcess ("server", "-ORBdebuglevel $debug_level " . diff --git a/tests/MT_NoUpcall_Client_Leader/run_test.pl b/tests/MT_NoUpcall_Client_Leader/run_test.pl index d64c2393165..55f187c3c6c 100755 --- a/tests/MT_NoUpcall_Client_Leader/run_test.pl +++ b/tests/MT_NoUpcall_Client_Leader/run_test.pl @@ -11,8 +11,20 @@ use PerlACE::TestTarget; my $server = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n"; my $client = PerlACE::TestTarget::create_target (2) || die "Create target 2 failed\n"; -my $client_conf = $server->LocalFile ("mt_noupcall$PerlACE::svcconf_ext"); -my $server_conf = $server->LocalFile ("mt_noupcall$PerlACE::svcconf_ext"); +my $client_conf_base = "mt_noupcall$PerlACE::svcconf_ext"; +my $client_conf = $server->LocalFile ($client_conf_base); +if ($client->PutFile ($client_conf_base) == -1) { + print STDERR "ERROR: cannot set file <$client_conf>\n"; + exit 1; +} + + +my $server_conf_base = "mt_noupcall$PerlACE::svcconf_ext"; +my $server_conf = $server->LocalFile ($server_conf_base); +if ($client->PutFile ($server_conf_base) == -1) { + print STDERR "ERROR: cannot set file <$server_conf>\n"; + exit 1; +} $debug_level = '0'; diff --git a/tests/MT_Server/run_test.pl b/tests/MT_Server/run_test.pl index 3ff7697d0a8..0f00de54ae5 100755 --- a/tests/MT_Server/run_test.pl +++ b/tests/MT_Server/run_test.pl @@ -24,9 +24,7 @@ my $client2 = PerlACE::TestTarget::create_target (3) || die "Create target 3 fai my $client3 = PerlACE::TestTarget::create_target (4) || die "Create target 4 failed\n"; my $iorbase = "server.ior"; -my $svcconf = "server$PerlACE::svcconf_ext"; my $server_iorfile = $server->LocalFile ($iorbase); -my $server_svcfile = $server->LocalFile ($svcconf); my $client1_iorfile = $client1->LocalFile ($iorbase); my $client2_iorfile = $client2->LocalFile ($iorbase); my $client3_iorfile = $client3->LocalFile ($iorbase); @@ -35,6 +33,15 @@ $client1->DeleteFile($iorbase); $client2->DeleteFile($iorbase); $client3->DeleteFile($iorbase); +my $svcconf = "server$PerlACE::svcconf_ext"; +my $server_svcfile = $server->LocalFile ($svcconf); + +# Copy the configuration file to the target. +if ($server->PutFile ($svcconf) == -1) { + print STDERR "ERROR: cannot set file <$server_svcfile>\n"; + exit 1; +} + $SV = $server->CreateProcess ("server", "-ORBdebuglevel $debug_level ". "-ORBSvcConf $server_svcfile ". diff --git a/tests/No_Server_MT_Connect_Test/run_test.pl b/tests/No_Server_MT_Connect_Test/run_test.pl index afc5b2a0938..f850acc2865 100755 --- a/tests/No_Server_MT_Connect_Test/run_test.pl +++ b/tests/No_Server_MT_Connect_Test/run_test.pl @@ -32,12 +32,29 @@ $client1->DeleteFile($iorbase); $client2->DeleteFile($iorbase); $client3->DeleteFile($iorbase); +# Initialize and copy the client configuration files +my $client2_conf_base = "reactor$PerlACE::svcconf_ext"; +my $client2_conf = $client2->LocalFile ($client2_conf_base); + +if ($client2->PutFile ($client2_conf_base) == -1) { + print STDERR "ERROR: cannot set file <$client2_conf>\n"; + exit 1; +} + +my $client3_conf_base = "blocked$PerlACE::svcconf_ext"; +my $client3_conf = $client3->LocalFile ($client3_conf_base); + +if ($client3->PutFile ($client3_conf_base) == -1) { + print STDERR "ERROR: cannot set file <$client3_conf>\n"; + exit 1; +} + $SV = $server->CreateProcess ("server", "-ORBdebuglevel $debug_level -o $server_iorfile"); $CL1 = $client1->CreateProcess ("client", "-k file://$client1_iorfile -x"); # Use a single thread in this test, because the strategy is only for # single threaded cases -$CL2 = $client2->CreateProcess ("client", "-ORBSvcConf reactor$PerlACE::svcconf_ext -n 1 -k file://$client2_iorfile"); -$CL3 = $client3->CreateProcess ("client", "-ORBSvcConf blocked$PerlACE::svcconf_ext -k file://$client3_iorfile"); +$CL2 = $client2->CreateProcess ("client", "-ORBSvcConf $client2_conf -n 1 -k file://$client2_iorfile"); +$CL3 = $client3->CreateProcess ("client", "-ORBSvcConf $client3_conf -k file://$client3_iorfile"); $server_status = $SV->Spawn (); diff --git a/tests/OBV/ValueBox/client.cpp b/tests/OBV/ValueBox/client.cpp index a88b462bdfa..d4367b0dff2 100644 --- a/tests/OBV/ValueBox/client.cpp +++ b/tests/OBV/ValueBox/client.cpp @@ -265,6 +265,14 @@ int test_basic_invocations (Test * test_object) { int fail = 0; + VBlong *p1 = 0; + VBlong *p2 = 0; + VBlong *p3; + + vb_basic::M_VBlong *mp1 = 0; + vb_basic::M_VBlong *mp2 = 0; + vb_basic::M_VBlong *mp3; + try { @@ -272,15 +280,12 @@ int test_basic_invocations (Test * test_object) // Test method invocation with boxed value //============================================================ - VBlong *p1 = 0; ACE_NEW_RETURN (p1, VBlong(25), 1); - VBlong *p2 = 0; ACE_NEW_RETURN (p2, VBlong(53), 1); - VBlong *p3; OBV_VERITY (p1->_value () == 25); OBV_VERITY (p2->_value () == 53); @@ -296,18 +301,14 @@ int test_basic_invocations (Test * test_object) // Test method invocation with boxed value from nested module //============================================================ - vb_basic::M_VBlong *mp1 = 0; ACE_NEW_RETURN (mp1, vb_basic::M_VBlong(25), 1); - vb_basic::M_VBlong *mp2 = 0; ACE_NEW_RETURN (mp2, vb_basic::M_VBlong(53), 1); - vb_basic::M_VBlong *mp3; - OBV_VERITY (mp1->_value () == 25); OBV_VERITY (mp2->_value () == 53); @@ -332,14 +333,6 @@ int test_basic_invocations (Test * test_object) OBV_VERITY (p2->_value () == (93*3)); OBV_VERITY (p3->_value () == (93*5)); OBV_VERITY (lresult == (p1->_value()*3)); - - p1->_remove_ref (); - p2->_remove_ref (); - p3->_remove_ref (); - - mp1->_remove_ref (); - mp2->_remove_ref (); - mp3->_remove_ref (); } catch (const CORBA::Exception& ex) { @@ -352,6 +345,13 @@ int test_basic_invocations (Test * test_object) "(%P|%t) test_basic_invocations: caught a C++ exception\n")); fail = 1; } + if (p1) p1->_remove_ref (); + if (p2) p2->_remove_ref (); + if (p3) p3->_remove_ref (); + + if (mp1) mp1->_remove_ref (); + if (mp2) mp2->_remove_ref (); + if (mp3) mp3->_remove_ref (); return fail; } @@ -461,6 +461,10 @@ int test_boxed_string_invocations (Test * test_object) { int fail = 0; + VBstring *p1 = 0; + VBstring *p2 = 0; + VBstring *p3 = 0; + try { @@ -468,15 +472,12 @@ int test_boxed_string_invocations (Test * test_object) // Test method invocation with boxed value //============================================================ - VBstring *p1 = 0; ACE_NEW_RETURN (p1, VBstring(CORBA::string_dup ("string1")), 1); - VBstring *p2 = 0; ACE_NEW_RETURN (p2, VBstring(CORBA::string_dup ("string2")), 1); - VBstring *p3 = 0; OBV_VERITY (ACE_OS::strcmp(p1->_value (), "string1") == 0); OBV_VERITY (ACE_OS::strcmp(p2->_value (), "string2") == 0); @@ -500,11 +501,6 @@ int test_boxed_string_invocations (Test * test_object) OBV_VERITY (ACE_OS::strcmp(p2->_value (), "2second string") == 0); OBV_VERITY (ACE_OS::strcmp(p3->_value (), "2second string") == 0); OBV_VERITY (ACE_OS::strcmp(sresult.in (), "1string") == 0); - - p1->_remove_ref (); - p2->_remove_ref (); - p3->_remove_ref (); - } catch (const CORBA::Exception& ex) { @@ -518,6 +514,9 @@ int test_boxed_string_invocations (Test * test_object) "caught a C++ exception\n")); fail = 1; } + if (p1) p1->_remove_ref (); + if (p2) p2->_remove_ref (); + if (p3) p3->_remove_ref (); return fail; } @@ -528,78 +527,89 @@ int test_boxed_string_invocations (Test * test_object) int test_boxed_sequence (void) { int fail = 0; - VBseqlong *vbseqlong1 = 0; - ACE_NEW_RETURN (vbseqlong1, - VBseqlong (), - 1); - - VBseqlong *temp = 0; - ACE_NEW_RETURN (temp, - VBseqlong (), - 1); - - VBseqlong_var vbseqlong2 (temp); - OBV_VERITY (vbseqlong1->length() == 0); - OBV_VERITY (vbseqlong2->length() == 0); - CORBA::Long *longarray = 0; - ACE_NEW_RETURN (longarray, - CORBA::Long[3], - 1); - longarray[0] = 101; - longarray[1] = 202; - longarray[2] = 303; - - // Create a sequence - TDseqlong *temp2 = 0; - ACE_NEW_RETURN (temp2, - TDseqlong(10, 3, longarray, 1), - 1); - TDseqlong_var seqlong1 (temp2); - OBV_VERITY (seqlong1[0] == 101 && seqlong1[2] == 303); - - VBseqlong *vbseqlong3 = 0; - ACE_NEW_RETURN (vbseqlong3, - VBseqlong(seqlong1.in()), - 1); - - // Test sequence ctor. - VBseqlong *vbseqlong4 = 0; - ACE_NEW_RETURN (vbseqlong4, - VBseqlong(10, 3, longarray, 0), - 1); - - // Test assignment and subscript operators - vbseqlong2 = vbseqlong3; - OBV_VERITY (vbseqlong2->length() == 3); - VBseqlong &vbseqlong5 = *vbseqlong2.inout(); - OBV_VERITY (vbseqlong5[2] == 303); - vbseqlong5[2] = 444; - OBV_VERITY (vbseqlong5[2] == 444); - OBV_VERITY (seqlong1[0] == 101 && seqlong1[2] == 303); - OBV_VERITY ((*vbseqlong4)[0] == 101 && (*vbseqlong4)[2] == 303); - seqlong1[0] = 111; - OBV_VERITY ((*vbseqlong4)[0] == 111); - OBV_VERITY (vbseqlong4->maximum() == 10); - *vbseqlong4 = vbseqlong1->_value(); - OBV_VERITY (vbseqlong4->length() == 0); - - // Test copy_value - VBseqlong *vbseqlong6 = VBseqlong::_downcast( vbseqlong4->_copy_value() ); - if (vbseqlong6 == 0) + try { - fail++; - ACE_DEBUG ((LM_DEBUG, "(%P|%t) - Failure at line %l\n")); + VBseqlong *vbseqlong1 = 0; + ACE_NEW_RETURN (vbseqlong1, + VBseqlong (), + 1); + + VBseqlong *temp = 0; + ACE_NEW_RETURN (temp, + VBseqlong (), + 1); + + VBseqlong_var vbseqlong2 (temp); + OBV_VERITY (vbseqlong1->length() == 0); + OBV_VERITY (vbseqlong2->length() == 0); + CORBA::Long *longarray = 0; + ACE_NEW_RETURN (longarray, + CORBA::Long[3], + 1); + longarray[0] = 101; + longarray[1] = 202; + longarray[2] = 303; + + // Create a sequence + TDseqlong *temp2 = 0; + ACE_NEW_RETURN (temp2, + TDseqlong(10, 3, longarray, 1), + 1); + TDseqlong_var seqlong1 (temp2); + OBV_VERITY (seqlong1[0] == 101 && seqlong1[2] == 303); + + VBseqlong *vbseqlong3 = 0; + ACE_NEW_RETURN (vbseqlong3, + VBseqlong(seqlong1.in()), + 1); + + // Test sequence ctor. + VBseqlong *vbseqlong4 = 0; + ACE_NEW_RETURN (vbseqlong4, + VBseqlong(10, 3, longarray, 0), + 1); + + // Test assignment and subscript operators + vbseqlong2 = vbseqlong3; + OBV_VERITY (vbseqlong2->length() == 3); + VBseqlong &vbseqlong5 = *vbseqlong2.inout(); + OBV_VERITY (vbseqlong5[2] == 303); + vbseqlong5[2] = 444; + OBV_VERITY (vbseqlong5[2] == 444); + OBV_VERITY (seqlong1[0] == 101 && seqlong1[2] == 303); + OBV_VERITY ((*vbseqlong4)[0] == 101 && (*vbseqlong4)[2] == 303); + seqlong1[0] = 111; + OBV_VERITY ((*vbseqlong4)[0] == 111); + OBV_VERITY (vbseqlong4->maximum() == 10); + *vbseqlong4 = vbseqlong1->_value(); + OBV_VERITY (vbseqlong4->length() == 0); + + // Test copy_value + VBseqlong *vbseqlong6 = VBseqlong::_downcast( vbseqlong4->_copy_value() ); + if (vbseqlong6 == 0) + { + fail++; + ACE_DEBUG ((LM_DEBUG, "(%P|%t) - Failure at line %l\n")); + } + else + { + OBV_VERITY (vbseqlong6->length() == 0); + vbseqlong6->_remove_ref (); + } + + // release + vbseqlong1->_remove_ref (); + vbseqlong4->_remove_ref (); } - else + catch (const ::CORBA::Exception &ex) { - OBV_VERITY (vbseqlong6->length() == 0); - vbseqlong6->_remove_ref (); + ex._tao_print_exception ("test_boxed_sequence"); + fail = 1; + } + catch (...) + { + ACE_ERROR ((LM_ERROR, "test_boxed_sequence : unexpected exception caught\n")); } - - // release - vbseqlong1->_remove_ref (); - vbseqlong4->_remove_ref (); - return fail; } @@ -607,73 +617,69 @@ int test_boxed_sequence (void) int test_boxed_sequence_invocations (Test * test_object) { - int fail = 0; - - try - { - - //============================================================ - // Test method invocation with boxed value - //============================================================ - - VBseqlong *p1 = 0; - ACE_NEW_RETURN (p1, - VBseqlong(4), - 1); - VBseqlong *p2 = 0; - ACE_NEW_RETURN (p2, - VBseqlong(3), - 1); - VBseqlong *p3; - p1->length(4); - p2->length(3); - - (*p1)[0] = 10; - (*p1)[1] = 9; - (*p1)[2] = 8; - (*p1)[3] = 7; - - (*p2)[0] = 100; - (*p2)[1] = 99; - (*p2)[2] = 98; - - OBV_VERITY ((*p1)[0] == 10); - OBV_VERITY ((*p1)[1] == 9); - OBV_VERITY ((*p1)[2] == 8); - OBV_VERITY ((*p1)[3] == 7); - - VBseqlong_var result = test_object->seq_op1(p1, p2, p3); - - OBV_VERITY ((*p2)[0] == 100*3); - OBV_VERITY ((*p2)[1] == 99*3); - OBV_VERITY ((*p2)[2] == 98*3); - OBV_VERITY ((*p3)[0] == 100*5); - OBV_VERITY ((*p3)[1] == 99*5); - OBV_VERITY ((*p3)[2] == 98*5); - OBV_VERITY ((*result.in ())[0] == 10); - OBV_VERITY ((*result.in ())[1] == 9); - OBV_VERITY ((*result.in ())[2] == 8); - OBV_VERITY ((*result.in ())[3] == 7); - - //============================================================ - // Test _boxed_in(), _boxed_inout(), and _boxed_out()) - //============================================================ - - test_object->seq_op2(p1->_boxed_in(), p2->_boxed_inout(), - p3->_boxed_out()); + int fail = 0; + VBseqlong *p1 = 0; + VBseqlong *p2 = 0; + VBseqlong *p3; - OBV_VERITY ((*p2)[0] == 100*3*3); - OBV_VERITY ((*p2)[1] == 99*3*3); - OBV_VERITY ((*p2)[2] == 98*3*3); - OBV_VERITY ((*p3)[0] == (*p1)[0]*5); - OBV_VERITY ((*p3)[1] == (*p1)[1]*5); - OBV_VERITY ((*p3)[2] == (*p1)[2]*5); - OBV_VERITY ((*p3)[3] == (*p1)[3]*5); + try + { - p1->_remove_ref (); - p2->_remove_ref (); - p3->_remove_ref (); - } + //============================================================ + // Test method invocation with boxed value + //============================================================ + + ACE_NEW_RETURN (p1, + VBseqlong(4), + 1); + ACE_NEW_RETURN (p2, + VBseqlong(3), + 1); + p1->length(4); + p2->length(3); + + (*p1)[0] = 10; + (*p1)[1] = 9; + (*p1)[2] = 8; + (*p1)[3] = 7; + + (*p2)[0] = 100; + (*p2)[1] = 99; + (*p2)[2] = 98; + + OBV_VERITY ((*p1)[0] == 10); + OBV_VERITY ((*p1)[1] == 9); + OBV_VERITY ((*p1)[2] == 8); + OBV_VERITY ((*p1)[3] == 7); + + VBseqlong_var result = test_object->seq_op1(p1, p2, p3); + + OBV_VERITY ((*p2)[0] == 100*3); + OBV_VERITY ((*p2)[1] == 99*3); + OBV_VERITY ((*p2)[2] == 98*3); + OBV_VERITY ((*p3)[0] == 100*5); + OBV_VERITY ((*p3)[1] == 99*5); + OBV_VERITY ((*p3)[2] == 98*5); + OBV_VERITY ((*result.in ())[0] == 10); + OBV_VERITY ((*result.in ())[1] == 9); + OBV_VERITY ((*result.in ())[2] == 8); + OBV_VERITY ((*result.in ())[3] == 7); + + //============================================================ + // Test _boxed_in(), _boxed_inout(), and _boxed_out()) + //============================================================ + + test_object->seq_op2(p1->_boxed_in(), p2->_boxed_inout(), + p3->_boxed_out()); + + OBV_VERITY ((*p2)[0] == 100*3*3); + OBV_VERITY ((*p2)[1] == 99*3*3); + OBV_VERITY ((*p2)[2] == 98*3*3); + OBV_VERITY ((*p3)[0] == (*p1)[0]*5); + OBV_VERITY ((*p3)[1] == (*p1)[1]*5); + OBV_VERITY ((*p3)[2] == (*p1)[2]*5); + OBV_VERITY ((*p3)[3] == (*p1)[3]*5); + } catch (const CORBA::Exception& ex) { ex._tao_print_exception ("test_boxed_sequence_invocations"); @@ -687,6 +693,10 @@ int test_boxed_sequence_invocations (Test * test_object) fail = 1; } + if (p1) p1->_remove_ref (); + if (p2) p2->_remove_ref (); + if (p3) p3->_remove_ref (); + return fail; } @@ -697,237 +707,237 @@ int test_boxed_sequence_invocations (Test * test_object) // int test_boxed_struct (void) { - int fail = 0; + int fail = 0; - Fixed_Struct1 *fixed_struct_a = 0; - ACE_NEW_RETURN (fixed_struct_a, - Fixed_Struct1, - 1); - fixed_struct_a->l = 3233; - fixed_struct_a->abstruct.s1 = 73; - fixed_struct_a->abstruct.s2 = 37; - - // Test the VBfixed_struct1 constructor - VBfixed_struct1 *valuebox1 = 0; - ACE_NEW_RETURN (valuebox1, - VBfixed_struct1 (*fixed_struct_a), - 1); + Fixed_Struct1 *fixed_struct_a = 0; + ACE_NEW_RETURN (fixed_struct_a, + Fixed_Struct1, + 1); + fixed_struct_a->l = 3233; + fixed_struct_a->abstruct.s1 = 73; + fixed_struct_a->abstruct.s2 = 37; + + // Test the VBfixed_struct1 constructor + VBfixed_struct1 *valuebox1 = 0; + ACE_NEW_RETURN (valuebox1, + VBfixed_struct1 (*fixed_struct_a), + 1); - // Test boxed copy ctor. - VBfixed_struct1* valuebox2_ptr = 0; - ACE_NEW_RETURN (valuebox2_ptr, - VBfixed_struct1 (*valuebox1), - 1); - VBfixed_struct1_var valuebox2 = valuebox2_ptr; + // Test boxed copy ctor. + VBfixed_struct1* valuebox2_ptr = 0; + ACE_NEW_RETURN (valuebox2_ptr, + VBfixed_struct1 (*valuebox1), + 1); + VBfixed_struct1_var valuebox2 = valuebox2_ptr; - OBV_VERITY (valuebox1->l () == valuebox2->l ()); - OBV_VERITY ((valuebox1->abstruct ()).s1 == (valuebox2->abstruct ()).s1 ); - OBV_VERITY ((valuebox1->abstruct ()).s2 == (valuebox2->abstruct ()).s2 ); + OBV_VERITY (valuebox1->l () == valuebox2->l ()); + OBV_VERITY ((valuebox1->abstruct ()).s1 == (valuebox2->abstruct ()).s1 ); + OBV_VERITY ((valuebox1->abstruct ()).s2 == (valuebox2->abstruct ()).s2 ); - // Change an element - valuebox1->l (505); - OBV_VERITY (valuebox1->l () != valuebox2->l ()); + // Change an element + valuebox1->l (505); + OBV_VERITY (valuebox1->l () != valuebox2->l ()); - // Change some more, to test other types. - (valuebox2->abstruct ()).s1 = 667; - OBV_VERITY ((valuebox1->abstruct ()).s1 != (valuebox2->abstruct ()).s1 ); - (valuebox2->abstruct ()).s2 = 1667; - OBV_VERITY ((valuebox1->abstruct ()).s2 != (valuebox2->abstruct ()).s2 ); + // Change some more, to test other types. + (valuebox2->abstruct ()).s1 = 667; + OBV_VERITY ((valuebox1->abstruct ()).s1 != (valuebox2->abstruct ()).s1 ); + (valuebox2->abstruct ()).s2 = 1667; + OBV_VERITY ((valuebox1->abstruct ()).s2 != (valuebox2->abstruct ()).s2 ); - Fixed_Struct1 *fixed_struct_b = 0; - ACE_NEW_RETURN (fixed_struct_b, - Fixed_Struct1, - 1); - fixed_struct_b->l = 7372; - fixed_struct_b->abstruct.s1 = 11; - fixed_struct_b->abstruct.s2 = 51; - - // Make another VBfixed_struct1 - VBfixed_struct1 *valuebox3 = 0; - ACE_NEW_RETURN (valuebox3, - VBfixed_struct1 (), - 1); + Fixed_Struct1 *fixed_struct_b = 0; + ACE_NEW_RETURN (fixed_struct_b, + Fixed_Struct1, + 1); + fixed_struct_b->l = 7372; + fixed_struct_b->abstruct.s1 = 11; + fixed_struct_b->abstruct.s2 = 51; + + // Make another VBfixed_struct1 + VBfixed_struct1 *valuebox3 = 0; + ACE_NEW_RETURN (valuebox3, + VBfixed_struct1 (), + 1); - // Test assignment operator - *valuebox3 = *fixed_struct_b; + // Test assignment operator + *valuebox3 = *fixed_struct_b; - OBV_VERITY (valuebox3->l () == fixed_struct_b->l); - OBV_VERITY ((valuebox3->abstruct ()).s1 == fixed_struct_b->abstruct.s1); - OBV_VERITY ((valuebox3->abstruct ()).s2 == fixed_struct_b->abstruct.s2); + OBV_VERITY (valuebox3->l () == fixed_struct_b->l); + OBV_VERITY ((valuebox3->abstruct ()).s1 == fixed_struct_b->abstruct.s1); + OBV_VERITY ((valuebox3->abstruct ()).s2 == fixed_struct_b->abstruct.s2); - // Test _value modifier method - valuebox2->_value (*fixed_struct_b); - OBV_VERITY (valuebox2->l () == fixed_struct_b->l); - OBV_VERITY ((valuebox2->abstruct ()).s1 == fixed_struct_b->abstruct.s1); - OBV_VERITY ((valuebox2->abstruct ()).s2 == fixed_struct_b->abstruct.s2); + // Test _value modifier method + valuebox2->_value (*fixed_struct_b); + OBV_VERITY (valuebox2->l () == fixed_struct_b->l); + OBV_VERITY ((valuebox2->abstruct ()).s1 == fixed_struct_b->abstruct.s1); + OBV_VERITY ((valuebox2->abstruct ()).s2 == fixed_struct_b->abstruct.s2); - // Test _copy_value and _downcast - VBfixed_struct1_var valuebox4 = - VBfixed_struct1::_downcast (valuebox3->_copy_value ()); - if (valuebox4.in () == 0) - { - fail++; - ACE_DEBUG ((LM_DEBUG, "(%P|%t) - Failure at line %l\n")); - } - else - { - OBV_VERITY (valuebox4->l () == fixed_struct_b->l); - OBV_VERITY ((valuebox4->abstruct ()).s1 == fixed_struct_b->abstruct.s1); - OBV_VERITY ((valuebox4->abstruct ()).s2 == fixed_struct_b->abstruct.s2); - } + // Test _copy_value and _downcast + VBfixed_struct1_var valuebox4 = + VBfixed_struct1::_downcast (valuebox3->_copy_value ()); + if (valuebox4.in () == 0) + { + fail++; + ACE_DEBUG ((LM_DEBUG, "(%P|%t) - Failure at line %l\n")); + } + else + { + OBV_VERITY (valuebox4->l () == fixed_struct_b->l); + OBV_VERITY ((valuebox4->abstruct ()).s1 == fixed_struct_b->abstruct.s1); + OBV_VERITY ((valuebox4->abstruct ()).s2 == fixed_struct_b->abstruct.s2); + } - // - // valuebox1 and valuebox3 must be explicitly removed. - CORBA::remove_ref (valuebox1); - CORBA::remove_ref (valuebox3); + // + // valuebox1 and valuebox3 must be explicitly removed. + CORBA::remove_ref (valuebox1); + CORBA::remove_ref (valuebox3); - // - // as well as the structs we new'ed. - delete fixed_struct_a; - delete fixed_struct_b; + // + // as well as the structs we new'ed. + delete fixed_struct_a; + delete fixed_struct_b; - // - // Other types are _var so their dtors will clean up remaining - // allocations. + // + // Other types are _var so their dtors will clean up remaining + // allocations. - return fail; + return fail; } int test_boxed_struct_invocations (Test * test_object) { - int fail = 0; + int fail = 0; - try - { + try + { - //============================================================ - // Fixed struct - // Test method invocation with boxed value - //============================================================ - Fixed_Struct1 fs1; - fs1.l = 29; - fs1.abstruct.s1 = 117; - fs1.abstruct.s2 = 21; + //============================================================ + // Fixed struct + // Test method invocation with boxed value + //============================================================ + Fixed_Struct1 fs1; + fs1.l = 29; + fs1.abstruct.s1 = 117; + fs1.abstruct.s2 = 21; - VBfixed_struct1 *p1 = 0; - ACE_NEW_RETURN (p1, - VBfixed_struct1(fs1), - 1); + VBfixed_struct1 *p1 = 0; + ACE_NEW_RETURN (p1, + VBfixed_struct1(fs1), + 1); - Fixed_Struct1 fs2; - fs2.l = 92; - fs2.abstruct.s1 = 171; - fs2.abstruct.s2 = 12; + Fixed_Struct1 fs2; + fs2.l = 92; + fs2.abstruct.s1 = 171; + fs2.abstruct.s2 = 12; - VBfixed_struct1 *p2 = 0; - ACE_NEW_RETURN (p2, - VBfixed_struct1(fs2), - 1); + VBfixed_struct1 *p2 = 0; + ACE_NEW_RETURN (p2, + VBfixed_struct1(fs2), + 1); - VBfixed_struct1 *p3; + VBfixed_struct1 *p3; - OBV_VERITY (p1->l() == 29); - OBV_VERITY ((p1->abstruct()).s1 == 117); - OBV_VERITY ((p1->abstruct()).s2 == 21); + OBV_VERITY (p1->l() == 29); + OBV_VERITY ((p1->abstruct()).s1 == 117); + OBV_VERITY ((p1->abstruct()).s2 == 21); - VBfixed_struct1_var result = test_object->struct_op1(p1, p2, p3); + VBfixed_struct1_var result = test_object->struct_op1(p1, p2, p3); - OBV_VERITY (p2->l() == 92*3); - OBV_VERITY ((p2->abstruct()).s1 == 171*3); - OBV_VERITY ((p2->abstruct()).s2 == 12*3); + OBV_VERITY (p2->l() == 92*3); + OBV_VERITY ((p2->abstruct()).s1 == 171*3); + OBV_VERITY ((p2->abstruct()).s2 == 12*3); - OBV_VERITY (p3->l() == 92*5); - OBV_VERITY ((p3->abstruct()).s1 == 171*5); - OBV_VERITY ((p3->abstruct()).s2 == 12*5); + OBV_VERITY (p3->l() == 92*5); + OBV_VERITY ((p3->abstruct()).s1 == 171*5); + OBV_VERITY ((p3->abstruct()).s2 == 12*5); - OBV_VERITY (result->l() == fs1.l); - OBV_VERITY ((result->abstruct()).s1 == fs1.abstruct.s1); - OBV_VERITY ((result->abstruct()).s2 == fs1.abstruct.s2); + OBV_VERITY (result->l() == fs1.l); + OBV_VERITY ((result->abstruct()).s1 == fs1.abstruct.s1); + OBV_VERITY ((result->abstruct()).s2 == fs1.abstruct.s2); - //============================================================ - // Fixed struct - // Test _boxed_in(), _boxed_inout(), and _boxed_out()) - //============================================================ + //============================================================ + // Fixed struct + // Test _boxed_in(), _boxed_inout(), and _boxed_out()) + //============================================================ - test_object->struct_op2(p1->_boxed_in(), p2->_boxed_inout(), - p3->_boxed_out()); + test_object->struct_op2(p1->_boxed_in(), p2->_boxed_inout(), + p3->_boxed_out()); - OBV_VERITY (p2->l() == 92*3*3); - OBV_VERITY ((p2->abstruct()).s1 == 171*3*3); - OBV_VERITY ((p2->abstruct()).s2 == 12*3*3); + OBV_VERITY (p2->l() == 92*3*3); + OBV_VERITY ((p2->abstruct()).s1 == 171*3*3); + OBV_VERITY ((p2->abstruct()).s2 == 12*3*3); - OBV_VERITY (p3->l() == fs1.l); - OBV_VERITY ((p3->abstruct()).s1 == fs1.abstruct.s1); - OBV_VERITY ((p3->abstruct()).s2 == fs1.abstruct.s2); + OBV_VERITY (p3->l() == fs1.l); + OBV_VERITY ((p3->abstruct()).s1 == fs1.abstruct.s1); + OBV_VERITY ((p3->abstruct()).s2 == fs1.abstruct.s2); - p1->_remove_ref (); - p2->_remove_ref (); - p3->_remove_ref (); + p1->_remove_ref (); + p2->_remove_ref (); + p3->_remove_ref (); - //============================================================ - // Variable struct - // Test method invocation with boxed value - //============================================================ + //============================================================ + // Variable struct + // Test method invocation with boxed value + //============================================================ - Variable_Struct1 vs1; - vs1.l = 29; - vs1.str = CORBA::string_dup ("variable1"); + Variable_Struct1 vs1; + vs1.l = 29; + vs1.str = CORBA::string_dup ("variable1"); - VBvariable_struct1 *p4 = 0; - ACE_NEW_RETURN (p4, - VBvariable_struct1 (vs1), - 1); + VBvariable_struct1 *p4 = 0; + ACE_NEW_RETURN (p4, + VBvariable_struct1 (vs1), + 1); - Variable_Struct1 vs2; - vs2.l = 37; - vs2.str = "variable2"; + Variable_Struct1 vs2; + vs2.l = 37; + vs2.str = "variable2"; - VBvariable_struct1 *p5 = 0; - ACE_NEW_RETURN (p5, - VBvariable_struct1 (vs2), - 1); + VBvariable_struct1 *p5 = 0; + ACE_NEW_RETURN (p5, + VBvariable_struct1 (vs2), + 1); - VBvariable_struct1 *p6; + VBvariable_struct1 *p6; - OBV_VERITY (p4->l() == 29); - OBV_VERITY (ACE_OS::strcmp(p4->str(), "variable1") == 0); + OBV_VERITY (p4->l() == 29); + OBV_VERITY (ACE_OS::strcmp(p4->str(), "variable1") == 0); - VBvariable_struct1_var result2 = test_object->struct_op3(p4, p5, p6); + VBvariable_struct1_var result2 = test_object->struct_op3(p4, p5, p6); - OBV_VERITY (p5->l() == vs2.l*3); - OBV_VERITY (ACE_OS::strcmp(p5->str(), "2variable") == 0); + OBV_VERITY (p5->l() == vs2.l*3); + OBV_VERITY (ACE_OS::strcmp(p5->str(), "2variable") == 0); - OBV_VERITY (p6->l() == vs2.l*3); - OBV_VERITY (ACE_OS::strcmp(p6->str(), "2variable") == 0); + OBV_VERITY (p6->l() == vs2.l*3); + OBV_VERITY (ACE_OS::strcmp(p6->str(), "2variable") == 0); - OBV_VERITY (result2->l() == vs1.l); - OBV_VERITY (ACE_OS::strcmp(result2->str(), vs1.str) == 0); + OBV_VERITY (result2->l() == vs1.l); + OBV_VERITY (ACE_OS::strcmp(result2->str(), vs1.str) == 0); - //============================================================ - // Variable struct - // Test _boxed_in(), _boxed_inout(), and _boxed_out()) - //============================================================ + //============================================================ + // Variable struct + // Test _boxed_in(), _boxed_inout(), and _boxed_out()) + //============================================================ - test_object->struct_op4(p4->_boxed_in(), p5->_boxed_inout(), - p6->_boxed_out()); + test_object->struct_op4(p4->_boxed_in(), p5->_boxed_inout(), + p6->_boxed_out()); - OBV_VERITY (p5->l() == vs2.l*3*3); - OBV_VERITY (ACE_OS::strcmp(p5->str(), "e2variabl") == 0); + OBV_VERITY (p5->l() == vs2.l*3*3); + OBV_VERITY (ACE_OS::strcmp(p5->str(), "e2variabl") == 0); - OBV_VERITY (p6->l() == vs1.l); - OBV_VERITY (ACE_OS::strcmp(p6->str(), vs1.str) == 0); + OBV_VERITY (p6->l() == vs1.l); + OBV_VERITY (ACE_OS::strcmp(p6->str(), vs1.str) == 0); - p4->_remove_ref (); - p5->_remove_ref (); - p6->_remove_ref (); - } + p4->_remove_ref (); + p5->_remove_ref (); + p6->_remove_ref (); + } catch (const CORBA::Exception& ex) { ex._tao_print_exception ("test_boxed_struct_invocations"); @@ -949,192 +959,192 @@ int test_boxed_struct_invocations (Test * test_object) // int test_boxed_array() { - int fail = 0; - LongArray la; - la[0] = 101; - la[1] = 202; - la[2] = 303; - - // three ctors - VBlongarray *valuebox1 = 0; - ACE_NEW_RETURN (valuebox1, - VBlongarray, - 1); - VBlongarray *valuebox2 = 0; - ACE_NEW_RETURN (valuebox2, - VBlongarray(la), - 1); - VBlongarray *valuebox3 = 0; - ACE_NEW_RETURN (valuebox3, - VBlongarray(*valuebox2), - 1); + int fail = 0; + LongArray la; + la[0] = 101; + la[1] = 202; + la[2] = 303; + + // three ctors + VBlongarray *valuebox1 = 0; + ACE_NEW_RETURN (valuebox1, + VBlongarray, + 1); + VBlongarray *valuebox2 = 0; + ACE_NEW_RETURN (valuebox2, + VBlongarray(la), + 1); + VBlongarray *valuebox3 = 0; + ACE_NEW_RETURN (valuebox3, + VBlongarray(*valuebox2), + 1); - OBV_VERITY ((*valuebox2)[0] == 101 - && valuebox2->_value()[1] == 202 - && valuebox2->_value()[2] == 303); + OBV_VERITY ((*valuebox2)[0] == 101 + && valuebox2->_value()[1] == 202 + && valuebox2->_value()[2] == 303); - OBV_VERITY ((*valuebox3)[0] == 101 - && (*valuebox3)[1] == 202 - && (*valuebox3)[2] == 303); + OBV_VERITY ((*valuebox3)[0] == 101 + && (*valuebox3)[1] == 202 + && (*valuebox3)[2] == 303); - (*valuebox3)[0] = 111; - valuebox3->_value()[1] = 222; + (*valuebox3)[0] = 111; + valuebox3->_value()[1] = 222; - OBV_VERITY ((*valuebox2)[0] == 101 - && (*valuebox2)[1] == 202 - && (*valuebox2)[2] == 303); + OBV_VERITY ((*valuebox2)[0] == 101 + && (*valuebox2)[1] == 202 + && (*valuebox2)[2] == 303); - OBV_VERITY ((*valuebox3)[0] == 111 - && (*valuebox3)[1] == 222 - && (*valuebox3)[2] == 303); + OBV_VERITY ((*valuebox3)[0] == 111 + && (*valuebox3)[1] == 222 + && (*valuebox3)[2] == 303); - *valuebox1 = la; + *valuebox1 = la; - OBV_VERITY ((*valuebox1)[0] == 101 - && valuebox1->_value()[1] == 202 - && valuebox1->_value()[2] == 303); + OBV_VERITY ((*valuebox1)[0] == 101 + && valuebox1->_value()[1] == 202 + && valuebox1->_value()[2] == 303); - valuebox2->_value(la); + valuebox2->_value(la); - OBV_VERITY ((*valuebox2)[0] == 101 - && valuebox2->_value()[1] == 202 - && valuebox2->_value()[2] == 303); + OBV_VERITY ((*valuebox2)[0] == 101 + && valuebox2->_value()[1] == 202 + && valuebox2->_value()[2] == 303); - LongArray_var lv_la(LongArray_dup(la)); - *valuebox2 = lv_la.in(); + LongArray_var lv_la(LongArray_dup(la)); + *valuebox2 = lv_la.in(); - *valuebox2 = valuebox3->_value(); - valuebox3->_value()[1] = 777; - OBV_VERITY ((*valuebox2)[0] == 111 - && valuebox2->_value()[1] == 222 - && valuebox2->_value()[2] == 303); + *valuebox2 = valuebox3->_value(); + valuebox3->_value()[1] = 777; + OBV_VERITY ((*valuebox2)[0] == 111 + && valuebox2->_value()[1] == 222 + && valuebox2->_value()[2] == 303); - // release - valuebox1->_remove_ref (); - valuebox2->_remove_ref (); - valuebox3->_remove_ref (); + // release + valuebox1->_remove_ref (); + valuebox2->_remove_ref (); + valuebox3->_remove_ref (); - return fail; + return fail; } int test_boxed_array_invocations (Test * test_object) { - int fail = 0; + int fail = 0; - try - { - //============================================================ - // Array (fixed) - // Test method invocation with boxed value - //============================================================ + try + { + //============================================================ + // Array (fixed) + // Test method invocation with boxed value + //============================================================ - LongArray la; - la[0] = 101; - la[1] = 202; - la[2] = 303; + LongArray la; + la[0] = 101; + la[1] = 202; + la[2] = 303; - VBlongarray *p1 = 0; - ACE_NEW_RETURN (p1, - VBlongarray (la), - 1); + VBlongarray *p1 = 0; + ACE_NEW_RETURN (p1, + VBlongarray (la), + 1); - LongArray la2; - la2[0] = 3101; - la2[1] = 3202; - la2[2] = 3303; + LongArray la2; + la2[0] = 3101; + la2[1] = 3202; + la2[2] = 3303; - VBlongarray *p2 = 0; - ACE_NEW_RETURN (p2, - VBlongarray (la2), - 1); + VBlongarray *p2 = 0; + ACE_NEW_RETURN (p2, + VBlongarray (la2), + 1); - OBV_VERITY ((*p1)[0] == 101 - && (*p1)[1] == 202 - && (*p1)[2] == 303); + OBV_VERITY ((*p1)[0] == 101 + && (*p1)[1] == 202 + && (*p1)[2] == 303); - VBlongarray *p3; + VBlongarray *p3; - VBlongarray_var result = test_object->array_op1 (p1, p2, p3); + VBlongarray_var result = test_object->array_op1 (p1, p2, p3); - OBV_VERITY ((*p2)[0] == (3101*3) - && (*p2)[1] == (3202*3) - && (*p3)[2] == (3303*3)); + OBV_VERITY ((*p2)[0] == (3101*3) + && (*p2)[1] == (3202*3) + && (*p3)[2] == (3303*3)); - OBV_VERITY ((*p3)[0] == (3101*3) - && (*p3)[1] == (3202*3) - && (*p3)[2] == (3303*3)); + OBV_VERITY ((*p3)[0] == (3101*3) + && (*p3)[1] == (3202*3) + && (*p3)[2] == (3303*3)); - OBV_VERITY ((*result.in ())[0] == 101 - && (*result.in ())[1] == 202 - && (*result.in ())[2] == 303); + OBV_VERITY ((*result.in ())[0] == 101 + && (*result.in ())[1] == 202 + && (*result.in ())[2] == 303); - //============================================================ - // Array (fixed) - // Test _boxed_in(), _boxed_inout(), and _boxed_out()) - //============================================================ + //============================================================ + // Array (fixed) + // Test _boxed_in(), _boxed_inout(), and _boxed_out()) + //============================================================ // Exclude the following test for now until issues with _boxed_out() // for arrays are resolved. #if 0 - test_object->array_op2(p1->_boxed_in(), p2->_boxed_inout(), - p3->_boxed_out()); + test_object->array_op2(p1->_boxed_in(), p2->_boxed_inout(), + p3->_boxed_out()); - OBV_VERITY ((*p2)[0] == (3101*3*3) - && (*p2)[1] == (3202*3*3) - && (*p2)[2] == (3303*3*3)); + OBV_VERITY ((*p2)[0] == (3101*3*3) + && (*p2)[1] == (3202*3*3) + && (*p2)[2] == (3303*3*3)); - OBV_VERITY ((*p3)[0] == (*p1)[0] - && (*p3)[1] == (*p1)[1] - && (*p3)[2] == (*p1)[2]); + OBV_VERITY ((*p3)[0] == (*p1)[0] + && (*p3)[1] == (*p1)[1] + && (*p3)[2] == (*p1)[2]); #endif - p1->_remove_ref (); - p2->_remove_ref (); - p3->_remove_ref (); + p1->_remove_ref (); + p2->_remove_ref (); + p3->_remove_ref (); - //============================================================ - // Array (variable) - // Test method invocation with boxed value - //============================================================ + //============================================================ + // Array (variable) + // Test method invocation with boxed value + //============================================================ - StringArray sa; - sa[0] = CORBA::string_dup ("in string1"); - sa[1] = CORBA::string_dup ("in string2"); + StringArray sa; + sa[0] = CORBA::string_dup ("in string1"); + sa[1] = CORBA::string_dup ("in string2"); - VBstringarray *p4 = 0; - ACE_NEW_RETURN (p4, - VBstringarray (sa), - 1); + VBstringarray *p4 = 0; + ACE_NEW_RETURN (p4, + VBstringarray (sa), + 1); - StringArray sa2; - sa2[0] = CORBA::string_dup ("inout string1"); - sa2[1] = CORBA::string_dup ("inout string2"); + StringArray sa2; + sa2[0] = CORBA::string_dup ("inout string1"); + sa2[1] = CORBA::string_dup ("inout string2"); - VBstringarray *p5 = 0; - ACE_NEW_RETURN (p5, - VBstringarray (sa2), - 1); + VBstringarray *p5 = 0; + ACE_NEW_RETURN (p5, + VBstringarray (sa2), + 1); - OBV_VERITY (ACE_OS::strcmp((*p4)[0], sa[0]) == 0); - OBV_VERITY (ACE_OS::strcmp((*p4)[1], sa[1]) == 0); + OBV_VERITY (ACE_OS::strcmp((*p4)[0], sa[0]) == 0); + OBV_VERITY (ACE_OS::strcmp((*p4)[1], sa[1]) == 0); - VBstringarray *p6; + VBstringarray *p6; - VBstringarray_var result2 = test_object->array_op3 (p4, p5, p6); + VBstringarray_var result2 = test_object->array_op3 (p4, p5, p6); - OBV_VERITY (ACE_OS::strcmp((*p5)[0], "1inout string") == 0); - OBV_VERITY (ACE_OS::strcmp((*p5)[1], "2inout string") == 0); - OBV_VERITY (ACE_OS::strcmp((*p6)[0], "1inout string") == 0); - OBV_VERITY (ACE_OS::strcmp((*p6)[1], "2inout string") == 0); - OBV_VERITY (ACE_OS::strcmp((*result2.in ())[0], sa[0]) == 0); - OBV_VERITY (ACE_OS::strcmp((*result2.in ())[1], sa[1]) == 0); + OBV_VERITY (ACE_OS::strcmp((*p5)[0], "1inout string") == 0); + OBV_VERITY (ACE_OS::strcmp((*p5)[1], "2inout string") == 0); + OBV_VERITY (ACE_OS::strcmp((*p6)[0], "1inout string") == 0); + OBV_VERITY (ACE_OS::strcmp((*p6)[1], "2inout string") == 0); + OBV_VERITY (ACE_OS::strcmp((*result2.in ())[0], sa[0]) == 0); + OBV_VERITY (ACE_OS::strcmp((*result2.in ())[1], sa[1]) == 0); - //============================================================ - // Array (variable) - // Test _boxed_in(), _boxed_inout(), and _boxed_out()) - //============================================================ + //============================================================ + // Array (variable) + // Test _boxed_in(), _boxed_inout(), and _boxed_out()) + //============================================================ // Disable the following for now. Need to troubleshoot it. #if 0 @@ -1144,29 +1154,29 @@ int test_boxed_array_invocations (Test * test_object) // Trying the following variation to troubleshoot. No compilation error // but p6 is unchanged after return from method. - StringArray sa_experimental; - StringArray_slice *slice = p6->_boxed_out(); - StringArray_out an_out (slice); - - test_object->array_op4(p4->_boxed_in(), p5->_boxed_inout(), - an_out); - - ACE_DEBUG ((LM_DEBUG, "(%P|%t) after array_op4\n")); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) p5[0]=%s\n", (const char *)((*p5)[0]))); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) p5[1]=%s\n", (const char *)((*p5)[1]))); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) p6[0]=%s\n", (const char *)((*p6)[0]))); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) p6[1]=%s\n", (const char *)((*p6)[1]))); - OBV_VERITY (ACE_OS::strcmp((*p5)[0], "g1inout strin") == 0); - OBV_VERITY (ACE_OS::strcmp((*p5)[1], "g2inout strin") == 0); - OBV_VERITY (ACE_OS::strcmp((*p6)[0], sa[0]) == 0); - OBV_VERITY (ACE_OS::strcmp((*p6)[1], sa[1]) == 0); + StringArray sa_experimental; + StringArray_slice *slice = p6->_boxed_out(); + StringArray_out an_out (slice); + + test_object->array_op4(p4->_boxed_in(), p5->_boxed_inout(), + an_out); + + ACE_DEBUG ((LM_DEBUG, "(%P|%t) after array_op4\n")); + ACE_DEBUG ((LM_DEBUG, "(%P|%t) p5[0]=%s\n", (const char *)((*p5)[0]))); + ACE_DEBUG ((LM_DEBUG, "(%P|%t) p5[1]=%s\n", (const char *)((*p5)[1]))); + ACE_DEBUG ((LM_DEBUG, "(%P|%t) p6[0]=%s\n", (const char *)((*p6)[0]))); + ACE_DEBUG ((LM_DEBUG, "(%P|%t) p6[1]=%s\n", (const char *)((*p6)[1]))); + OBV_VERITY (ACE_OS::strcmp((*p5)[0], "g1inout strin") == 0); + OBV_VERITY (ACE_OS::strcmp((*p5)[1], "g2inout strin") == 0); + OBV_VERITY (ACE_OS::strcmp((*p6)[0], sa[0]) == 0); + OBV_VERITY (ACE_OS::strcmp((*p6)[1], sa[1]) == 0); #endif - p4->_remove_ref (); - p5->_remove_ref (); - p6->_remove_ref (); + p4->_remove_ref (); + p5->_remove_ref (); + p6->_remove_ref (); - } + } catch (const CORBA::Exception& ex) { ex._tao_print_exception ("test_boxed_array_invocations"); @@ -1189,78 +1199,78 @@ int test_boxed_array_invocations (Test * test_object) // int test_boxed_union() { - int fail = 0; + int fail = 0; - VBfixed_union1 *ptemp; - ACE_NEW_RETURN (ptemp, - VBfixed_union1 (), - 1); - VBfixed_union1_var valuebox1(ptemp); + VBfixed_union1 *ptemp; + ACE_NEW_RETURN (ptemp, + VBfixed_union1 (), + 1); + VBfixed_union1_var valuebox1(ptemp); - Fixed_Union1 *ptemp2; - ACE_NEW_RETURN (ptemp2, - Fixed_Union1 (), - 1); - Fixed_Union1_var fixed_union1(ptemp2); - - // Test modifiers, accessors, discriminant access - valuebox1->m1 (37); - OBV_VERITY (valuebox1->m1 () == 37); - OBV_VERITY (valuebox1->_d () == 1 || valuebox1->_d () == 2); - - // Explicitly set discriminant, make sure thats the only thing - // that changes. - valuebox1->_d (2); - OBV_VERITY (valuebox1->_d () == 2); - OBV_VERITY (valuebox1->m1 () == 37); - valuebox1->_d (1); - OBV_VERITY (valuebox1->_d () == 1); - OBV_VERITY (valuebox1->m1 () == 37); - - // Use _value() to access - valuebox1->_value ()._d (2); - OBV_VERITY (valuebox1->_d () == 2); - - // Use _value as modifier. - valuebox1->_value (fixed_union1.in()); - OBV_VERITY (valuebox1->_d () != 1 && valuebox1->_d () != 2); - - // - VBfixed_union1* valuebox2_ptr = 0; - ACE_NEW_RETURN (valuebox2_ptr, - VBfixed_union1 (), - 1); - VBfixed_union1_var valuebox2 (valuebox2_ptr); - valuebox2->m2(333); - OBV_VERITY (valuebox2->_d () == 2); - - // Test copy ctor - VBfixed_union1* valuebox3_ptr = 0; - ACE_NEW_RETURN (valuebox3_ptr, - VBfixed_union1 (*valuebox2.in ()), - 1); - VBfixed_union1_var valuebox3 (valuebox3_ptr); - OBV_VERITY (valuebox3->_d () == 2); - OBV_VERITY (valuebox3->m2 () == 333); - - // Test assignment op - valuebox3->m2 (456); - *valuebox3.in () = valuebox2->_value (); - OBV_VERITY (valuebox3->_d () == 2); - OBV_VERITY (valuebox3->m2 () == 333); - - // Test constructor taking union argument - fixed_union1->m2 (137); - VBfixed_union1 *valuebox4_ptr = 0; - ACE_NEW_RETURN (valuebox4_ptr, - VBfixed_union1 (fixed_union1.in ()), - 1); - VBfixed_union1_var valuebox4 (valuebox4_ptr); - OBV_VERITY (valuebox4->m2 () == 137); - OBV_VERITY (valuebox4->_d () == 1 || valuebox4->_d () == 2); + Fixed_Union1 *ptemp2; + ACE_NEW_RETURN (ptemp2, + Fixed_Union1 (), + 1); + Fixed_Union1_var fixed_union1(ptemp2); + + // Test modifiers, accessors, discriminant access + valuebox1->m1 (37); + OBV_VERITY (valuebox1->m1 () == 37); + OBV_VERITY (valuebox1->_d () == 1 || valuebox1->_d () == 2); + + // Explicitly set discriminant, make sure thats the only thing + // that changes. + valuebox1->_d (2); + OBV_VERITY (valuebox1->_d () == 2); + OBV_VERITY (valuebox1->m1 () == 37); + valuebox1->_d (1); + OBV_VERITY (valuebox1->_d () == 1); + OBV_VERITY (valuebox1->m1 () == 37); + + // Use _value() to access + valuebox1->_value ()._d (2); + OBV_VERITY (valuebox1->_d () == 2); + + // Use _value as modifier. + valuebox1->_value (fixed_union1.in()); + OBV_VERITY (valuebox1->_d () != 1 && valuebox1->_d () != 2); - return fail; + // + VBfixed_union1* valuebox2_ptr = 0; + ACE_NEW_RETURN (valuebox2_ptr, + VBfixed_union1 (), + 1); + VBfixed_union1_var valuebox2 (valuebox2_ptr); + valuebox2->m2(333); + OBV_VERITY (valuebox2->_d () == 2); + + // Test copy ctor + VBfixed_union1* valuebox3_ptr = 0; + ACE_NEW_RETURN (valuebox3_ptr, + VBfixed_union1 (*valuebox2.in ()), + 1); + VBfixed_union1_var valuebox3 (valuebox3_ptr); + OBV_VERITY (valuebox3->_d () == 2); + OBV_VERITY (valuebox3->m2 () == 333); + + // Test assignment op + valuebox3->m2 (456); + *valuebox3.in () = valuebox2->_value (); + OBV_VERITY (valuebox3->_d () == 2); + OBV_VERITY (valuebox3->m2 () == 333); + + // Test constructor taking union argument + fixed_union1->m2 (137); + VBfixed_union1 *valuebox4_ptr = 0; + ACE_NEW_RETURN (valuebox4_ptr, + VBfixed_union1 (fixed_union1.in ()), + 1); + VBfixed_union1_var valuebox4 (valuebox4_ptr); + OBV_VERITY (valuebox4->m2 () == 137); + OBV_VERITY (valuebox4->_d () == 1 || valuebox4->_d () == 2); + + return fail; } @@ -1268,135 +1278,136 @@ int test_boxed_union() int test_boxed_union_invocations (Test * test_object) { - int fail = 0; - - try - { - //============================================================ - // Union (fixed) - // Test method invocation with boxed value - //============================================================ - - Fixed_Union1 *ptemp = 0; - ACE_NEW_RETURN (ptemp, - Fixed_Union1 (), - 1); - Fixed_Union1_var fixed_union1(ptemp); - - fixed_union1->m1 (321); - VBfixed_union1 *p1 = 0; - ACE_NEW_RETURN (p1, - VBfixed_union1 (fixed_union1.in ()), - 1); - - Fixed_Union1 *ptemp2 = 0; - ACE_NEW_RETURN (ptemp2, - Fixed_Union1 (), - 1); - Fixed_Union1_var fixed_union2(ptemp2); - fixed_union2->m2 (789); - VBfixed_union1 *p2 = 0; - ACE_NEW_RETURN (p2, - VBfixed_union1 (fixed_union2.in ()), - 1); - - OBV_VERITY (p1->_d () == 1); - OBV_VERITY (p1->m1 () == 321); - OBV_VERITY (p2->_d () == 2); - OBV_VERITY (p2->m2 () == 789); - - VBfixed_union1 * p3; - - VBfixed_union1_var result = test_object->union_op1 (p1, p2, p3); - - OBV_VERITY (p2->_d () == 2); - OBV_VERITY (p2->m2 () == 789*3); - OBV_VERITY (p3->_d () == 1); - OBV_VERITY (p3->m1 () == 321*3); - OBV_VERITY (result->_d () == 1); - OBV_VERITY (result->m1 () == 321*3); - - - //============================================================ - // Union (fixed) - // Test _boxed_in(), _boxed_inout(), and _boxed_out()) - //============================================================ - - test_object->union_op2(p1->_boxed_in(), p2->_boxed_inout(), - p3->_boxed_out()); - - OBV_VERITY (p2->_d () == 2); - OBV_VERITY (p2->m2 () == 789*3*3); - - OBV_VERITY (p3->_d () == 1); - OBV_VERITY (p3->m1 () == 321); - - p1->_remove_ref (); - p2->_remove_ref (); - p3->_remove_ref (); - - //============================================================ - // Union (variable) - // Test method invocation with boxed value - //============================================================ - - Variable_Union1_var variable_union1; - ACE_NEW_RETURN (variable_union1, - Variable_Union1 (), - 1); - variable_union1->m1 (321); - VBvariable_union1 *p4 = 0; - ACE_NEW_RETURN (p4, - VBvariable_union1 (variable_union1.in ()), - 1); - - Variable_Union1_var variable_union2; - ACE_NEW_RETURN (variable_union2, - Variable_Union1 (), - 1); - variable_union2->m2 (CORBA::string_dup ("abracadabra")); - VBvariable_union1 *p5 = 0; - ACE_NEW_RETURN (p5, - VBvariable_union1 (variable_union2.in ()), - 1); - - OBV_VERITY (p4->_d () == 1); - OBV_VERITY (p4->m1 () == 321); - OBV_VERITY (p5->_d () == 2); - OBV_VERITY (ACE_OS::strcmp(p5->m2 (), "abracadabra") == 0); - - VBvariable_union1 * p6; - - VBvariable_union1_var result2 = test_object->union_op3 (p4, p5, p6); - - OBV_VERITY (p5->_d () == 2); - OBV_VERITY (ACE_OS::strcmp(p5->m2 (), "aabracadabr") == 0); - OBV_VERITY (p6->_d () == 1); - OBV_VERITY (p6->m1 () == 321); - OBV_VERITY (result2->_d () == 1); - OBV_VERITY (result2->m1 () == 321); - - //============================================================ - // Union (variable) - // Test _boxed_in(), _boxed_inout(), and _boxed_out()) - //============================================================ - - p4->m1 (1722); - - test_object->union_op4(p4->_boxed_in(), p5->_boxed_inout(), - p6->_boxed_out()); - - OBV_VERITY (p5->_d () == 2); - OBV_VERITY (ACE_OS::strcmp(p5->m2 (), "raabracadab") == 0); - - OBV_VERITY (p6->_d () == 1); - OBV_VERITY (p6->m1 () == 1722); + int fail = 0; - p4->_remove_ref (); - p5->_remove_ref (); - p6->_remove_ref (); + try + { + //============================================================ + // Union (fixed) + // Test method invocation with boxed value + //============================================================ + + Fixed_Union1 *ptemp = 0; + ACE_NEW_RETURN (ptemp, + Fixed_Union1 (), + 1); + Fixed_Union1_var fixed_union1(ptemp); + + fixed_union1->m1 (321); + VBfixed_union1 *p1 = 0; + ACE_NEW_RETURN (p1, + VBfixed_union1 (fixed_union1.in ()), + 1); + + Fixed_Union1 *ptemp2 = 0; + ACE_NEW_RETURN (ptemp2, + Fixed_Union1 (), + 1); + Fixed_Union1_var fixed_union2(ptemp2); + fixed_union2->m2 (789); + VBfixed_union1 *p2 = 0; + ACE_NEW_RETURN (p2, + VBfixed_union1 (fixed_union2.in ()), + 1); + + OBV_VERITY (p1->_d () == 1); + OBV_VERITY (p1->m1 () == 321); + OBV_VERITY (p2->_d () == 2); + OBV_VERITY (p2->m2 () == 789); + + VBfixed_union1 * p3; + + VBfixed_union1_var result = test_object->union_op1 (p1, p2, p3); + + OBV_VERITY (p2->_d () == 2); + OBV_VERITY (p2->m2 () == 789*3); + OBV_VERITY (p3->_d () == 1); + OBV_VERITY (p3->m1 () == 321*3); + OBV_VERITY (result->_d () == 1); + OBV_VERITY (result->m1 () == 321*3); + + + //============================================================ + // Union (fixed) + // Test _boxed_in(), _boxed_inout(), and _boxed_out()) + //============================================================ + + test_object->union_op2(p1->_boxed_in(), p2->_boxed_inout(), + p3->_boxed_out()); + + OBV_VERITY (p2->_d () == 2); + OBV_VERITY (p2->m2 () == 789*3*3); + + OBV_VERITY (p3->_d () == 1); + OBV_VERITY (p3->m1 () == 321); + + p1->_remove_ref (); + p2->_remove_ref (); + p3->_remove_ref (); + + //============================================================ + // Union (variable) + // Test method invocation with boxed value + //============================================================ + + Variable_Union1_var variable_union1; + ACE_NEW_RETURN (variable_union1, + Variable_Union1 (), + 1); + variable_union1->m1 (321); + // TODO : resource leak + VBvariable_union1 *p4 = 0; + ACE_NEW_RETURN (p4, + VBvariable_union1 (variable_union1.in ()), + 1); + + Variable_Union1_var variable_union2; + ACE_NEW_RETURN (variable_union2, + Variable_Union1 (), + 1); + variable_union2->m2 (CORBA::string_dup ("abracadabra")); + VBvariable_union1 *p5 = 0; + ACE_NEW_RETURN (p5, + VBvariable_union1 (variable_union2.in ()), + 1); + + OBV_VERITY (p4->_d () == 1); + OBV_VERITY (p4->m1 () == 321); + OBV_VERITY (p5->_d () == 2); + OBV_VERITY (ACE_OS::strcmp(p5->m2 (), "abracadabra") == 0); + + VBvariable_union1 * p6; + + VBvariable_union1_var result2 = test_object->union_op3 (p4, p5, p6); + + OBV_VERITY (p5->_d () == 2); + OBV_VERITY (ACE_OS::strcmp(p5->m2 (), "aabracadabr") == 0); + OBV_VERITY (p6->_d () == 1); + OBV_VERITY (p6->m1 () == 321); + OBV_VERITY (result2->_d () == 1); + OBV_VERITY (result2->m1 () == 321); + + //============================================================ + // Union (variable) + // Test _boxed_in(), _boxed_inout(), and _boxed_out()) + //============================================================ + + p4->m1 (1722); + + test_object->union_op4(p4->_boxed_in(), p5->_boxed_inout(), + p6->_boxed_out()); + + OBV_VERITY (p5->_d () == 2); + OBV_VERITY (ACE_OS::strcmp(p5->m2 (), "raabracadab") == 0); + + OBV_VERITY (p6->_d () == 1); + OBV_VERITY (p6->m1 () == 1722); + + p4->_remove_ref (); + p5->_remove_ref (); + p6->_remove_ref (); - } + } catch (const CORBA::Exception& ex) { ex._tao_print_exception ("test_boxed_union_invocations"); diff --git a/tests/ORB_Local_Config/Bug_3049/README b/tests/ORB_Local_Config/Bug_3049/README index 590c65fc374..5e1b1ae4c33 100644 --- a/tests/ORB_Local_Config/Bug_3049/README +++ b/tests/ORB_Local_Config/Bug_3049/README @@ -1,2 +1,4 @@ +// $Id$ + This test was borrowed from bugzilla 1459 and intends to test the ability to use differently configured ORBs within the same process. diff --git a/tests/ORB_Local_Config/Two_DLL_ORB/README b/tests/ORB_Local_Config/Two_DLL_ORB/README index a49e8cea08c..46638e311ec 100644 --- a/tests/ORB_Local_Config/Two_DLL_ORB/README +++ b/tests/ORB_Local_Config/Two_DLL_ORB/README @@ -1,3 +1,5 @@ +// $Id$ + This test is intended to demonstrate the ORB-specific configuration feature. It excesses two basic scenarios, in which a client and a server ORB exchange a simple message. The twist is that both are diff --git a/tests/Oneway_Send_Timeouts/run_test.pl b/tests/Oneway_Send_Timeouts/run_test.pl index 9fddebaff12..c9945d9b814 100755 --- a/tests/Oneway_Send_Timeouts/run_test.pl +++ b/tests/Oneway_Send_Timeouts/run_test.pl @@ -14,7 +14,7 @@ $status = 0; $debug_level = '0'; $test_port = 12345; $management_port = 12346; -$client_conf = $target->LocalFile ("lf_flush.conf"); +$conf_file = "lf_flush.conf"; $flush_strategy = "LF"; foreach $i (@ARGV) { @@ -22,11 +22,11 @@ foreach $i (@ARGV) { $debug_level = '10'; } elsif ($i eq '-blocking') { - $client_conf = "block_flush.conf"; + $conf_file = "block_flush.conf"; $flush_strategy = "BLOCKING"; } elsif ($i eq '-reactive') { - $client_conf = "reactive_flush.conf"; + $conf_file = "reactive_flush.conf"; $flush_strategy = "REACTIVE"; } else { @@ -35,6 +35,13 @@ foreach $i (@ARGV) { } } +$client_conf = $target->LocalFile ($conf_file); + +if ($target->PutFile ($conf_file) == -1) { + print STDERR "ERROR: cannot set file <$client_conf>\n"; + exit 1; +} + my $test_opts = "-s \'-ORBEndpoint iiop://localhost:$test_port -ORBEndpoint " . "iiop://localhost:$management_port -ORBDebuglevel $debug_level -ORBCollocation " . "no -ORBGestalt LOCAL\' -c \'-k corbaloc::localhost:$test_port/Test -b " . diff --git a/tests/POA/EndpointPolicy/run_test_dh.pl b/tests/POA/EndpointPolicy/run_test_dh.pl index 85efd52677c..3d4b8d97310 100755 --- a/tests/POA/EndpointPolicy/run_test_dh.pl +++ b/tests/POA/EndpointPolicy/run_test_dh.pl @@ -14,6 +14,16 @@ $port = 12345; my $server = PerlACE::TestTarget::create_target (1) || die "Create target 1 failed\n"; +# configuration not passed to the server by the command line but the server +# will open it. +my $svcconf = "multi_prot.conf"; +my $server_svcfile = $server->LocalFile ($svcconf); +if ($server->PutFile ($svcconf) == -1) { + print STDERR "ERROR: cannot set file <$server_svcfile>\n"; + exit 1; +} + + $iiopSV = $server->CreateProcess ("server", "-ORBDottedDecimalAddresses 0 -ORBUseSharedProfile 1 -h default -p $port"); print "Starting server using only IIOP\n"; diff --git a/tests/POA/EndpointPolicy/server.cpp b/tests/POA/EndpointPolicy/server.cpp index 3b2f0887539..dc65656f201 100644 --- a/tests/POA/EndpointPolicy/server.cpp +++ b/tests/POA/EndpointPolicy/server.cpp @@ -347,9 +347,15 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) { ex._tao_print_exception ("cannot run server"); } - root_poa->destroy (1, 1); - - orb->destroy (); + try + { + root_poa->destroy (1, 1); + orb->destroy (); + } + catch (CORBA::Exception &ex) + { + ex._tao_print_exception ("CORBA exception during shutdown"); + } return 0; } diff --git a/tests/POA/Loader/server.cpp b/tests/POA/Loader/server.cpp index 809eccba1fa..37603d1319b 100644 --- a/tests/POA/Loader/server.cpp +++ b/tests/POA/Loader/server.cpp @@ -18,49 +18,56 @@ int ACE_TMAIN(int argc, ACE_TCHAR *argv[]) { - Server_i server; + try + { + Server_i server; - if (server.init (argc, argv) != 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Failure during Initialisation: init ()\n"), - -1); + if (server.init (argc, argv) != 0) + ACE_ERROR_RETURN ((LM_ERROR, + "Failure during Initialisation: init ()\n"), + -1); - // This POA is used to test the Servant Activator interface and - // hence has an RETAIN policy. - PortableServer::POA_var first_poa = - server.create_poa ("firstPOA", 1); + // This POA is used to test the Servant Activator interface and + // hence has an RETAIN policy. + PortableServer::POA_var first_poa = + server.create_poa ("firstPOA", 1); - if (first_poa.in () == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Failure during first POA creation: create_poa ()\n"), - -1); + if (first_poa.in () == 0) + ACE_ERROR_RETURN ((LM_ERROR, + "Failure during first POA creation: create_poa ()\n"), + -1); - // This poa is used to test the Servant Activator interface and - // hence has an NONRETAIN policy. - PortableServer::POA_var second_poa = - server.create_poa ("secondPOA", 0); + // This poa is used to test the Servant Activator interface and + // hence has an NONRETAIN policy. + PortableServer::POA_var second_poa = + server.create_poa ("secondPOA", 0); - if (second_poa.in () == 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Failure during second POA creation: create_poa ()\n"), - -1); + if (second_poa.in () == 0) + ACE_ERROR_RETURN ((LM_ERROR, + "Failure during second POA creation: create_poa ()\n"), + -1); - // The Servant Activator interface is created and initialised. - if (server.create_activator (first_poa) != 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Failure during first Servant Activator creation: create_activator()\n"), - -1); + // The Servant Activator interface is created and initialised. + if (server.create_activator (first_poa) != 0) + ACE_ERROR_RETURN ((LM_ERROR, + "Failure during first Servant Activator creation: create_activator()\n"), + -1); - // The Servant Locator interface is created and initialised. - if (server.create_locator (second_poa) !=0) - ACE_ERROR_RETURN ((LM_ERROR, - "Failure during first Servant Locator creation: create_activator()\n"), - -1); + // The Servant Locator interface is created and initialised. + if (server.create_locator (second_poa) !=0) + ACE_ERROR_RETURN ((LM_ERROR, + "Failure during first Servant Locator creation: create_activator()\n"), + -1); - // The server begins processing requests. - if (server.run () != 0) - ACE_ERROR_RETURN ((LM_ERROR, - "Failure during request processing: run ()\n"), - -1); + // The server begins processing requests. + if (server.run () != 0) + ACE_ERROR_RETURN ((LM_ERROR, + "Failure during request processing: run ()\n"), + -1); + } + catch (const ::CORBA::Exception &ex) + { + ex._tao_print_exception("Caught unexpected CORBA exception :"); + } return 0; } diff --git a/tests/Parallel_Connect_Strategy/run_test.pl b/tests/Parallel_Connect_Strategy/run_test.pl index 33f491bb35f..d3c126b1f21 100755 --- a/tests/Parallel_Connect_Strategy/run_test.pl +++ b/tests/Parallel_Connect_Strategy/run_test.pl @@ -38,15 +38,27 @@ my $corbaloc = "corbaloc:". my $valid_ep = "-ORBListenEndpoints iiop://$TARGETHOSTNAME:$port"; my $iorbase = "server.ior"; -my $reactive_conf = "reactive$PerlACE::svcconf_ext"; -my $blocked_conf = "blocked$PerlACE::svcconf_ext"; my $server_iorfile = $server->LocalFile ($iorbase); my $client_iorfile = $client->LocalFile ($iorbase); -my $client_reactive_conf = $client->LocalFile ($reactive_conf); -my $client_blocked_conf = $client->LocalFile ($blocked_conf); + $server->DeleteFile($iorbase); $client->DeleteFile($iorbase); +my $reactive_conf = "reactive$PerlACE::svcconf_ext"; +my $blocked_conf = "blocked$PerlACE::svcconf_ext"; +my $client_reactive_conf = $client->LocalFile ($reactive_conf); +my $client_blocked_conf = $client->LocalFile ($blocked_conf); + +if ($client->PutFile ($reactive_conf) == -1) { + print STDERR "ERROR: cannot set file <$client_reactive_conf>\n"; + exit 1; +} + +if ($client->PutFile ($blocked_conf) == -1) { + print STDERR "ERROR: cannot set file <$client_blocked_conf>\n"; + exit 1; +} + $SV = $server->CreateProcess ("server", "-ORBdebuglevel $debug_level ". "-ORBUseSharedProfile 1 ". diff --git a/tests/Param_Test/driver.cpp b/tests/Param_Test/driver.cpp index 1217a092551..13e927eee6e 100644 --- a/tests/Param_Test/driver.cpp +++ b/tests/Param_Test/driver.cpp @@ -24,21 +24,30 @@ int ACE_TMAIN(int argc, ACE_TCHAR *argv[]) { // get an instance of the driver object - Driver drv; + try + { + Driver drv; - // initialize the driver - if (drv.init (argc, argv) == -1) - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) driver.cpp - " - "Driver initialization failed\n"), - -1); + // initialize the driver + if (drv.init (argc, argv) == -1) + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) driver.cpp - " + "Driver initialization failed\n"), + -1); - // run various tests - if (drv.run () == -1) - ACE_ERROR_RETURN ((LM_ERROR, - "(%N:%l) driver.cpp - " - "tests failed\n"), - -1); + // run various tests + if (drv.run () == -1) + ACE_ERROR_RETURN ((LM_ERROR, + "(%N:%l) driver.cpp - " + "tests failed\n"), + -1); + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("Caught unexpected CORBA exception:"); + + return 1; + } return 0; } diff --git a/tests/Portable_Interceptors/AdvSlot/client.cpp b/tests/Portable_Interceptors/AdvSlot/client.cpp index 9dde6c00f21..0feb40d7b44 100644 --- a/tests/Portable_Interceptors/AdvSlot/client.cpp +++ b/tests/Portable_Interceptors/AdvSlot/client.cpp @@ -6,22 +6,30 @@ int ACE_TMAIN(int argc, ACE_TCHAR *argv[]) { - CORBA::ORB_var orb = CORBA::ORB_init (argc, argv); + try + { + CORBA::ORB_var orb = CORBA::ORB_init (argc, argv); - if (argc != 2) - { - ACE_DEBUG ((LM_ERROR, "Usage: %s <ior>\n", argv[0])); - return -1; - } + if (argc != 2) + { + ACE_DEBUG ((LM_ERROR, "Usage: %s <ior>\n", argv[0])); + return -1; + } - CORBA::Object_var obj = orb->string_to_object (argv[1]); - StateTransfer_var server = StateTransfer::_narrow (obj.in ()); + CORBA::Object_var obj = orb->string_to_object (argv[1]); + StateTransfer_var server = StateTransfer::_narrow (obj.in ()); - CORBA::Short n = server->number (); + CORBA::Short n = server->number (); - ACE_DEBUG ((LM_ERROR, "Got number %d\n", n)); + ACE_DEBUG ((LM_ERROR, "Got number %d\n", n)); - server->shutdown (); + server->shutdown (); + } + catch (const ::CORBA::Exception &ex) + { + ex._tao_print_exception ("ERROR : unexpected CORBA exception caught : "); + return 1; + } return 0; } diff --git a/tests/Portable_Interceptors/AdvSlot/server.cpp b/tests/Portable_Interceptors/AdvSlot/server.cpp index 007d6fca674..87978761ff6 100644 --- a/tests/Portable_Interceptors/AdvSlot/server.cpp +++ b/tests/Portable_Interceptors/AdvSlot/server.cpp @@ -177,59 +177,68 @@ public: int ACE_TMAIN(int argc, ACE_TCHAR *argv[]) { - ORBInitializer_var orb_initializer (new ORB_Initializer ()); - register_orb_initializer (orb_initializer.in ()); + try + { + ORBInitializer_var orb_initializer (new ORB_Initializer ()); + register_orb_initializer (orb_initializer.in ()); - ORB_var orb (ORB_init (argc, argv)); + ORB_var orb (ORB_init (argc, argv)); - if (parse_args (argc, argv) != 0) - return 1; + if (parse_args (argc, argv) != 0) + return 1; - Object_var obj (orb->resolve_initial_references ("RootPOA")); + Object_var obj (orb->resolve_initial_references ("RootPOA")); - POA_var root_poa (POA::_narrow (obj.in ())); - POAManager_var poa_manager (root_poa->the_POAManager ()); + POA_var root_poa (POA::_narrow (obj.in ())); + POAManager_var poa_manager (root_poa->the_POAManager ()); - StateTransferImpl* impl = new StateTransferImpl (orb.in ()); - ServantBase_var impl_var (impl); + StateTransferImpl* impl = new StateTransferImpl (orb.in ()); + ServantBase_var impl_var (impl); - PortableServer::ObjectId_var id_act = - root_poa->activate_object (impl); + PortableServer::ObjectId_var id_act = + root_poa->activate_object (impl); - CORBA::Object_var object = root_poa->id_to_reference (id_act.in ()); + CORBA::Object_var object = root_poa->id_to_reference (id_act.in ()); - StateTransfer_var ref = StateTransfer::_narrow (object.in ()); - String_var ior (orb->object_to_string (ref.in ())); + StateTransfer_var ref = StateTransfer::_narrow (object.in ()); + String_var ior (orb->object_to_string (ref.in ())); - poa_manager->activate (); + poa_manager->activate (); - // Dump the ior. - // - FILE *output_file= ACE_OS::fopen (ior_output_file, "w"); - if (output_file == 0) - { - ACE_ERROR_RETURN ((LM_ERROR, - "Cannot open output file <%s> for writing " - "IOR: %C", - ior_output_file, - ior.in ()), - 1); - } + // Dump the ior. + // + FILE *output_file= ACE_OS::fopen (ior_output_file, "w"); + if (output_file == 0) + { + ACE_ERROR_RETURN ((LM_ERROR, + "Cannot open output file <%s> for writing " + "IOR: %C", + ior_output_file, + ior.in ()), + 1); + } + + ACE_OS::fprintf (output_file, "%s", ior.in ()); + ACE_OS::fclose (output_file); - ACE_OS::fprintf (output_file, "%s", ior.in ()); - ACE_OS::fclose (output_file); + ACE_DEBUG ((LM_DEBUG, "Server is ready, IOR is in '%s'\n", ior_output_file)); - ACE_DEBUG ((LM_DEBUG, "Server is ready, IOR is in '%s'\n", ior_output_file)); + // Run the ORB event loop. + // + orb->run (); - // Run the ORB event loop. - // - orb->run (); + root_poa->destroy (1, 1); + orb->destroy (); - root_poa->destroy (1, 1); - orb->destroy (); + ACE_DEBUG ((LM_DEBUG, "Event loop finished.\n")); + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("Caught unexpected CORBA exception:"); - ACE_DEBUG ((LM_DEBUG, "Event loop finished.\n")); + return 1; + } return 0; } diff --git a/tests/Portable_Interceptors/AdvSlotDblCpy/client.cpp b/tests/Portable_Interceptors/AdvSlotDblCpy/client.cpp index ed27268f76e..a4b4397259d 100644 --- a/tests/Portable_Interceptors/AdvSlotDblCpy/client.cpp +++ b/tests/Portable_Interceptors/AdvSlotDblCpy/client.cpp @@ -21,21 +21,29 @@ namespace int ACE_TMAIN(int argc, ACE_TCHAR *argv[]) { - CORBA::ORB_var orb = CORBA::ORB_init (argc, argv); + try + { + CORBA::ORB_var orb = CORBA::ORB_init (argc, argv); - if (argc != 2) - { - ACE_DEBUG ((LM_ERROR, "Usage: %s <ior>\n", argv[0])); - return -1; - } + if (argc != 2) + { + ACE_DEBUG ((LM_ERROR, "Usage: %s <ior>\n", argv[0])); + return -1; + } - CORBA::Object_var obj = orb->string_to_object (argv[1]); - InvokeMe_var server = InvokeMe::_narrow (obj.in ()); + CORBA::Object_var obj = orb->string_to_object (argv[1]); + InvokeMe_var server = InvokeMe::_narrow (obj.in ()); - always Shutdown( server.in () ); // When goes out of scope! - server->invoke_me (); - ACE_DEBUG ((LM_DEBUG, "\n")); - server->invoke_me (); + always Shutdown( server.in () ); // When goes out of scope! + server->invoke_me (); + ACE_DEBUG ((LM_DEBUG, "\n")); + server->invoke_me (); + } + catch (const ::CORBA::Exception &ex) + { + ex._tao_print_exception ("ERROR : unexpected CORBA exception caught : "); + return 1; + } return 0; } diff --git a/tests/Portable_Interceptors/AdvSlotExt/client.cpp b/tests/Portable_Interceptors/AdvSlotExt/client.cpp index 9dde6c00f21..e3878d4c9ed 100644 --- a/tests/Portable_Interceptors/AdvSlotExt/client.cpp +++ b/tests/Portable_Interceptors/AdvSlotExt/client.cpp @@ -6,22 +6,30 @@ int ACE_TMAIN(int argc, ACE_TCHAR *argv[]) { - CORBA::ORB_var orb = CORBA::ORB_init (argc, argv); + try + { + CORBA::ORB_var orb = CORBA::ORB_init (argc, argv); - if (argc != 2) - { - ACE_DEBUG ((LM_ERROR, "Usage: %s <ior>\n", argv[0])); - return -1; - } + if (argc != 2) + { + ACE_DEBUG ((LM_ERROR, "Usage: %s <ior>\n", argv[0])); + return -1; + } - CORBA::Object_var obj = orb->string_to_object (argv[1]); - StateTransfer_var server = StateTransfer::_narrow (obj.in ()); + CORBA::Object_var obj = orb->string_to_object (argv[1]); + StateTransfer_var server = StateTransfer::_narrow (obj.in ()); - CORBA::Short n = server->number (); + CORBA::Short n = server->number (); - ACE_DEBUG ((LM_ERROR, "Got number %d\n", n)); + ACE_DEBUG ((LM_ERROR, "Got number %d\n", n)); - server->shutdown (); + server->shutdown (); + } + catch (const ::CORBA::Exception &ex) + { + ex._tao_print_exception ("ERROR : unexpected CORBA exception caught : "); + return 1; + } return 0; } diff --git a/tests/RTCORBA/Server_Protocol/run_test.pl b/tests/RTCORBA/Server_Protocol/run_test.pl index 101b3a7a7d5..747cab71129 100755 --- a/tests/RTCORBA/Server_Protocol/run_test.pl +++ b/tests/RTCORBA/Server_Protocol/run_test.pl @@ -19,10 +19,21 @@ $client->DeleteFile($iorbase); $status = 0; -$server_reverse_conf = $server->LocalFile ("server_reverse$PerlACE::svcconf_ext"); -$server_iiop_uiop_conf = $server->LocalFile ("server_iiop_uiop$PerlACE::svcconf_ext"); -$server_iiop_shmiop_conf = $server->LocalFile ("server_iiop_shmiop$PerlACE::svcconf_ext"); -$server_reverse_nt_conf = $server->LocalFile ("server_reverse_nt$PerlACE::svcconf_ext"); +$server_reverse_conf_base = "server_reverse$PerlACE::svcconf_ext"; +$server_reverse_conf = $server->LocalFile ($server_reverse_conf_base); + +$server_iiop_uiop_conf_base = "server_iiop_uiop$PerlACE::svcconf_ext"; +$server_iiop_uiop_conf = $server->LocalFile ($server_iiop_uiop_conf_base); + +# Copy configuration files to the target. +if ($server->PutFile ($server_reverse_conf_base) == -1) { + print STDERR "ERROR: cannot set file <$server_reverse_conf>\n"; + exit 1; +} +if ($server->PutFile ($server_iiop_uiop_conf_base) == -1) { + print STDERR "ERROR: cannot set file <$server_iiop_uiop_conf>\n"; + exit 1; +} # Configurations for all tests to be run. @server_opts = @@ -44,8 +55,26 @@ $server_reverse_nt_conf = $server->LocalFile ("server_reverse_nt$PerlACE::svcco "* Overriding ORB Default Server Protocol Policy in the POA\n" ." (POA Server Protocol set to UIOP only): \n"); + + # UIOP only available on Unix. Substitute with alternative tests on Windows. if ($^O eq "MSWin32" || $^O eq "VMS") { + $server_iiop_shmiop_conf_base = "server_iiop_shmiop$PerlACE::svcconf_ext"; + $server_iiop_shmiop_conf = $server->LocalFile ($server_iiop_shmiop_conf_base); + + $server_reverse_nt_conf_base = "server_reverse_nt$PerlACE::svcconf_ext"; + $server_reverse_nt_conf = $server->LocalFile ($server_reverse_nt_conf_base); + + # Copy the configuration files + if ($server->PutFile ($server_iiop_shmiop_conf_base) == -1) { + print STDERR "ERROR: cannot set file <$server_iiop_shmiop_conf>\n"; + exit 1; + } + if ($server->PutFile ($server_reverse_nt_conf_base) == -1) { + print STDERR "ERROR: cannot set file <$server_reverse_nt_conf>\n"; + exit 1; + } + @server_opts = ("-ORBSndSock 54321 -ORBendpoint iiop://", diff --git a/tests/RTScheduling/Scheduling_Interceptor/test_client.cpp b/tests/RTScheduling/Scheduling_Interceptor/test_client.cpp index 474cc501061..96af1ad9a57 100644 --- a/tests/RTScheduling/Scheduling_Interceptor/test_client.cpp +++ b/tests/RTScheduling/Scheduling_Interceptor/test_client.cpp @@ -44,75 +44,84 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) try { + try + { - orb = CORBA::ORB_init (argc, argv); + orb = CORBA::ORB_init (argc, argv); - if (parse_args (argc, argv) == -1) - return (-1); + if (parse_args (argc, argv) == -1) + return (-1); - CORBA::Object_var manager_obj = orb->resolve_initial_references ("RTSchedulerManager"); + CORBA::Object_var manager_obj = orb->resolve_initial_references ("RTSchedulerManager"); - TAO_RTScheduler_Manager_var manager = TAO_RTScheduler_Manager::_narrow (manager_obj.in ()); + TAO_RTScheduler_Manager_var manager = TAO_RTScheduler_Manager::_narrow (manager_obj.in ()); - TAO_Scheduler* scheduler = 0; - ACE_NEW_RETURN (scheduler, - TAO_Scheduler (orb.in ()), - -1); - safe_scheduler = scheduler; + TAO_Scheduler* scheduler = 0; + ACE_NEW_RETURN (scheduler, + TAO_Scheduler (orb.in ()), + -1); + safe_scheduler = scheduler; - manager->rtscheduler (scheduler); + manager->rtscheduler (scheduler); - CORBA::Object_var object = - orb->string_to_object (ior.c_str ()); + CORBA::Object_var object = + orb->string_to_object (ior.c_str ()); - server = test::_narrow (object.in ()); + server = test::_narrow (object.in ()); - if (CORBA::is_nil (server.in ())) - { - ACE_ERROR_RETURN ((LM_ERROR, - "ERROR: Object reference <%s> is nil\n", - ior.c_str ()), - 1); - } + if (CORBA::is_nil (server.in ())) + { + ACE_ERROR_RETURN ((LM_ERROR, + "ERROR: Object reference <%s> is nil\n", + ior.c_str ()), + 1); + } - CORBA::Object_var current_obj = orb->resolve_initial_references ("RTScheduler_Current"); + CORBA::Object_var current_obj = orb->resolve_initial_references ("RTScheduler_Current"); - RTScheduling::Current_var current = RTScheduling::Current::_narrow (current_obj.in ()); + RTScheduling::Current_var current = RTScheduling::Current::_narrow (current_obj.in ()); - const char * name = 0; - CORBA::Policy_ptr sched_param = 0; - CORBA::Policy_ptr implicit_sched_param = 0; + const char * name = 0; + CORBA::Policy_ptr sched_param = 0; + CORBA::Policy_ptr implicit_sched_param = 0; - current->begin_scheduling_segment (name, - sched_param, - implicit_sched_param); + current->begin_scheduling_segment (name, + sched_param, + implicit_sched_param); - ACE_DEBUG ((LM_DEBUG, - "Making a one-way request\n")); - server->one_way (ACE_TEXT_ALWAYS_CHAR(ior.c_str ())); + ACE_DEBUG ((LM_DEBUG, + "Making a one-way request\n")); + server->one_way (ACE_TEXT_ALWAYS_CHAR(ior.c_str ())); - ACE_DEBUG ((LM_DEBUG, - "Making a two-way request\n")); - server->two_way (ACE_TEXT_ALWAYS_CHAR(ior.c_str ())); + ACE_DEBUG ((LM_DEBUG, + "Making a two-way request\n")); + server->two_way (ACE_TEXT_ALWAYS_CHAR(ior.c_str ())); - current->end_scheduling_segment (name); + current->end_scheduling_segment (name); - } - catch (const CORBA::THREAD_CANCELLED& ) - { - ACE_DEBUG ((LM_DEBUG, - "Distributable Thread Cancelled - Expected Exception\n")); - server->shutdown (); + } + catch (const CORBA::THREAD_CANCELLED& ) + { + ACE_DEBUG ((LM_DEBUG, + "Distributable Thread Cancelled - Expected Exception\n")); + server->shutdown (); + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("Caught exception:"); + + return 0; + } + + orb->destroy (); } catch (const CORBA::Exception& ex) { - ex._tao_print_exception ("Caught exception:"); + ex._tao_print_exception ("Caught unexpected exception:"); - return 0; + return 1; } - orb->destroy (); - return 0; } diff --git a/tests/RTScheduling/VoidData/test_client.cpp b/tests/RTScheduling/VoidData/test_client.cpp index f81f48c2378..e2b29cf941c 100644 --- a/tests/RTScheduling/VoidData/test_client.cpp +++ b/tests/RTScheduling/VoidData/test_client.cpp @@ -22,8 +22,16 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) { ex._tao_print_exception ("Caught exception:"); - orb->shutdown (); - orb->destroy (); + try + { + orb->shutdown (); + orb->destroy (); + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("Caught exception while shutting down:"); + return 1; + } return 0; } diff --git a/tests/Sequence_Unit_Tests/bounded_object_reference_sequence_ut.cpp b/tests/Sequence_Unit_Tests/bounded_object_reference_sequence_ut.cpp index c5fd630ab97..15c192b70f8 100644 --- a/tests/Sequence_Unit_Tests/bounded_object_reference_sequence_ut.cpp +++ b/tests/Sequence_Unit_Tests/bounded_object_reference_sequence_ut.cpp @@ -373,17 +373,25 @@ int ACE_TMAIN(int,ACE_TCHAR*[]) int status = 0; Tester mytester; - status += mytester.test_default_constructor(); - status += mytester.test_buffer_constructor_release_true(); - status += mytester.test_buffer_constructor_release_false(); - status += mytester.test_copy_constructor_from_default(); - status += mytester.test_copy_constructor(); - status += mytester.test_copy_constructor_throw_duplicate(); - status += mytester.test_set_length_less_than_maximum(); - status += mytester.test_set_length_more_than_maximum(); - status += mytester.test_replace_release_true(); - status += mytester.test_replace_release_false(); - status += mytester.test_replace_release_default(); + try + { + status += mytester.test_default_constructor(); + status += mytester.test_buffer_constructor_release_true(); + status += mytester.test_buffer_constructor_release_false(); + status += mytester.test_copy_constructor_from_default(); + status += mytester.test_copy_constructor(); + status += mytester.test_copy_constructor_throw_duplicate(); + status += mytester.test_set_length_less_than_maximum(); + status += mytester.test_set_length_more_than_maximum(); + status += mytester.test_replace_release_true(); + status += mytester.test_replace_release_false(); + status += mytester.test_replace_release_default(); + } + catch (const ::CORBA::Exception &ex) + { + ex._tao_print_exception("ERROR : unexpected CORBA exception caugth :"); + ++status; + } return status; } diff --git a/tests/Sequence_Unit_Tests/bounded_sequence_cdr_ut.cpp b/tests/Sequence_Unit_Tests/bounded_sequence_cdr_ut.cpp index 7ebdad108ea..74090a06606 100644 --- a/tests/Sequence_Unit_Tests/bounded_sequence_cdr_ut.cpp +++ b/tests/Sequence_Unit_Tests/bounded_sequence_cdr_ut.cpp @@ -98,9 +98,18 @@ struct Tester int ACE_TMAIN(int,ACE_TCHAR*[]) { int status = 0; - Tester mytester; - status += mytester.test_stream(); + try + { + Tester mytester; + + status += mytester.test_stream(); + } + catch (const ::CORBA::Exception &ex) + { + ex._tao_print_exception("ERROR : unexpected CORBA exception caugth :"); + ++status; + } return status; } diff --git a/tests/Sequence_Unit_Tests/bounded_string_sequence_ut.cpp b/tests/Sequence_Unit_Tests/bounded_string_sequence_ut.cpp index 7e809d46b13..6a9dee75cc4 100644 --- a/tests/Sequence_Unit_Tests/bounded_string_sequence_ut.cpp +++ b/tests/Sequence_Unit_Tests/bounded_string_sequence_ut.cpp @@ -356,18 +356,26 @@ int ACE_TMAIN(int,ACE_TCHAR*[]) { int status = 0; - typedef TAO::bounded_basic_string_sequence<char, MAXIMUM> s_sequence; - typedef Tester<s_sequence> nTester; - nTester myntester; + try + { + typedef TAO::bounded_basic_string_sequence<char, MAXIMUM> s_sequence; + typedef Tester<s_sequence> nTester; + nTester myntester; - status += myntester.test_all(); + status += myntester.test_all(); #if defined(ACE_HAS_WCHAR) && !defined(TAO_LACKS_WCHAR_CXX_STDLIB) - typedef TAO::bounded_basic_string_sequence<CORBA::WChar, MAXIMUM> w_sequence; - typedef Tester<w_sequence> wTester; - wTester mywtester; - status += mywtester.test_all(); + typedef TAO::bounded_basic_string_sequence<CORBA::WChar, MAXIMUM> w_sequence; + typedef Tester<w_sequence> wTester; + wTester mywtester; + status += mywtester.test_all(); #endif + } + catch (const ::CORBA::Exception &ex) + { + ex._tao_print_exception("ERROR : unexpected CORBA exception caugth :"); + ++status; + } return status; } diff --git a/tests/Sequence_Unit_Tests/bounded_value_sequence_ut.cpp b/tests/Sequence_Unit_Tests/bounded_value_sequence_ut.cpp index 1a34645b8a6..3b4d259655c 100644 --- a/tests/Sequence_Unit_Tests/bounded_value_sequence_ut.cpp +++ b/tests/Sequence_Unit_Tests/bounded_value_sequence_ut.cpp @@ -316,16 +316,24 @@ struct Tester int ACE_TMAIN(int,ACE_TCHAR*[]) { int status = 0; - { - Tester tester; - status += tester.test_all (); - } - - { - typedef value_sequence_tester<tested_sequence,tested_allocation_traits> common; - common tester; - status += tester.test_all (); - } + try + { + { + Tester tester; + status += tester.test_all (); + } + + { + typedef value_sequence_tester<tested_sequence,tested_allocation_traits> common; + common tester; + status += tester.test_all (); + } + } + catch (const ::CORBA::Exception &ex) + { + ex._tao_print_exception("ERROR : unexpected CORBA exception caugth :"); + ++status; + } return status; } diff --git a/tests/Sequence_Unit_Tests/object_reference_sequence_element_ut.cpp b/tests/Sequence_Unit_Tests/object_reference_sequence_element_ut.cpp index 6115f4e13b9..f992a8a5ec1 100644 --- a/tests/Sequence_Unit_Tests/object_reference_sequence_element_ut.cpp +++ b/tests/Sequence_Unit_Tests/object_reference_sequence_element_ut.cpp @@ -10,7 +10,10 @@ */ #include "testing_object_reference_traits.hpp" #include "mock_reference.hpp" + #include "tao/Object_Reference_Sequence_Element_T.h" +#include "tao/SystemException.h" + #include "test_macros.h" using namespace TAO_VERSIONED_NAMESPACE_NAME::TAO::details; @@ -286,14 +289,21 @@ using namespace TAO_VERSIONED_NAMESPACE_NAME::TAO::details; int ACE_TMAIN(int,ACE_TCHAR*[]) { int status = 0; - - status += test_assignment_from_var_release_true (); - status += test_assignment_from_var_release_false (); - status += test_assignment_from_var_throw (); - status += test_assignment_from_element_release_true (); - status += test_assignment_from_element_release_false (); - status += test_assignment_from_reference_release_true (); - status += test_assignment_from_reference_release_false (); + try + { + status += test_assignment_from_var_release_true (); + status += test_assignment_from_var_release_false (); + status += test_assignment_from_var_throw (); + status += test_assignment_from_element_release_true (); + status += test_assignment_from_element_release_false (); + status += test_assignment_from_reference_release_true (); + status += test_assignment_from_reference_release_false (); + } + catch (const ::CORBA::Exception &ex) + { + ex._tao_print_exception("ERROR : unexpected CORBA exception caugth :"); + ++status; + } return status; } diff --git a/tests/Sequence_Unit_Tests/string_sequence_element_ut.cpp b/tests/Sequence_Unit_Tests/string_sequence_element_ut.cpp index 0512cc36b51..7c4038736fa 100644 --- a/tests/Sequence_Unit_Tests/string_sequence_element_ut.cpp +++ b/tests/Sequence_Unit_Tests/string_sequence_element_ut.cpp @@ -12,6 +12,7 @@ #include "tao/String_Sequence_Element_T.h" #include "tao/String_Manager_T.h" #include "tao/CORBA_String.h" +#include "tao/SystemException.h" #include "ace/OS_NS_string.h" @@ -398,12 +399,22 @@ struct Tester }; int ACE_TMAIN (int, ACE_TCHAR*[]) - { - int status = 0; - Tester <char> char_tester; - status += char_tester.test_all (); - Tester <char> wchar_tester; - status += wchar_tester.test_all (); - return status; - } +{ + int status = 0; + + try + { + Tester <char> char_tester; + status += char_tester.test_all (); + Tester <char> wchar_tester; + status += wchar_tester.test_all (); + } + catch (const ::CORBA::Exception& ex) + { + ex._tao_print_exception("ERROR : unexpected CORBA exception caugth :"); + ++status; + } + + return status; +} diff --git a/tests/Sequence_Unit_Tests/testing_allocation_traits_ut.cpp b/tests/Sequence_Unit_Tests/testing_allocation_traits_ut.cpp index ae7445e53b4..5f56487eae9 100644 --- a/tests/Sequence_Unit_Tests/testing_allocation_traits_ut.cpp +++ b/tests/Sequence_Unit_Tests/testing_allocation_traits_ut.cpp @@ -10,6 +10,8 @@ #include "testing_allocation_traits.hpp" #include "test_macros.h" +#include "tao/SystemException.h" + #define CHECK_NO_THROW(statement) \ try { statement; } catch(...) { \ return 1; } @@ -152,20 +154,29 @@ struct Foo { int y; }; int ACE_TMAIN(int,ACE_TCHAR*[]) { int status = 0; - { - Tester<int> tester; - status += tester.test_all (); - } - - { - Tester<Foo> tester; - status += tester.test_all (); - } - { - Tester<char*> tester; - status += tester.test_all (); - } + try + { + { + Tester<int> tester; + status += tester.test_all (); + } + + { + Tester<Foo> tester; + status += tester.test_all (); + } + + { + Tester<char*> tester; + status += tester.test_all (); + } + } + catch (const ::CORBA::Exception &ex) + { + ex._tao_print_exception("ERROR : unexpected CORBA exception caugth :"); + ++status; + } return status; } diff --git a/tests/Sequence_Unit_Tests/unbounded_object_reference_sequence_ut.cpp b/tests/Sequence_Unit_Tests/unbounded_object_reference_sequence_ut.cpp index eee6e01f5e3..01d60035814 100644 --- a/tests/Sequence_Unit_Tests/unbounded_object_reference_sequence_ut.cpp +++ b/tests/Sequence_Unit_Tests/unbounded_object_reference_sequence_ut.cpp @@ -491,10 +491,18 @@ struct Tester int ACE_TMAIN(int,ACE_TCHAR*[]) { int status = 0; - { - Tester tester; - status += tester.test_all(); - } + try + { + { + Tester tester; + status += tester.test_all(); + } + } + catch (const ::CORBA::Exception &ex) + { + ex._tao_print_exception("ERROR : unexpected CORBA exception caugth :"); + ++status; + } return status; } diff --git a/tests/Sequence_Unit_Tests/unbounded_octet_sequence_nocopy_ut.cpp b/tests/Sequence_Unit_Tests/unbounded_octet_sequence_nocopy_ut.cpp index 0bc62b60efa..808569938ed 100644 --- a/tests/Sequence_Unit_Tests/unbounded_octet_sequence_nocopy_ut.cpp +++ b/tests/Sequence_Unit_Tests/unbounded_octet_sequence_nocopy_ut.cpp @@ -440,16 +440,24 @@ struct Tester int ACE_TMAIN(int,ACE_TCHAR*[]) { int status = 0; - { - Tester tester; - status += tester.test_all(); - } - - { - typedef value_sequence_tester<tested_sequence,tested_allocation_traits> common; - common tester; - status += tester.test_all (); - } + try + { + { + Tester tester; + status += tester.test_all(); + } + + { + typedef value_sequence_tester<tested_sequence,tested_allocation_traits> common; + common tester; + status += tester.test_all (); + } + } + catch (const ::CORBA::Exception &ex) + { + ex._tao_print_exception("ERROR : unexpected CORBA exception caugth :"); + ++status; + } return status; } diff --git a/tests/Sequence_Unit_Tests/unbounded_octet_sequence_ut.cpp b/tests/Sequence_Unit_Tests/unbounded_octet_sequence_ut.cpp index 20146e92b2e..b778df88b83 100644 --- a/tests/Sequence_Unit_Tests/unbounded_octet_sequence_ut.cpp +++ b/tests/Sequence_Unit_Tests/unbounded_octet_sequence_ut.cpp @@ -397,16 +397,24 @@ struct Tester int ACE_TMAIN(int,ACE_TCHAR*[]) { int status = 0; - { - Tester tester; - status += tester.test_all (); - } - - { - typedef value_sequence_tester<tested_sequence,tested_allocation_traits> common; - common tester; - status += tester.test_all (); - } + try + { + { + Tester tester; + status += tester.test_all (); + } + + { + typedef value_sequence_tester<tested_sequence,tested_allocation_traits> common; + common tester; + status += tester.test_all (); + } + } + catch (const ::CORBA::Exception &ex) + { + ex._tao_print_exception("ERROR : unexpected CORBA exception caugth :"); + ++status; + } return status; } diff --git a/tests/Sequence_Unit_Tests/unbounded_sequence_cdr_ut.cpp b/tests/Sequence_Unit_Tests/unbounded_sequence_cdr_ut.cpp index 6d320b5254d..3219402045f 100644 --- a/tests/Sequence_Unit_Tests/unbounded_sequence_cdr_ut.cpp +++ b/tests/Sequence_Unit_Tests/unbounded_sequence_cdr_ut.cpp @@ -95,8 +95,16 @@ struct Tester int ACE_TMAIN(int,ACE_TCHAR*[]) { int status = 0; - Tester x; - status += x.test_stream (); + try + { + Tester x; + status += x.test_stream (); + } + catch (const ::CORBA::Exception &ex) + { + ex._tao_print_exception("ERROR : unexpected CORBA exception caugth :"); + ++status; + } return status; } diff --git a/tests/Sequence_Unit_Tests/unbounded_string_sequence_ut.cpp b/tests/Sequence_Unit_Tests/unbounded_string_sequence_ut.cpp index 8b540d78d2a..505ba4503d9 100644 --- a/tests/Sequence_Unit_Tests/unbounded_string_sequence_ut.cpp +++ b/tests/Sequence_Unit_Tests/unbounded_string_sequence_ut.cpp @@ -511,19 +511,27 @@ struct Tester int ACE_TMAIN(int,ACE_TCHAR*[]) { int status = 0; - { - typedef Tester<unbounded_basic_string_sequence <char> > nTester; - nTester ntester; - status += ntester.test_all (); - } + try + { + { + typedef Tester<unbounded_basic_string_sequence <char> > nTester; + nTester ntester; + status += ntester.test_all (); + } #if defined(ACE_HAS_WCHAR) && !defined(TAO_LACKS_WCHAR_CXX_STDLIB) - { - typedef Tester<unbounded_basic_string_sequence <CORBA::WChar> > wTester; - wTester wtester; - status += wtester.test_all (); - } + { + typedef Tester<unbounded_basic_string_sequence <CORBA::WChar> > wTester; + wTester wtester; + status += wtester.test_all (); + } #endif + } + catch (const ::CORBA::Exception &ex) + { + ex._tao_print_exception("ERROR : unexpected CORBA exception caugth :"); + ++status; + } return status; } diff --git a/tests/Sequence_Unit_Tests/unbounded_value_sequence_ut.cpp b/tests/Sequence_Unit_Tests/unbounded_value_sequence_ut.cpp index 8edf040fb69..9d7ecc5f841 100644 --- a/tests/Sequence_Unit_Tests/unbounded_value_sequence_ut.cpp +++ b/tests/Sequence_Unit_Tests/unbounded_value_sequence_ut.cpp @@ -418,12 +418,20 @@ struct Tester int ACE_TMAIN(int,ACE_TCHAR*[]) { int status = 0; - Tester tester; - status += tester.test_all (); + try + { + Tester tester; + status += tester.test_all (); - typedef value_sequence_tester<tested_sequence,tested_allocation_traits> common; - common tester2; - status += tester2.test_all (); + typedef value_sequence_tester<tested_sequence,tested_allocation_traits> common; + common tester2; + status += tester2.test_all (); + } + catch (const ::CORBA::Exception &ex) + { + ex._tao_print_exception("ERROR : unexpected CORBA exception caugth :"); + ++status; + } return status; } diff --git a/tests/Smart_Proxies/Collocation/Smart_Proxy_Impl.h b/tests/Smart_Proxies/Collocation/Smart_Proxy_Impl.h index 6e4d005d9e5..6149b7f5dd4 100644 --- a/tests/Smart_Proxies/Collocation/Smart_Proxy_Impl.h +++ b/tests/Smart_Proxies/Collocation/Smart_Proxy_Impl.h @@ -24,8 +24,7 @@ class MY_Stub_Export Smart_Diamond_Top_Proxy : public virtual Diamond::TAO_Diamo Smart_Diamond_Top_Proxy (Diamond::Top_ptr proxy); - virtual char * shape () -; + virtual char * shape (); // Smartify the method call! // Dont need to add any extra functionality into shutdown() |