]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
PR: allow directories in Naming service of only one character.
authorprascle <prascle>
Wed, 30 Nov 2005 09:02:40 +0000 (09:02 +0000)
committerprascle <prascle>
Wed, 30 Nov 2005 09:02:40 +0000 (09:02 +0000)
src/NamingService/SALOME_NamingService.cxx
src/NamingService/Test/NamingServiceTest.cxx

index a13dd52d46736c30467500f2b5da3038b7d427e3..36b0961a14dc33968a398ea5bb03455cace91d43 100644 (file)
@@ -1543,7 +1543,7 @@ SALOME_NamingService::_createContextNameDir(string path,
       if (endIdx == string::npos)
        endIdx = path.length();
       int lsub = endIdx - begIdx;
-      if (lsub > 1)
+      if (lsub >= 1)
        splitPath.push_back(path.substr(begIdx, lsub));
       begIdx = path.find_first_not_of(delims, endIdx);
     }
index 2d4d5d9483d70751f5418410c36cdd12751cce37..deedb2b6141ae49ade7df9a69a365b21c9cfaf02 100644 (file)
@@ -273,6 +273,15 @@ NamingServiceTest::testRegisterResolveAbsWithPath()
   NSTEST::echo_var anEchoRef1a = NSTEST::echo::_narrow(obj);
   CPPUNIT_ASSERT(!CORBA::is_nil(anEchoRef1a));
   CPPUNIT_ASSERT(anEchoRef1->getId() == anEchoRef1a->getId());
+
+  NSTEST::echo_var anEchoRef2 = myFactory->createInstance();
+  _NS.Register(anEchoRef2,"/nstest2/1/2/3/4/echo_1");
+
+  obj = _NS.Resolve("/nstest2/1/2/3/4/echo_1");
+  CPPUNIT_ASSERT(!CORBA::is_nil(obj));
+  NSTEST::echo_var anEchoRef2a = NSTEST::echo::_narrow(obj);
+  CPPUNIT_ASSERT(!CORBA::is_nil(anEchoRef2a));
+  CPPUNIT_ASSERT(anEchoRef2->getId() == anEchoRef2a->getId());
 }
 
 // ============================================================================