]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
CCAR: cleaner management of getIORaddr return value
authorcaremoli <caremoli>
Mon, 18 Feb 2008 09:39:30 +0000 (09:39 +0000)
committercaremoli <caremoli>
Mon, 18 Feb 2008 09:39:30 +0000 (09:39 +0000)
src/NamingService/NamingService_WaitForServerReadiness.cxx
src/NamingService/Test/NamingServiceTest.cxx

index 3021b6c857ca6e97aa489ada3096792c52d3456d..d4eb2aa7e1ab228c33119f389551c341462ef499 100644 (file)
@@ -66,9 +66,8 @@ void NamingService_WaitForServerReadiness(SALOME_NamingService* NS,
        {
          if (serverName.length() == 0)
            {
-             char* dummyadr = NS->getIORaddr(); // to wait for naming service
+              CORBA::String_var dummyadr = NS->getIORaddr(); // to wait for naming service
              found = 1;
-              delete [] dummyadr;
              break; // naming service found
            }
          else
@@ -81,9 +80,9 @@ void NamingService_WaitForServerReadiness(SALOME_NamingService* NS,
                }
              MESSAGE("Server "<< serverName <<" not yet ready, waiting...");
 #ifndef WNT
-             int a = nanosleep(&ts_req,&ts_rem); // wait before retry
+              nanosleep(&ts_req,&ts_rem); // wait before retry
 #else
-                 Sleep(TIMESleep/1000000);
+              Sleep(TIMESleep/1000000);
 #endif
            }
        }
@@ -91,9 +90,9 @@ void NamingService_WaitForServerReadiness(SALOME_NamingService* NS,
        {
          MESSAGE("CORBA::COMM_FAILURE: Naming Service not yet ready, waiting...");
 #ifndef WNT
-         int a = nanosleep(&ts_req,&ts_rem); // wait before retry
+          nanosleep(&ts_req,&ts_rem); // wait before retry
 #else
-         Sleep(TIMESleep/1000000);
+          Sleep(TIMESleep/1000000);
 #endif
        }
     }
index bfb70a8df2df41ed61551eb5c86d478daf5fa6d2..2a9e1fca2b76c3d34d88cafb6d4c732259e3f169 100644 (file)
@@ -182,9 +182,8 @@ 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);
-  delete [] root;
   CPPUNIT_ASSERT(!CORBA::is_nil(obj));
 
   CosNaming::NamingContext_var rootContext =
@@ -202,10 +201,9 @@ 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));
-  delete [] root;
 
   CosNaming::NamingContext_var rootContext =
     CosNaming::NamingContext::_narrow(obj);
@@ -1208,9 +1206,8 @@ NamingServiceTest::testDestroyFullDirectory()
 void
 NamingServiceTest::testGetIorAddr()
 {
-  char *root = _NS.getIORaddr();
+  CORBA::String_var root = _NS.getIORaddr();
   CORBA::Object_var obj = _orb->string_to_object(root);
-  delete [] root;
   CPPUNIT_ASSERT(!CORBA::is_nil(obj)); 
 }