X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSALOMEDS%2FTest%2FSALOMEDSTest_SObject.cxx;h=4da0748a895d15b16a064e9e4e4bdc18e197deb1;hb=b7e1322de9ff9e2947d1a914d4bc20c2cb395cb5;hp=4ecb084a4536322bc4e3bf19077839935d03b486;hpb=d4617a5edb41e7acd4025a2b56160ae267ede7f6;p=modules%2Fkernel.git diff --git a/src/SALOMEDS/Test/SALOMEDSTest_SObject.cxx b/src/SALOMEDS/Test/SALOMEDSTest_SObject.cxx index 4ecb084a4..4da0748a8 100755 --- a/src/SALOMEDS/Test/SALOMEDSTest_SObject.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_SObject.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2016 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 @@ -27,13 +27,8 @@ void SALOMEDSTest::testSObject() { - //Create or find the Study manager - _PTR(StudyManager) sm ( new SALOMEDS_StudyManager(_sm) ); - - CPPUNIT_ASSERT(sm); - - //Create a new study - _PTR(Study) study = sm->NewStudy("TestSObject"); + //Create Study + _PTR(Study) study(new SALOMEDS_Study(_study)); CPPUNIT_ASSERT(study); @@ -71,7 +66,7 @@ void SALOMEDSTest::testSObject() _PTR(AttributeName) _attrName = studyBuilder->FindOrCreateAttribute(so, "AttributeName"); _PTR(AttributeComment) _attrComment = studyBuilder->FindOrCreateAttribute(so, "AttributeComment"); - std::string ior = _orb->object_to_string(_sm); + std::string ior = _orb->object_to_string(_study); _attrIOR->SetValue(ior); _attrName->SetValue("SO name"); _attrComment->SetValue("SO comment"); @@ -92,9 +87,6 @@ void SALOMEDSTest::testSObject() CPPUNIT_ASSERT(so->FindSubObject(1, so2)); CPPUNIT_ASSERT(so2->GetID() == so1->GetID()); - //Check method GetStudy - CPPUNIT_ASSERT(so->GetStudy()->StudyId() == study->StudyId()); - //Check methods Name so->Name("test"); CPPUNIT_ASSERT(so->Name() == "test"); @@ -102,7 +94,7 @@ void SALOMEDSTest::testSObject() //Check method GetAllAttributes std::vector< _PTR(GenericAttribute) > v = so->GetAllAttributes(); - CPPUNIT_ASSERT(v.size() == 5); //+AttributeTarget +AttributeTreeNode + CPPUNIT_ASSERT(v.size() == 4); //+AttributeTarget +AttributeTreeNode //Check method GetName CPPUNIT_ASSERT(so->GetName() == "SO name"); @@ -120,7 +112,7 @@ void SALOMEDSTest::testSObject() CORBA::Object_var obj = dynamic_cast(so.get())->GetObject(); CPPUNIT_ASSERT(!CORBA::is_nil(obj)); - sm->Close(study); + study->Clear(); }