]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Updated test cases
authorsrn <srn@opencascade.com>
Mon, 18 Dec 2006 08:03:15 +0000 (08:03 +0000)
committersrn <srn@opencascade.com>
Mon, 18 Dec 2006 08:03:15 +0000 (08:03 +0000)
src/SALOMEDS/Test/SALOMEDSTest_StudyBuilder.cxx

index 4ce06a5783483ff1318d90f99756b27b02488b13..f16438ec219137fba6a635704634185f495a7bcc 100755 (executable)
@@ -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();