summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2012-03-23 00:15:19 +0000
committerJohnny Willemsen <jwillemsen@remedy.nl>2012-03-23 00:15:19 +0000
commit632fc30f7bfcab58578942ddac885234d2ab0986 (patch)
tree9c67ad51d73d19fa3afd7eb93e7261226b4c5d47
parent6d1019c5aa939a4ce16c8a7ae3ae45879f416260 (diff)
downloadATCD-632fc30f7bfcab58578942ddac885234d2ab0986.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
-rw-r--r--TAO/ChangeLog11
-rw-r--r--TAO/tests/Bug_1476_Regression/server.cpp1
-rw-r--r--TAO/tests/Bug_2234_Regression/server.cpp10
-rw-r--r--TAO/tests/Bug_3470_Regression/test.cpp20
-rw-r--r--TAO/tests/NestedUpcall/Triangle_Test/initiator.cpp4
-rw-r--r--TAO/tests/POA/Forwarding/server.cpp19
-rw-r--r--TAO/tests/Portable_Interceptors/AdvSlotExt/server.cpp82
-rw-r--r--TAO/tests/Portable_Interceptors/Bug_2510_Regression/Server_ORBInitializer.cpp9
8 files changed, 95 insertions, 61 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog
index e2433c33ffb..c987af17b08 100644
--- a/TAO/ChangeLog
+++ b/TAO/ChangeLog
@@ -1,3 +1,14 @@
+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
+
Thu Mar 22 17:05:00 UTC 2012 Simon Massey <simon dot massey at prismtech dot com>
* tao/ZIOP/ZIOP.cpp:
diff --git a/TAO/tests/Bug_1476_Regression/server.cpp b/TAO/tests/Bug_1476_Regression/server.cpp
index 0b24119f46e..a62738e692f 100644
--- a/TAO/tests/Bug_1476_Regression/server.cpp
+++ b/TAO/tests/Bug_1476_Regression/server.cpp
@@ -22,6 +22,7 @@ parse_args (int argc, ACE_TCHAR *argv[])
break;
case 'n' :
number_of_oneways = ACE_OS::atoi (get_opts.opt_arg ());
+ break;
case '?':
default:
ACE_ERROR_RETURN ((LM_ERROR,
diff --git a/TAO/tests/Bug_2234_Regression/server.cpp b/TAO/tests/Bug_2234_Regression/server.cpp
index 3261825bb3a..fe3be5b95db 100644
--- a/TAO/tests/Bug_2234_Regression/server.cpp
+++ b/TAO/tests/Bug_2234_Regression/server.cpp
@@ -117,11 +117,6 @@ public:
ACE_DEBUG( (LM_INFO, "* Incorrect input value of parameter a\n") );
throw CORBA::BAD_PARAM(0, CORBA::COMPLETED_NO);
}
- if (1 != ACE_OS::strlen( c ))
- {
- ACE_DEBUG( (LM_INFO, "* Incorrect string length for parameter c\n") );
- throw CORBA::BAD_PARAM(0, CORBA::COMPLETED_NO);
- }
if (0 == c)
{
//FUZZ: disable check_for_NULL
@@ -129,6 +124,11 @@ public:
//FUZZ: enable check_for_NULL
throw CORBA::BAD_PARAM(0, CORBA::COMPLETED_NO);
}
+ if (1 != ACE_OS::strlen( c ))
+ {
+ ACE_DEBUG( (LM_INFO, "* Incorrect string length for parameter c\n") );
+ throw CORBA::BAD_PARAM(0, CORBA::COMPLETED_NO);
+ }
if ('3' != *c)
{
ACE_DEBUG( (LM_INFO, "* Incorrect input value of parameter c\n") );
diff --git a/TAO/tests/Bug_3470_Regression/test.cpp b/TAO/tests/Bug_3470_Regression/test.cpp
index 277132ccd01..738f6902f92 100644
--- a/TAO/tests/Bug_3470_Regression/test.cpp
+++ b/TAO/tests/Bug_3470_Regression/test.cpp
@@ -15,14 +15,22 @@ int ACE_TMAIN( int argc, ACE_TCHAR * argv[] )
{
int retcode = 1;
- CORBA::ORB_var orb = CORBA::ORB_init (argc, argv);
+ try
+ {
+ CORBA::ORB_var orb = CORBA::ORB_init (argc, argv);
- CORBA::ORB_ObjectIdList_var listsrv = orb->list_initial_services();
- for (CORBA::ULong index = 0 ; index < listsrv->length() ; index++ )
- if ( ACE_OS::strcmp(listsrv[index],"MyObjectId") == 0)
- retcode = 0;
+ CORBA::ORB_ObjectIdList_var listsrv = orb->list_initial_services();
+ for (CORBA::ULong index = 0 ; index < listsrv->length() ; index++ )
+ if ( ACE_OS::strcmp(listsrv[index],"MyObjectId") == 0)
+ retcode = 0;
- orb->destroy();
+ orb->destroy();
+ }
+ catch (const CORBA::Exception& ex)
+ {
+ ex._tao_print_exception ("Exception caught:");
+ return 1;
+ }
return retcode;
}
diff --git a/TAO/tests/NestedUpcall/Triangle_Test/initiator.cpp b/TAO/tests/NestedUpcall/Triangle_Test/initiator.cpp
index 3b7500c822c..4b21af5487e 100644
--- a/TAO/tests/NestedUpcall/Triangle_Test/initiator.cpp
+++ b/TAO/tests/NestedUpcall/Triangle_Test/initiator.cpp
@@ -25,7 +25,9 @@ Initiator_Server::Initiator_Server (void)
object_B_key_ (0),
object_A_var_ (0),
object_B_var_ (0),
- initiator_i_ptr_ (0)
+ initiator_i_ptr_ (0),
+ argc_ (0),
+ argv_ (0)
{
}
diff --git a/TAO/tests/POA/Forwarding/server.cpp b/TAO/tests/POA/Forwarding/server.cpp
index b73de679875..09a0867f073 100644
--- a/TAO/tests/POA/Forwarding/server.cpp
+++ b/TAO/tests/POA/Forwarding/server.cpp
@@ -141,13 +141,18 @@ create_servant_manager (CORBA::ORB_ptr orb,
FILE *output_file = ACE_OS::fopen (ior_output_file, "w");
if (output_file == 0)
- ACE_ERROR ((LM_ERROR,
- "Cannot open output file for writing IOR: %s\n",
- ior_output_file));
- ACE_OS::fprintf (output_file,
- "%s",
- ior.in ());
- ACE_OS::fclose (output_file);
+ {
+ ACE_ERROR ((LM_ERROR,
+ "Cannot open output file for writing IOR: %s\n",
+ ior_output_file));
+ }
+ else
+ {
+ ACE_OS::fprintf (output_file,
+ "%s",
+ ior.in ());
+ ACE_OS::fclose (output_file);
+ }
return activator;
}
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 ();