Salome HOME
updated copyright message
[modules/kernel.git] / src / SALOMEDS / Test / SALOMEDSTest_AttributeTableOfReal.cxx
old mode 100755 (executable)
new mode 100644 (file)
index e86d3ef..95283bb
@@ -1,18 +1,20 @@
-// Copyright (C) 2006  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// Copyright (C) 2007-2023  CEA, EDF, OPEN CASCADE
+//
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
-// 
+//
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either 
-// version 2.1 of the License.
-// 
-// This library is distributed in the hope that it will be useful 
-// but WITHOUT ANY WARRANTY; without even the implied warranty of 
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 // Lesser General Public License for more details.
 //
-// You should have received a copy of the GNU Lesser General Public  
-// License along with this library; if not, write to the Free Software 
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
  */
 void SALOMEDSTest::testAttributeTableOfReal()
 {
-  //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("Test");
+  //Create Study
+  _PTR(Study) study(new SALOMEDS_Study(_study));
 
   CPPUNIT_ASSERT(study);
 
@@ -83,14 +80,14 @@ void SALOMEDSTest::testAttributeTableOfReal()
   CPPUNIT_ASSERT(_attr->GetValue(1, 1) == 23.23);
 
   //Check method GetRowSetIndices
-  vector<int> rs = _attr->GetRowSetIndices(1);
+  std::vector<int> rs = _attr->GetRowSetIndices(1);
 
   CPPUNIT_ASSERT(rs.size() == 1 && rs[0] == 1);
 
   _attr->PutValue(32.32, 2,2);
   CPPUNIT_ASSERT(_attr->HasValue(2, 2));
 
-  vector<string> rowTitles;
+  std::vector<std::string> rowTitles;
   rowTitles.push_back("title1");
   rowTitles.push_back("title2");
 
@@ -101,11 +98,11 @@ void SALOMEDSTest::testAttributeTableOfReal()
   _attr->SetRowTitle(1, "new_title");
 
   //Check method GetRowTitles
-  vector<string> rt = _attr->GetRowTitles();
+  std::vector<std::string> rt = _attr->GetRowTitles();
 
   CPPUNIT_ASSERT(rt.size() == 2 && rt[0] == "new_title" && rt[1] == "title2");
 
-  vector<string> colTitles;
+  std::vector<std::string> colTitles;
   colTitles.push_back("title1");
   colTitles.push_back("title2");
 
@@ -116,11 +113,11 @@ void SALOMEDSTest::testAttributeTableOfReal()
   _attr->SetColumnTitle(1, "new_title");
 
   //Check method GetColumnTitles
-  vector<string> ct = _attr->GetColumnTitles();
+  std::vector<std::string> ct = _attr->GetColumnTitles();
 
   CPPUNIT_ASSERT(ct.size() == 2 && ct[0] == "new_title" && ct[1] == "title2");
 
-  vector<string> rowUnits;
+  std::vector<std::string> rowUnits;
   rowUnits.push_back("unit1");
   rowUnits.push_back("unit2");
 
@@ -131,7 +128,7 @@ void SALOMEDSTest::testAttributeTableOfReal()
   _attr->SetRowUnit(1, "new_unit");
 
   //Check method GetRowUnits
-  vector<string> ru = _attr->GetRowUnits();
+  std::vector<std::string> ru = _attr->GetRowUnits();
 
   CPPUNIT_ASSERT(ru.size() == 2 && ru[0] == "new_unit" && ru[1] == "unit2");
 
@@ -139,7 +136,7 @@ void SALOMEDSTest::testAttributeTableOfReal()
   CPPUNIT_ASSERT(_attr->GetNbColumns() == 2);
 
   //Check method AddRow
-  vector<double> data;
+  std::vector<double> data;
   data.push_back(11.11);
   data.push_back(22.22);
 
@@ -148,7 +145,7 @@ void SALOMEDSTest::testAttributeTableOfReal()
   CPPUNIT_ASSERT(_attr->GetNbRows() == 3);
 
   //Check method GetRow
-  vector<double> data2 = _attr->GetRow(3);
+  std::vector<double> data2 = _attr->GetRow(3);
 
   CPPUNIT_ASSERT(data2.size() == 2 && data2[0] == 11.11 && data2[1] == 22.22);
 
@@ -182,7 +179,7 @@ void SALOMEDSTest::testAttributeTableOfReal()
 
   CPPUNIT_ASSERT(data2.size() == 3 && data2[0] == 11.11 && data2[1] == -22.22 && data2[2] == -33.33);
 
-  sm->Close(study);
+  study->Clear();
 }