diff options
author | Johnny Willemsen <jwillemsen@remedy.nl> | 2014-08-17 18:50:47 +0000 |
---|---|---|
committer | Johnny Willemsen <jwillemsen@remedy.nl> | 2014-08-17 18:50:47 +0000 |
commit | 4abbc21c92c97476d44e513386113e10cc7dd4d0 (patch) | |
tree | 81a04d79030da91ce14897df947c9c9815e617ac /TAO/tests/Smart_Proxies | |
parent | d196265cdae55e994775bd5eb55e623a8b28c9b8 (diff) | |
download | ATCD-4abbc21c92c97476d44e513386113e10cc7dd4d0.tar.gz |
Sun Aug 17 18:52:48 UTC 2014 Johnny Willemsen <jwillemsen@remedy.nl>
* orbsvcs/orbsvcs/ESF/ESF_Delayed_Command.cpp:
Removed if statements, the regular and else clause had the
exact same code, reported by Coverity
* tests/Smart_Proxies/Benchmark/client.cpp:
* tests/Smart_Proxies/Benchmark/server.cpp:
* tests/Smart_Proxies/Collocation/Smart_Proxy_Impl.h:
* tests/Smart_Proxies/Collocation/Smart_Proxy_Impl.cpp:
* tests/Smart_Proxies/On_Demand/client.cpp:
* tests/Smart_Proxies/On_Demand/server.cpp:
* tests/Smart_Proxies/Policy/Smart_Proxy_Impl.cpp:
* tests/Smart_Proxies/Policy/client.cpp:
* tests/Smart_Proxies/Policy/server.cpp:
* tests/Smart_Proxies/Smart_Proxy_Impl.h:
* tests/Smart_Proxies/client.cpp:
* tests/Smart_Proxies/server.cpp:
Fixed Coverity and valgrind reported errors
Diffstat (limited to 'TAO/tests/Smart_Proxies')
-rw-r--r-- | TAO/tests/Smart_Proxies/Benchmark/client.cpp | 3 | ||||
-rw-r--r-- | TAO/tests/Smart_Proxies/Benchmark/server.cpp | 7 | ||||
-rw-r--r-- | TAO/tests/Smart_Proxies/Collocation/Smart_Proxy_Impl.cpp | 9 | ||||
-rw-r--r-- | TAO/tests/Smart_Proxies/Collocation/Smart_Proxy_Impl.h | 6 | ||||
-rw-r--r-- | TAO/tests/Smart_Proxies/On_Demand/client.cpp | 4 | ||||
-rw-r--r-- | TAO/tests/Smart_Proxies/On_Demand/server.cpp | 7 | ||||
-rw-r--r-- | TAO/tests/Smart_Proxies/Policy/Smart_Proxy_Impl.cpp | 2 | ||||
-rw-r--r-- | TAO/tests/Smart_Proxies/Policy/client.cpp | 5 | ||||
-rw-r--r-- | TAO/tests/Smart_Proxies/Policy/server.cpp | 12 | ||||
-rw-r--r-- | TAO/tests/Smart_Proxies/Smart_Proxy_Impl.h | 1 | ||||
-rw-r--r-- | TAO/tests/Smart_Proxies/client.cpp | 7 | ||||
-rw-r--r-- | TAO/tests/Smart_Proxies/server.cpp | 2 |
12 files changed, 29 insertions, 36 deletions
diff --git a/TAO/tests/Smart_Proxies/Benchmark/client.cpp b/TAO/tests/Smart_Proxies/Benchmark/client.cpp index 13e2f32d419..fbc3ea0c10f 100644 --- a/TAO/tests/Smart_Proxies/Benchmark/client.cpp +++ b/TAO/tests/Smart_Proxies/Benchmark/client.cpp @@ -67,7 +67,7 @@ parse_args (int argc, ACE_TCHAR *argv[]) switch (c) { case 'i': - ior = ACE_OS::strdup (get_opts.opt_arg ()); + ior = get_opts.opt_arg (); break; case 'n': niterations = ACE_OS::atoi (get_opts.opt_arg ()); @@ -232,6 +232,7 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) server1->shutdown (); */ + orb->destroy (); } catch (const CORBA::Exception& ex) { diff --git a/TAO/tests/Smart_Proxies/Benchmark/server.cpp b/TAO/tests/Smart_Proxies/Benchmark/server.cpp index e1d7bede99d..ac85e5a3806 100644 --- a/TAO/tests/Smart_Proxies/Benchmark/server.cpp +++ b/TAO/tests/Smart_Proxies/Benchmark/server.cpp @@ -72,7 +72,7 @@ parse_args (int argc, ACE_TCHAR *argv[]) switch (c) { case 'o': - ior_output_file = ACE_OS::strdup (get_opts.opt_arg ()); + ior_output_file = get_opts.opt_arg (); break; case '?': default: @@ -147,8 +147,9 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) ACE_DEBUG ((LM_DEBUG, "event loop finished\n")); - root_poa->destroy (1, - 1); + root_poa->destroy (true, true); + + orb->destroy (); } catch (const CORBA::Exception& ex) { diff --git a/TAO/tests/Smart_Proxies/Collocation/Smart_Proxy_Impl.cpp b/TAO/tests/Smart_Proxies/Collocation/Smart_Proxy_Impl.cpp index 65bb3c88526..fc629e39647 100644 --- a/TAO/tests/Smart_Proxies/Collocation/Smart_Proxy_Impl.cpp +++ b/TAO/tests/Smart_Proxies/Collocation/Smart_Proxy_Impl.cpp @@ -36,13 +36,10 @@ Smart_Diamond_Top_Proxy::shape () char *ans= 0; try { - ans = - ACE_OS::strdup ( - Diamond::TAO_Diamond_Top_Smart_Proxy_Base::shape ( - ) - ); + ans = ACE_OS::strdup ( + Diamond::TAO_Diamond_Top_Smart_Proxy_Base::shape ()); - ACE_DEBUG ((LM_DEBUG, "%s\n", ans)); + ACE_DEBUG ((LM_DEBUG, "%C\n", ans)); } catch (const CORBA::Exception& ex) { diff --git a/TAO/tests/Smart_Proxies/Collocation/Smart_Proxy_Impl.h b/TAO/tests/Smart_Proxies/Collocation/Smart_Proxy_Impl.h index 6149b7f5dd4..539b46165a7 100644 --- a/TAO/tests/Smart_Proxies/Collocation/Smart_Proxy_Impl.h +++ b/TAO/tests/Smart_Proxies/Collocation/Smart_Proxy_Impl.h @@ -8,8 +8,7 @@ class MY_Stub_Export Smart_Diamond_Top_Factory : public virtual Diamond::TAO_Diamond_Top_Default_Proxy_Factory { - public: - +public: Smart_Diamond_Top_Factory (void); virtual Diamond::Top_ptr create_proxy (Diamond::Top_ptr proxy); @@ -20,8 +19,7 @@ class MY_Stub_Export Smart_Diamond_Top_Factory : public virtual Diamond::TAO_Dia class MY_Stub_Export Smart_Diamond_Top_Proxy : public virtual Diamond::TAO_Diamond_Top_Smart_Proxy_Base { - public: - +public: Smart_Diamond_Top_Proxy (Diamond::Top_ptr proxy); virtual char * shape (); diff --git a/TAO/tests/Smart_Proxies/On_Demand/client.cpp b/TAO/tests/Smart_Proxies/On_Demand/client.cpp index 13cd632d504..c485746550e 100644 --- a/TAO/tests/Smart_Proxies/On_Demand/client.cpp +++ b/TAO/tests/Smart_Proxies/On_Demand/client.cpp @@ -30,7 +30,7 @@ parse_args (int argc, ACE_TCHAR *argv[]) switch (c) { case 'i': - ior = ACE_OS::strdup (get_opts.opt_arg ()); + ior = get_opts.opt_arg (); break; case '?': default: @@ -44,7 +44,6 @@ parse_args (int argc, ACE_TCHAR *argv[]) return 0; } - int ACE_TMAIN(int argc, ACE_TCHAR *argv[]) { @@ -76,6 +75,7 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) server->shutdown (); + orb->destroy (); } catch (const CORBA::Exception& ex) { diff --git a/TAO/tests/Smart_Proxies/On_Demand/server.cpp b/TAO/tests/Smart_Proxies/On_Demand/server.cpp index 1da423a2ca8..b73b57a4418 100644 --- a/TAO/tests/Smart_Proxies/On_Demand/server.cpp +++ b/TAO/tests/Smart_Proxies/On_Demand/server.cpp @@ -69,7 +69,7 @@ parse_args (int argc, ACE_TCHAR *argv[]) switch (c) { case 'o': - ior_output_file = ACE_OS::strdup (get_opts.opt_arg ()); + ior_output_file = get_opts.opt_arg (); break; case '?': default: @@ -143,8 +143,9 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) ACE_DEBUG ((LM_DEBUG, "event loop finished\n")); - root_poa->destroy (1, - 1); + root_poa->destroy (true, true); + + orb->destroy (); } catch (const CORBA::Exception& ex) { diff --git a/TAO/tests/Smart_Proxies/Policy/Smart_Proxy_Impl.cpp b/TAO/tests/Smart_Proxies/Policy/Smart_Proxy_Impl.cpp index b71652cae3a..3edc23f2103 100644 --- a/TAO/tests/Smart_Proxies/Policy/Smart_Proxy_Impl.cpp +++ b/TAO/tests/Smart_Proxies/Policy/Smart_Proxy_Impl.cpp @@ -15,7 +15,7 @@ Smart_Test_Factory::create_proxy (Test_ptr proxy) ACE_DEBUG ((LM_DEBUG, "create_smart_proxy\n")); - if (CORBA::is_nil (proxy) == 0) + if (CORBA::is_nil (proxy)) ACE_NEW_RETURN (proxy, Smart_Test_Proxy (proxy), 0); return proxy; diff --git a/TAO/tests/Smart_Proxies/Policy/client.cpp b/TAO/tests/Smart_Proxies/Policy/client.cpp index 18858ee8601..19f8e987186 100644 --- a/TAO/tests/Smart_Proxies/Policy/client.cpp +++ b/TAO/tests/Smart_Proxies/Policy/client.cpp @@ -32,10 +32,10 @@ parse_args (int argc, ACE_TCHAR *argv[]) switch (c) { case 'i': - ior1 = ACE_OS::strdup (get_opts.opt_arg ()); + ior1 = get_opts.opt_arg (); break; case 'j': - ior2 = ACE_OS::strdup (get_opts.opt_arg ()); + ior2 = get_opts.opt_arg (); break; case 'f': one_shot_factory = ACE_OS::atoi (get_opts.opt_arg ()); @@ -122,6 +122,7 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) run_test (orb.in (), 1); run_test (orb.in (), 2); + orb->destroy (); } catch (const CORBA::Exception& ex) { diff --git a/TAO/tests/Smart_Proxies/Policy/server.cpp b/TAO/tests/Smart_Proxies/Policy/server.cpp index 33a19e5aff6..f62fb618bb1 100644 --- a/TAO/tests/Smart_Proxies/Policy/server.cpp +++ b/TAO/tests/Smart_Proxies/Policy/server.cpp @@ -69,7 +69,7 @@ parse_args (int argc, ACE_TCHAR *argv[]) switch (c) { case 'o': - ior_output_file = ACE_OS::strdup (get_opts.opt_arg ()); + ior_output_file = get_opts.opt_arg (); break; case '?': default: @@ -87,11 +87,9 @@ parse_args (int argc, ACE_TCHAR *argv[]) int ACE_TMAIN(int argc, ACE_TCHAR *argv[]) { - try { - CORBA::ORB_var orb = CORBA::ORB_init (argc, - argv); + CORBA::ORB_var orb = CORBA::ORB_init (argc, argv); if (parse_args (argc, argv) != 0) return 1; @@ -104,7 +102,6 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) PortableServer::POA_var root_poa = PortableServer::POA::_narrow (object.in ()); - // Get the POAManager of the RootPOA. PortableServer::POAManager_var poa_manager = root_poa->the_POAManager (); @@ -145,8 +142,9 @@ ACE_TMAIN(int argc, ACE_TCHAR *argv[]) ACE_DEBUG ((LM_DEBUG, "event loop finished\n")); - root_poa->destroy (1, - 1); + root_poa->destroy (true, true); + + orb->destroy (); } catch (const CORBA::Exception& ex) { diff --git a/TAO/tests/Smart_Proxies/Smart_Proxy_Impl.h b/TAO/tests/Smart_Proxies/Smart_Proxy_Impl.h index ed7537777ce..4000212331e 100644 --- a/TAO/tests/Smart_Proxies/Smart_Proxy_Impl.h +++ b/TAO/tests/Smart_Proxies/Smart_Proxy_Impl.h @@ -6,7 +6,6 @@ class Smart_Test_Factory : public virtual TAO_Test_Default_Proxy_Factory { public: - Smart_Test_Factory (void); virtual Test_ptr create_proxy (Test_ptr proxy); diff --git a/TAO/tests/Smart_Proxies/client.cpp b/TAO/tests/Smart_Proxies/client.cpp index 2000a28b4b2..c863a84e851 100644 --- a/TAO/tests/Smart_Proxies/client.cpp +++ b/TAO/tests/Smart_Proxies/client.cpp @@ -31,7 +31,7 @@ parse_args (int argc, ACE_TCHAR *argv[]) switch (c) { case 'i': - ior = ACE_OS::strdup (get_opts.opt_arg ()); + ior = get_opts.opt_arg (); break; case '?': default: @@ -45,16 +45,13 @@ parse_args (int argc, ACE_TCHAR *argv[]) return 0; } - int ACE_TMAIN(int argc, ACE_TCHAR *argv[]) { int status = 0; try { - CORBA::ORB_var orb = - CORBA::ORB_init (argc, - argv); + CORBA::ORB_var orb = CORBA::ORB_init (argc, argv); if (parse_args (argc, argv) != 0) return 1; diff --git a/TAO/tests/Smart_Proxies/server.cpp b/TAO/tests/Smart_Proxies/server.cpp index 45705ad98aa..3a6c5bb26e9 100644 --- a/TAO/tests/Smart_Proxies/server.cpp +++ b/TAO/tests/Smart_Proxies/server.cpp @@ -69,7 +69,7 @@ parse_args (int argc, ACE_TCHAR *argv[]) switch (c) { case 'o': - ior_output_file = ACE_OS::strdup (get_opts.opt_arg ()); + ior_output_file = get_opts.opt_arg (); break; case '?': default: |