diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2012-03-23 00:15:19 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2012-03-23 00:15:19 +0000 |
commit | ab9787b35fd9f96f8b8f23a9677408fcdd44fced (patch) | |
tree | 9c67ad51d73d19fa3afd7eb93e7261226b4c5d47 /TAO/tests/Portable_Interceptors | |
parent | d1038ac3c3218406046d653f960c12ef0dd5bff4 (diff) | |
download | ATCD-ab9787b35fd9f96f8b8f23a9677408fcdd44fced.tar.gz |
Fri Mar 23 00:13:54 UTC 2012 Johnny Willemsen <jwillemsen@remedy.nl>
* tests/Bug_1476_Regression/server.cpp:
* tests/Bug_2234_Regression/server.cpp:
* tests/Bug_3470_Regression/test.cpp:
* tests/NestedUpcall/Triangle_Test/initiator.cpp:
* tests/POA/Forwarding/server.cpp:
* tests/Portable_Interceptors/AdvSlotExt/server.cpp:
* tests/Portable_Interceptors/Bug_2510_Regression/Server_ORBInitializer.cpp:
Fixed coverity errors
Diffstat (limited to 'TAO/tests/Portable_Interceptors')
-rw-r--r-- | TAO/tests/Portable_Interceptors/AdvSlotExt/server.cpp | 82 | ||||
-rw-r--r-- | TAO/tests/Portable_Interceptors/Bug_2510_Regression/Server_ORBInitializer.cpp | 9 |
2 files changed, 49 insertions, 42 deletions
diff --git a/TAO/tests/Portable_Interceptors/AdvSlotExt/server.cpp b/TAO/tests/Portable_Interceptors/AdvSlotExt/server.cpp index adcaa021347..ef06fa78597 100644 --- a/TAO/tests/Portable_Interceptors/AdvSlotExt/server.cpp +++ b/TAO/tests/Portable_Interceptors/AdvSlotExt/server.cpp @@ -219,60 +219,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: %s", - 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: %s", + 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")); + ACE_DEBUG ((LM_DEBUG, "Event loop finished.\n")); + } + catch (const CORBA::Exception& ex) + { + ex._tao_print_exception ("Exception caught:"); + return 1; + } return 0; } diff --git a/TAO/tests/Portable_Interceptors/Bug_2510_Regression/Server_ORBInitializer.cpp b/TAO/tests/Portable_Interceptors/Bug_2510_Regression/Server_ORBInitializer.cpp index 182d056edba..326900d2a38 100644 --- a/TAO/tests/Portable_Interceptors/Bug_2510_Regression/Server_ORBInitializer.cpp +++ b/TAO/tests/Portable_Interceptors/Bug_2510_Regression/Server_ORBInitializer.cpp @@ -4,19 +4,18 @@ #include "Server_ORBInitializer.h" extern PortableInterceptor::SlotId slotId; -Server_ORBInitializer::Server_ORBInitializer (void) +Server_ORBInitializer::Server_ORBInitializer (void) : + server_interceptor_ (0) { } void -Server_ORBInitializer::pre_init ( - PortableInterceptor::ORBInitInfo_ptr) +Server_ORBInitializer::pre_init (PortableInterceptor::ORBInitInfo_ptr) { } void -Server_ORBInitializer::post_init ( - PortableInterceptor::ORBInitInfo_ptr info) +Server_ORBInitializer::post_init (PortableInterceptor::ORBInitInfo_ptr info) { // allocate a slot slotId = info->allocate_slot_id (); |