summaryrefslogtreecommitdiff
path: root/TAO/tests/ORB_Local_Config/Bug_2612
diff options
context:
space:
mode:
authorsma <sma@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2008-07-10 13:45:29 +0000
committersma <sma@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2008-07-10 13:45:29 +0000
commit132e9d1a878961a1aa7c925c4f603c49b9194558 (patch)
tree85b755a718aa52175d5c8759fe91c9844e281294 /TAO/tests/ORB_Local_Config/Bug_2612
parent6f58d8d589c277475958ff65be9eb16fb7c85344 (diff)
downloadATCD-132e9d1a878961a1aa7c925c4f603c49b9194558.tar.gz
ChangeLogTag: Thu Jul 10 13:45:00 UTC 2008 Simon Massey <sma at prismtech dot com>
Diffstat (limited to 'TAO/tests/ORB_Local_Config/Bug_2612')
-rw-r--r--TAO/tests/ORB_Local_Config/Bug_2612/DllOrb.cpp48
-rw-r--r--TAO/tests/ORB_Local_Config/Bug_2612/DllOrb.h4
-rw-r--r--TAO/tests/ORB_Local_Config/Bug_2612/Test.cpp17
3 files changed, 31 insertions, 38 deletions
diff --git a/TAO/tests/ORB_Local_Config/Bug_2612/DllOrb.cpp b/TAO/tests/ORB_Local_Config/Bug_2612/DllOrb.cpp
index 38ff10c29a5..4cc5c75714d 100644
--- a/TAO/tests/ORB_Local_Config/Bug_2612/DllOrb.cpp
+++ b/TAO/tests/ORB_Local_Config/Bug_2612/DllOrb.cpp
@@ -5,7 +5,6 @@
* $Id$
*/
-
#include "ace/Arg_Shifter.h"
#include "ace/SString.h"
#include "ace/OS_NS_unistd.h"
@@ -15,7 +14,6 @@
#include "DllOrb.h"
-
DllOrb::DllOrb (int nthreads)
:
m_nthreads_ (nthreads),
@@ -36,27 +34,26 @@ DllOrb::~DllOrb ( )
#endif
}
-
-int DllOrb::init (int argc, char *argv[])
+int DllOrb::init (int argc, ACE_TCHAR *argv[])
{
int result = 0;
int threadCnt = this->m_nthreads_;
try
{
- ACE_Arg_Shifter as(argc, argv);
+ ACE_Arg_Shifter as (argc, argv);
const ACE_TCHAR *currentArg = 0;
- while(as.is_anything_left())
+ while (as.is_anything_left ())
{
- if(0 != (currentArg = as.get_the_parameter("-t")))
+ if (0 != (currentArg = as.get_the_parameter (ACE_TEXT ("-t"))))
{
- int num = ACE_OS::atoi(currentArg);
- if(num >= 1)
+ int num = ACE_OS::atoi (currentArg);
+ if (num >= 1)
threadCnt = num;
- as.consume_arg();
+ as.consume_arg ();
}
else
- as.ignore_arg();
+ as.ignore_arg ();
}
if (m_failPrePostInit < 3)
@@ -75,36 +72,36 @@ int DllOrb::init (int argc, char *argv[])
// module and destroyed by this object when it is dynamically
// unloaded.
int register_with_object_manager = 0;
- TAO_Singleton_Manager * p_tsm = TAO_Singleton_Manager::instance();
- result = p_tsm->init(register_with_object_manager);
+ TAO_Singleton_Manager * p_tsm = TAO_Singleton_Manager::instance ();
+ result = p_tsm->init (register_with_object_manager);
if (result == -1 && m_failPrePostInit == 0)
return -1;
}
// Initialize the ORB
- mv_orb = CORBA::ORB_init(argc, argv);
- if (CORBA::is_nil(mv_orb.in()))
+ mv_orb = CORBA::ORB_init (argc, argv);
+ if (CORBA::is_nil (mv_orb.in ()))
return -1;
- CORBA::Object_var v_poa = mv_orb->resolve_initial_references("RootPOA");
+ CORBA::Object_var v_poa = mv_orb->resolve_initial_references ("RootPOA");
- mv_rootPOA = PortableServer::POA::_narrow(v_poa.in ());
- if (CORBA::is_nil(mv_rootPOA.in()))
+ mv_rootPOA = PortableServer::POA::_narrow (v_poa.in ());
+ if (CORBA::is_nil (mv_rootPOA.in ()))
return -1;
- mv_poaManager = mv_rootPOA->the_POAManager();
- if (CORBA::is_nil(mv_poaManager.in()))
+ mv_poaManager = mv_rootPOA->the_POAManager ();
+ if (CORBA::is_nil (mv_poaManager.in ()))
return -1;
- mv_poaManager->activate();
+ mv_poaManager->activate ();
}
catch(CORBA::Exception& ex)
{
ex._tao_print_exception (ACE_TEXT ("(%P|%t) init failed:"));
return -1;
}
- catch(...)
+ catch (...)
{
ACE_ERROR_RETURN ((LM_ERROR,
ACE_TEXT ("(%P|%t) init failed\n")),
@@ -112,19 +109,18 @@ int DllOrb::init (int argc, char *argv[])
}
#if defined (ACE_HAS_THREADS)
- mp_barrier = new ACE_Thread_Barrier(threadCnt + 1);
+ mp_barrier = new ACE_Thread_Barrier (threadCnt + 1);
this->activate(
THR_NEW_LWP|THR_JOINABLE|THR_INHERIT_SCHED,
threadCnt
);
- mp_barrier->wait();
+ mp_barrier->wait ();
#endif
return 0;
}
-
int DllOrb::fini (void)
{
int result;
@@ -196,7 +192,6 @@ int DllOrb::fini (void)
return 0;
}
-
int DllOrb::svc (void)
{
#if defined (ACE_HAS_THREADS)
@@ -230,5 +225,4 @@ int DllOrb::svc (void)
return 0;
}
-
ACE_FACTORY_DEFINE (DllOrb, DllOrb)
diff --git a/TAO/tests/ORB_Local_Config/Bug_2612/DllOrb.h b/TAO/tests/ORB_Local_Config/Bug_2612/DllOrb.h
index 9832228d6e4..b87a9560f78 100644
--- a/TAO/tests/ORB_Local_Config/Bug_2612/DllOrb.h
+++ b/TAO/tests/ORB_Local_Config/Bug_2612/DllOrb.h
@@ -32,7 +32,7 @@ class DllOrb_Export DllOrb
CORBA::ORB_ptr orb (void) const;
- virtual int init (int argc, char *argv[]);
+ virtual int init (int argc, ACE_TCHAR *argv[]);
virtual int fini (void);
@@ -54,8 +54,6 @@ class DllOrb_Export DllOrb
PortableServer::POAManager_var mv_poaManager;
}; /* end of DllOrb */
-
ACE_FACTORY_DECLARE (DllOrb, DllOrb)
-
#endif /* DllOrb_h */
diff --git a/TAO/tests/ORB_Local_Config/Bug_2612/Test.cpp b/TAO/tests/ORB_Local_Config/Bug_2612/Test.cpp
index cdedf8ff190..33d4a2af1ca 100644
--- a/TAO/tests/ORB_Local_Config/Bug_2612/Test.cpp
+++ b/TAO/tests/ORB_Local_Config/Bug_2612/Test.cpp
@@ -9,37 +9,38 @@
#include "ace/Service_Config.h"
#include "tao/corba.h"
-char const * const scpc_loadOrb =
+ACE_TCHAR const * const scpc_loadOrb = // NOTE due to the way ACE_DYNAMIC_SERVICE_DIRECTIVE() macro is defined,
+ // each parameter CANNOT be split into multiple quoted strings "line1" "nextline" with the expectation that
+ // they will be join together. Hence the long parameter 4.
ACE_DYNAMIC_SERVICE_DIRECTIVE ("testDllOrb",
"DllOrb",
"_make_DllOrb",
- "DllOrb -t 1 -ORBGestalt Local -ORBDebugLevel 3 -ORBId testORB -ORBInitRef "
- "NameService=file:///tmp/test-ns.ior -ORBDottedDecimalAddresses 1"
+"DllOrb -t 1 -ORBGestalt Local -ORBDebugLevel 3 -ORBId testORB -ORBInitRef NameService=file:///tmp/test-ns.ior -ORBDottedDecimalAddresses 1"
);
-char const * const scpc_unloadOrb = ACE_REMOVE_SERVICE_DIRECTIVE ("testDllOrb");
+ACE_TCHAR const * const scpc_unloadOrb = ACE_REMOVE_SERVICE_DIRECTIVE ("testDllOrb");
int ACE_TMAIN (int, ACE_TCHAR *[])
{
ACE_DEBUG ((LM_DEBUG,"\nbefore first load process directive\n"));
- if (0 > ACE_Service_Config::process_directive(scpc_loadOrb))
+ if (0 > ACE_Service_Config::process_directive (scpc_loadOrb))
return -1;
ACE_OS::sleep(2);
ACE_DEBUG ((LM_DEBUG,"\nbefore first unload process directive\n"));
- if (0 > ACE_Service_Config::process_directive(scpc_unloadOrb))
+ if (0 > ACE_Service_Config::process_directive (scpc_unloadOrb))
return -1;
ACE_OS::sleep(2);
ACE_DEBUG ((LM_DEBUG, "\nMAIN (%P|%t) Lather, Rince, Repeat ...\n"));
- if (0 > ACE_Service_Config::process_directive(scpc_loadOrb))
+ if (0 > ACE_Service_Config::process_directive (scpc_loadOrb))
return -1;
ACE_OS::sleep(2);
- if (0 > ACE_Service_Config::process_directive(scpc_unloadOrb))
+ if (0 > ACE_Service_Config::process_directive (scpc_unloadOrb))
return -1;
return 0;