Salome HOME
Merge branch 'omu/SalomeLauncher'
[modules/kernel.git] / src / NamingService / Test / NamingServiceTest.cxx
index 441f4fff0641227bc3e9433f2d6b60a35186189c..310b0dd6a725684699b07dc07ac4508b15c7faa3 100644 (file)
@@ -1,18 +1,20 @@
-// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-// 
+//
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 // Lesser General Public License for more details.
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
@@ -21,6 +23,9 @@
 #include "NamingServiceTest.hxx"
 #include "Utils_ORB_INIT.hxx"
 #include "Utils_SINGLETON.hxx"
+#include "Basics_Utils.hxx"
+#include "SALOME_LifeCycleCORBA.hxx"
+#include "utilities.h"
 
 #include <iostream>
 #include <fstream>
@@ -28,7 +33,6 @@
 #include <cstdlib>
 #include <cstdio>
 
-using namespace std;
 
 // --- uncomment to have some traces on standard error
 //     (useful only when adding new tests...)
@@ -42,6 +46,10 @@ using namespace std;
 #define DEVTRACE(msg)
 #endif
 
+#ifdef WIN32
+#define setenv Kernel_Utils::setenv
+#endif 
+
 #define TRACEFILE "/tmp/traceUnitTest.log"
 
 // ============================================================================
@@ -89,6 +97,7 @@ NSTEST::echo_ptr NSTEST_aFactory_i::createInstance()
   NSTEST_echo_i * anEcho = new NSTEST_echo_i(_num);
   _num++;
   NSTEST::echo_var anEchoRef = anEcho->_this();
+  anEcho->_remove_ref();
   return anEchoRef._retn();
 }
 
@@ -110,17 +119,17 @@ NamingServiceTest::setUp()
   bp1->deleteInstance(bp1);
 
   // --- trace on file
-  char *theFileName = TRACEFILE;
+  const char *theFileName = TRACEFILE;
 
-  string s = "file:";
+  std::string s = "file:";
   s += theFileName;
   //s="local";
   //s="with_logger";
   CPPUNIT_ASSERT(! setenv("SALOME_trace",s.c_str(),1)); // 1: overwrite
 
-  ofstream traceFile;
+  std::ofstream traceFile;
   //  traceFile.open(theFileName, ios::out | ios::trunc);
-  traceFile.open(theFileName, ios::out | ios::app);
+  traceFile.open(theFileName, std::ios::out | std::ios::app);
   CPPUNIT_ASSERT(traceFile); // file created empty, then closed
   traceFile.close();
 
@@ -130,7 +139,7 @@ NamingServiceTest::setUp()
   // --- Get or initialize the orb
 
   int _argc = 1;
-  char* _argv[] = {""};
+  char* _argv[] = {(char*)""};
   ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance() ;
   ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting());
   _orb = init(_argc , _argv ) ;
@@ -149,6 +158,7 @@ NamingServiceTest::setUp()
   _myFactoryId = _root_poa->activate_object(_myFactory);
   _factoryRef = _myFactory->_this();
   _pman->activate();
+  _myFactory->_remove_ref();
   
 }
 
@@ -180,7 +190,7 @@ NamingServiceTest::testConstructorDefault()
   //CPPUNIT_ASSERT_THROW(NS.getIORaddr(),CORBA::Exception);
   NS.init_orb(_orb);
 
-  char *root = NS.getIORaddr();
+  CORBA::String_var root = NS.getIORaddr();
   CORBA::Object_var obj = _orb->string_to_object(root);
   CPPUNIT_ASSERT(!CORBA::is_nil(obj));
 
@@ -199,7 +209,7 @@ void
 NamingServiceTest::testConstructorOrb()
 {
   SALOME_NamingService  NS(_orb);
-  char *root = NS.getIORaddr();
+  CORBA::String_var root = NS.getIORaddr();
   CORBA::Object_var obj = _orb->string_to_object(root);
   CPPUNIT_ASSERT(!CORBA::is_nil(obj));
 
@@ -413,7 +423,7 @@ NamingServiceTest::testResolveFirst()
     {
       NSTEST::echo_var anEchoRef = myFactory->createInstance();
       ref[i] = anEchoRef->getId();
-      string name = "/nstestfirst/echo_";
+      std::string name = "/nstestfirst/echo_";
       char anum[10];
       sprintf(anum,"%d",ref[i]);
       name += anum;
@@ -422,7 +432,7 @@ NamingServiceTest::testResolveFirst()
 
   for (int i=0; i<NB_OBJS; i++)
     {
-      string name = "/nstestfirst/echo_";
+      std::string name = "/nstestfirst/echo_";
       char anum[10];
       sprintf(anum,"%d",ref[i]);
       name += anum;
@@ -433,7 +443,7 @@ NamingServiceTest::testResolveFirst()
       CPPUNIT_ASSERT(anEchoRef->getId() == ref[i]);
     }
 
-  string name = "/nstestfirst/echo";
+  std::string name = "/nstestfirst/echo";
   obj = _NS.ResolveFirst(name.c_str());
   CPPUNIT_ASSERT(!CORBA::is_nil(obj));
   NSTEST::echo_var anEchoRef = NSTEST::echo::_narrow(obj);
@@ -465,7 +475,7 @@ NamingServiceTest::testResolveFirstRelative()
     {
       NSTEST::echo_var anEchoRef = myFactory->createInstance();
       ref[i] = anEchoRef->getId();
-      string name = "/nstestfirstrel/echo_";
+      std::string name = "/nstestfirstrel/echo_";
       char anum[10];
       sprintf(anum,"%d",ref[i]);
       name += anum;
@@ -475,7 +485,7 @@ NamingServiceTest::testResolveFirstRelative()
   for (int i=0; i<NB_OBJS; i++)
     {
       _NS.Change_Directory("/nstestfirstrel");
-      string name = "echo_";
+      std::string name = "echo_";
       char anum[10];
       sprintf(anum,"%d",ref[i]);
       name += anum;
@@ -487,7 +497,7 @@ NamingServiceTest::testResolveFirstRelative()
     }
 
   _NS.Change_Directory("/nstestfirstrel");
-  string name = "echo";
+  std::string name = "echo";
   obj = _NS.ResolveFirst(name.c_str());
   CPPUNIT_ASSERT(!CORBA::is_nil(obj));
 }
@@ -501,7 +511,7 @@ NamingServiceTest::testResolveFirstRelative()
 void
 NamingServiceTest::testResolveFirstUnknown()
 {
-  string name = "/notYeyRegistered";
+  std::string name = "/notYeyRegistered";
   CORBA::Object_var obj= _NS.ResolveFirst(name.c_str());
   CPPUNIT_ASSERT(CORBA::is_nil(obj));
 
@@ -526,7 +536,7 @@ NamingServiceTest::testResolveFirstUnknownRelative()
   _NS.Create_Directory("/myContext");
   _NS.Change_Directory("/myContext");
 
-  string name = "RelnotYeyRegistered";
+  std::string name = "RelnotYeyRegistered";
   CORBA::Object_var obj = _NS.ResolveFirst(name.c_str());
   CPPUNIT_ASSERT(CORBA::is_nil(obj));
 
@@ -555,11 +565,11 @@ NamingServiceTest::testResolveComponentOK()
 
   NSTEST::echo_var anEchoRef = myFactory->createInstance();
   _NS.Register(anEchoRef,
-              "/Containers/theHostName/theContainerName/theComponentName");
+               "/Containers/theHostName/theContainerName/theComponentName");
 
   obj = _NS.ResolveComponent("theHostName",
-                            "theContainerName",
-                            "theComponentName");
+                             "theContainerName",
+                             "theComponentName");
   CPPUNIT_ASSERT(!CORBA::is_nil(obj));
   NSTEST::echo_var anEchoRefa = NSTEST::echo::_narrow(obj);
   CPPUNIT_ASSERT(!CORBA::is_nil(anEchoRefa));
@@ -568,12 +578,12 @@ NamingServiceTest::testResolveComponentOK()
 
   NSTEST::echo_var anEchoRef2 = myFactory->createInstance();
   _NS.Register(anEchoRef2,
-              "/Containers/theHostName/theContainerName_2/theComponentName");
+               "/Containers/theHostName/theContainerName_2/theComponentName");
 
   obj = _NS.ResolveComponent("theHostName",
-                            "theContainerName",
-                            "theComponentName",
-                            2);
+                             "theContainerName",
+                             "theComponentName",
+                             2);
   CPPUNIT_ASSERT(!CORBA::is_nil(obj));
   NSTEST::echo_var anEchoRefb = NSTEST::echo::_narrow(obj);
   CPPUNIT_ASSERT(!CORBA::is_nil(anEchoRefb));
@@ -596,11 +606,11 @@ NamingServiceTest::testResolveComponentEmptyHostname()
 
   NSTEST::echo_var anEchoRef = myFactory->createInstance();
   _NS.Register(anEchoRef,
-              "/Containers/theHostName/theContainerName/theComponentName");
+               "/Containers/theHostName/theContainerName/theComponentName");
 
   obj = _NS.ResolveComponent("",
-                            "theContainerName",
-                            "theComponentName");
+                             "theContainerName",
+                             "theComponentName");
   CPPUNIT_ASSERT(CORBA::is_nil(obj));
 }
 
@@ -620,11 +630,11 @@ NamingServiceTest::testResolveComponentUnknownHostname()
 
   NSTEST::echo_var anEchoRef = myFactory->createInstance();
   _NS.Register(anEchoRef,
-              "/Containers/theHostName/theContainerName/theComponentName");
+               "/Containers/theHostName/theContainerName/theComponentName");
 
   obj = _NS.ResolveComponent("anUnknownHostName",
-                            "theContainerName",
-                            "theComponentName");
+                             "theContainerName",
+                             "theComponentName");
   CPPUNIT_ASSERT(CORBA::is_nil(obj));
 }
 
@@ -648,24 +658,24 @@ NamingServiceTest::testResolveComponentEmptyContainerName()
 
   NSTEST::echo_var anEchoRef = myFactory->createInstance();
   _NS.Register(anEchoRef,
-              "/Containers/theHostName/theContainerName/theComponentName");
+               "/Containers/theHostName/theContainerName/theComponentName");
 
   NSTEST::echo_var anEchoRef2 = myFactory->createInstance();
   _NS.Register(anEchoRef2,
-              "/Containers/theHostName/aContainerName/aComponentName");
+               "/Containers/theHostName/aContainerName/aComponentName");
 
   NSTEST::echo_var anEchoRef3 = myFactory->createInstance();
   _NS.Register(anEchoRef3,
-              "/Containers/theHostName/otherContainerName/theComponentName");
+               "/Containers/theHostName/otherContainerName/theComponentName");
 
   obj = _NS.ResolveComponent("anUnknownHostName",
-                            "",
-                            "theComponentName");
+                             "",
+                             "theComponentName");
   CPPUNIT_ASSERT(CORBA::is_nil(obj));
 
   obj = _NS.ResolveComponent("theHostName",
-                            "",
-                            "theComponentName");
+                             "",
+                             "theComponentName");
   CPPUNIT_ASSERT(!CORBA::is_nil(obj));
   NSTEST::echo_var anEchoRefa = NSTEST::echo::_narrow(obj);
   CPPUNIT_ASSERT(!CORBA::is_nil(anEchoRefa));
@@ -688,19 +698,19 @@ NamingServiceTest::testResolveComponentUnknownContainerName()
 
   NSTEST::echo_var anEchoRef = myFactory->createInstance();
   _NS.Register(anEchoRef,
-              "/Containers/theHostName/theContainerName/theComponentName");
+               "/Containers/theHostName/theContainerName/theComponentName");
 
   NSTEST::echo_var anEchoRef2 = myFactory->createInstance();
   _NS.Register(anEchoRef2,
-              "/Containers/theHostName/aContainerName/aComponentName");
+               "/Containers/theHostName/aContainerName/aComponentName");
 
   NSTEST::echo_var anEchoRef3 = myFactory->createInstance();
   _NS.Register(anEchoRef3,
-              "/Containers/theHostName/otherContainerName/theComponentName");
+               "/Containers/theHostName/otherContainerName/theComponentName");
 
   obj = _NS.ResolveComponent("theHostName",
-                            "anUnknownContainerName",
-                            "theComponentName");
+                             "anUnknownContainerName",
+                             "theComponentName");
   CPPUNIT_ASSERT(CORBA::is_nil(obj));
 }
 
@@ -720,15 +730,15 @@ NamingServiceTest::testResolveComponentEmptyComponentName()
 
   NSTEST::echo_var anEchoRef = myFactory->createInstance();
   _NS.Register(anEchoRef,
-              "/Containers/theHostName/theContainerName/theComponentName");
+               "/Containers/theHostName/theContainerName/theComponentName");
 
   NSTEST::echo_var anEchoRef2 = myFactory->createInstance();
   _NS.Register(anEchoRef2,
-              "/Containers/theHostName/EmptyContainerName/");
+               "/Containers/theHostName/EmptyContainerName/");
 
   obj = _NS.ResolveComponent("theHostName",
-                            "EmptyContainerName",
-                            "");
+                             "EmptyContainerName",
+                             "");
   CPPUNIT_ASSERT(CORBA::is_nil(obj));
 }
 
@@ -748,11 +758,11 @@ NamingServiceTest::testResolveComponentUnknownComponentName()
 
   NSTEST::echo_var anEchoRef = myFactory->createInstance();
   _NS.Register(anEchoRef,
-              "/Containers/theHostName/theContainerName/theComponentName");
+               "/Containers/theHostName/theContainerName/theComponentName");
 
   obj = _NS.ResolveComponent("theHostName",
-                            "theContainerName",
-                            "anUnknownComponentName");
+                             "theContainerName",
+                             "anUnknownComponentName");
   CPPUNIT_ASSERT(CORBA::is_nil(obj));
 }
 
@@ -774,18 +784,18 @@ NamingServiceTest::testResolveComponentFalseNbproc()
 
   NSTEST::echo_var anEchoRef = myFactory->createInstance();
   _NS.Register(anEchoRef,
-              "/Containers/theHostName/theContainerName/theComponentName");
+               "/Containers/theHostName/theContainerName/theComponentName");
 
   obj = _NS.ResolveComponent("theHostName",
-                            "theContainerName",
-                            "theComponentName",
-                            25);
+                             "theContainerName",
+                             "theComponentName",
+                             25);
   CPPUNIT_ASSERT(CORBA::is_nil(obj));
 
   obj = _NS.ResolveComponent("theHostName",
-                            "theContainerName",
-                            "theComponentName",
-                            -25);
+                             "theContainerName",
+                             "theComponentName",
+                             -25);
   CPPUNIT_ASSERT(! CORBA::is_nil(obj));
 }
 
@@ -798,8 +808,8 @@ NamingServiceTest::testResolveComponentFalseNbproc()
 void
 NamingServiceTest::testContainerName()
 {
-  string ref0 = "FactoryServer";
-  string ret = _NS.ContainerName("");
+  std::string ref0 = "FactoryServer";
+  std::string ret = _NS.ContainerName("");
   CPPUNIT_ASSERT(ret == ref0);
 
   ref0 = "MyContainerName";
@@ -816,18 +826,11 @@ NamingServiceTest::testContainerName()
 void
 NamingServiceTest::testContainerNameParams()
 {
-  Engines::MachineParameters params;
-  params.container_name = "";
-  params.hostname = "";
-  params.OS = "";
-  params.mem_mb = 0;
-  params.cpu_clock = 0;
-  params.nb_proc_per_node = 0;
-  params.nb_node = 0;
-  params.isMPI = false;
-
-  string ref0 = "FactoryServer";
-  string ret = _NS.ContainerName(params);
+  Engines::ContainerParameters params;
+  SALOME_LifeCycleCORBA::preSet(params);
+
+  std::string ref0 = "FactoryServer";
+  std::string ret = _NS.ContainerName(params);
   CPPUNIT_ASSERT(ret == ref0);
 
   ref0 = "MyContainerName";
@@ -845,8 +848,8 @@ NamingServiceTest::testContainerNameParams()
 void
 NamingServiceTest::testBuildContainerNameForNS()
 {
-  string ref0 = "/Containers/theHostName/theContainerName";
-  string ret = _NS.BuildContainerNameForNS("theContainerName","theHostName");
+  std::string ref0 = "/Containers/theHostName/theContainerName";
+  std::string ret = _NS.BuildContainerNameForNS("theContainerName","theHostName");
   CPPUNIT_ASSERT(ret == ref0);
 
   ref0 = "/Containers/theHostName/FactoryServer";
@@ -863,19 +866,12 @@ NamingServiceTest::testBuildContainerNameForNS()
 void
 NamingServiceTest::testBuildContainerNameForNSParams()
 {
-  Engines::MachineParameters params;
-  params.container_name = "";
-  params.hostname = "";
-  params.OS = "";
-  params.mem_mb = 0;
-  params.cpu_clock = 0;
-  params.nb_proc_per_node = 0;
-  params.nb_node = 0;
-  params.isMPI = false;
+  Engines::ContainerParameters params;
+  SALOME_LifeCycleCORBA::preSet(params);
 
   params.container_name = "theContainerName";
-  string ref0 = "/Containers/theHostName/theContainerName";
-  string ret = _NS.BuildContainerNameForNS(params,"theHostName");
+  std::string ref0 = "/Containers/theHostName/theContainerName";
+  std::string ret = _NS.BuildContainerNameForNS(params,"theHostName");
   CPPUNIT_ASSERT(ret == ref0);
 
   params.container_name = "";
@@ -900,19 +896,19 @@ NamingServiceTest::testFind()
 
   NSTEST::echo_var anEchoRef = myFactory->createInstance();
   _NS.Register(anEchoRef,
-              "/Containers/theHostName/theContainerName/theComponentName");
+               "/Containers/theHostName/theContainerName/theComponentName");
 
   NSTEST::echo_var anEchoRef2 = myFactory->createInstance();
   _NS.Register(anEchoRef2,
-              "/Containers/theHostName/aContainerName/aComponentName");
+               "/Containers/theHostName/aContainerName/aComponentName");
 
   NSTEST::echo_var anEchoRef3 = myFactory->createInstance();
   _NS.Register(anEchoRef3,
-              "/Containers/theHostName/otherContainerName/theComponentName");
+               "/Containers/theHostName/otherContainerName/theComponentName");
 
   NSTEST::echo_var anEchoRef4 = myFactory->createInstance();
   _NS.Register(anEchoRef4,
-              "/Containers/anHostName/oneContainerName/theComponentName");
+               "/Containers/anHostName/oneContainerName/theComponentName");
 
   _NS.Change_Directory("/Containers");
   int occ= _NS.Find("theComponentName");
@@ -947,13 +943,13 @@ NamingServiceTest::testCreateDirectory()
   _NS.Change_Directory("/aaa/bbb/ccc/ddd/eee");
   NSTEST::echo_var anEchoRef = myFactory->createInstance();
   int val = anEchoRef->getId();
-  string name = "echo_";
+  std::string name = "echo_";
   char anum[10];
   sprintf(anum,"%d",val);
   name += anum;
   _NS.Register(anEchoRef,name.c_str());
 
-  string dirname = "/aaa/bbb/ccc/ddd/eee/";
+  std::string dirname = "/aaa/bbb/ccc/ddd/eee/";
   dirname += name;
   obj = _NS.Resolve(dirname.c_str());
   CPPUNIT_ASSERT(!CORBA::is_nil(obj));
@@ -990,19 +986,19 @@ NamingServiceTest::testChangeDirectory()
 
   NSTEST::echo_var anEchoRef = myFactory->createInstance();
   _NS.Register(anEchoRef,
-              "/Containers/theHostName/theContainerName/theComponentName");
+               "/Containers/theHostName/theContainerName/theComponentName");
 
   NSTEST::echo_var anEchoRef2 = myFactory->createInstance();
   _NS.Register(anEchoRef2,
-              "/Containers/theHostName/aContainerName/aComponentName");
+               "/Containers/theHostName/aContainerName/aComponentName");
 
   NSTEST::echo_var anEchoRef3 = myFactory->createInstance();
   _NS.Register(anEchoRef3,
-              "/Containers/theHostName/otherContainerName/theComponentName");
+               "/Containers/theHostName/otherContainerName/theComponentName");
 
   NSTEST::echo_var anEchoRef4 = myFactory->createInstance();
   _NS.Register(anEchoRef4,
-              "/Containers/anHostName/oneContainerName/theComponentName");
+               "/Containers/anHostName/oneContainerName/theComponentName");
   
   _NS.Change_Directory("/Containers/theHostName/otherContainerName");
   obj = _NS.Resolve("theComponentName");
@@ -1022,12 +1018,14 @@ NamingServiceTest::testChangeDirectory()
 void
 NamingServiceTest::testCurrentDirectory()
 {
-  string path = "/aaa/bbb/ccc/ddd/eee";
+  std::string path = "/aaa/bbb/ccc/ddd/eee";
   bool ret = _NS.Create_Directory(path.c_str());
   CPPUNIT_ASSERT(ret);
 
   _NS.Change_Directory(path.c_str());
-  string curdir = _NS.Current_Directory();
+  char* acurdir = _NS.Current_Directory();
+  std::string curdir = acurdir;
+  free(acurdir);
   CPPUNIT_ASSERT(curdir == path);
 }
 
@@ -1109,7 +1107,7 @@ NamingServiceTest::testDestroyName()
   NSTEST::aFactory_var myFactory = NSTEST::aFactory::_narrow(obj);
   CPPUNIT_ASSERT(!CORBA::is_nil(myFactory));
 
-  string path = "/Containers/theHostName/theContainerName/theComponentName";
+  std::string path = "/Containers/theHostName/theContainerName/theComponentName";
 
   NSTEST::echo_var anEchoRef = myFactory->createInstance();
   _NS.Register(anEchoRef, path.c_str());
@@ -1136,7 +1134,7 @@ NamingServiceTest::testDestroyDirectory()
   NSTEST::aFactory_var myFactory = NSTEST::aFactory::_narrow(obj);
   CPPUNIT_ASSERT(!CORBA::is_nil(myFactory));
 
-  string path = "/Containers/theHostName/theContainerName/theComponentName";
+  std::string path = "/Containers/theHostName/theContainerName/theComponentName";
 
   NSTEST::echo_var anEchoRef = myFactory->createInstance();
   _NS.Register(anEchoRef, path.c_str());
@@ -1158,22 +1156,22 @@ NamingServiceTest::testDestroyDirectory()
  */
 // ============================================================================
 
-void NamingServiceTest::_destroyDirectoryRecurs(string path)
+void NamingServiceTest::_destroyDirectoryRecurs(std::string path)
 {
-  string current = path;
+  std::string current = path;
   SCRUTE(path);
   if (_NS.Change_Directory(path.c_str()))
     {
-      vector<string> subdirs = _NS.list_subdirs();
+      std::vector<std::string> subdirs = _NS.list_subdirs();
       for (int i=0; i<subdirs.size(); i++)
-       {
-         string subpath=path + "/" +subdirs[i];
-         _destroyDirectoryRecurs(subpath);
-       }
+        {
+          std::string subpath=path + "/" +subdirs[i];
+          _destroyDirectoryRecurs(subpath);
+        }
       if (_NS.Change_Directory(path.c_str()))
-       {
-         _NS.Destroy_FullDirectory(path.c_str());
-       }
+        {
+          _NS.Destroy_FullDirectory(path.c_str());
+        }
     }
 }
 
@@ -1182,10 +1180,10 @@ NamingServiceTest::testDestroyFullDirectory()
 {
   _NS.Destroy_FullDirectory("/Containers");
   CPPUNIT_ASSERT(_NS.Change_Directory("/Containers"));
-  vector<string> subdirs = _NS.list_subdirs();
+  std::vector<std::string> subdirs = _NS.list_subdirs();
   CPPUNIT_ASSERT(subdirs.size() >0);
   _NS.list_directory_recurs();
-  string path = "/Containers";
+  std::string path = "/Containers";
   _destroyDirectoryRecurs(path);
   CPPUNIT_ASSERT( ! _NS.Change_Directory("/Containers"));
   _NS.Change_Directory("/");
@@ -1202,7 +1200,7 @@ NamingServiceTest::testDestroyFullDirectory()
 void
 NamingServiceTest::testGetIorAddr()
 {
-  char *root = _NS.getIORaddr();
+  CORBA::String_var root = _NS.getIORaddr();
   CORBA::Object_var obj = _orb->string_to_object(root);
   CPPUNIT_ASSERT(!CORBA::is_nil(obj)); 
 }