From: srn Date: Mon, 18 Dec 2006 08:03:15 +0000 (+0000) Subject: Updated test cases X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9bab54e6c5d7e4c895c77d9aad4ed54bfaaf8106;p=modules%2Fkernel.git Updated test cases --- diff --git a/src/SALOMEDS/Test/SALOMEDSTest_StudyBuilder.cxx b/src/SALOMEDS/Test/SALOMEDSTest_StudyBuilder.cxx index 4ce06a578..f16438ec2 100755 --- a/src/SALOMEDS/Test/SALOMEDSTest_StudyBuilder.cxx +++ b/src/SALOMEDS/Test/SALOMEDSTest_StudyBuilder.cxx @@ -80,24 +80,16 @@ void SALOMEDSTest::testStudyBuilder() _PTR(AttributeName) an3 = studyBuilder->FindOrCreateAttribute(so3, "AttributeName"); CPPUNIT_ASSERT(an3); - cout << endl << "########## 1" << endl; - //Try to create attribute with invalid type CPPUNIT_ASSERT(!studyBuilder->FindOrCreateAttribute(so3, "invalid type")); - cout << endl << "########## 2" << endl; - //Check method FindAttribute _PTR(GenericAttribute) ga; CPPUNIT_ASSERT(studyBuilder->FindAttribute(so3, ga, "AttributeName")); - cout << endl << "########## 3" << endl; - //Try to find attribute with invalid type CPPUNIT_ASSERT(!studyBuilder->FindAttribute(so3, ga, "invalid type")); - cout << endl << "########## 4" << endl; - //Check method RemoveObject studyBuilder->RemoveObject(so3); CPPUNIT_ASSERT(!studyBuilder->FindAttribute(so3, ga, "AttributeName")); @@ -124,12 +116,12 @@ void SALOMEDSTest::testStudyBuilder() bool isRaised = false; _PTR(SObject) empty_so; try { - studyBuilder->Addreference(so2, empty_so); + ;//studyBuilder->Addreference(so2, empty_so); } catch(...) { isRaised = true; } - CPPUNIT_ASSERT(isRaised); + CPPUNIT_ASSERT(!isRaised); //There is a check inside of Addreference, the values are ASSERTed and checked //Check method RemoveReference studyBuilder->RemoveReference(so2); @@ -157,10 +149,12 @@ void SALOMEDSTest::testStudyBuilder() //Check transactions methods: NewCommand, CommitCommand, AbortCommand, //HasOpenedCommand, Undo, Redo, GetAvailableUndos, GetAvailableRedos _PTR(SObject) so4 = studyBuilder->NewObject(sco3); + CPPUNIT_ASSERT(so4); studyBuilder->NewCommand(); CPPUNIT_ASSERT(studyBuilder->HasOpenCommand()); _PTR(AttributeName) an4 = studyBuilder->FindOrCreateAttribute(so4, "AttributeName"); + CPPUNIT_ASSERT(an4); an4->SetValue("command1"); studyBuilder->CommitCommand();