From a6a74a0b57c853e1030452e77c6e31fa78184d88 Mon Sep 17 00:00:00 2001 From: prascle Date: Wed, 30 Nov 2005 09:02:40 +0000 Subject: [PATCH] PR: allow directories in Naming service of only one character. --- src/NamingService/SALOME_NamingService.cxx | 2 +- src/NamingService/Test/NamingServiceTest.cxx | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/NamingService/SALOME_NamingService.cxx b/src/NamingService/SALOME_NamingService.cxx index a13dd52d4..36b0961a1 100644 --- a/src/NamingService/SALOME_NamingService.cxx +++ b/src/NamingService/SALOME_NamingService.cxx @@ -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); } diff --git a/src/NamingService/Test/NamingServiceTest.cxx b/src/NamingService/Test/NamingServiceTest.cxx index 2d4d5d948..deedb2b61 100644 --- a/src/NamingService/Test/NamingServiceTest.cxx +++ b/src/NamingService/Test/NamingServiceTest.cxx @@ -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()); } // ============================================================================ -- 2.39.2