From: adv Date: Thu, 24 Oct 2013 12:06:07 +0000 (+0000) Subject: Linux compilation. X-Git-Tag: BR_hydro_v_0_3~88 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d40286a203c60a8a099b2ac92e6e88a449b2c1c2;p=modules%2Fhydro.git Linux compilation. --- diff --git a/src/HYDROData/CMakeLists.txt b/src/HYDROData/CMakeLists.txt index 5e968068..71fc6191 100644 --- a/src/HYDROData/CMakeLists.txt +++ b/src/HYDROData/CMakeLists.txt @@ -70,28 +70,28 @@ set(PROJECT_LIBRARIES HYDROData) if(CPPUNIT_IS_OK) set(TEST_HEADERS - test_HYDROData_Document.h - test_HYDROData_Object.h - test_HYDROData_Iterator.h - test_HYDROData_Image.h - test_HYDROData_Polyline.h test_HYDROData_Bathymetry.h - test_HYDROData_Calculation.h test_HYDROData_BSplineOperation.h + test_HYDROData_Calculation.h + test_HYDROData_Document.h + test_HYDROData_Entity.h + test_HYDROData_Image.h + test_HYDROData_Iterator.h test_HYDROData_OperationsFactory.h + test_HYDROData_Polyline.h ) set(TEST_SOURCES test_HYDROData_Main.cxx - test_HYDROData_Document.cxx - test_HYDROData_Object.cxx - test_HYDROData_Iterator.cxx - test_HYDROData_Image.cxx - test_HYDROData_Polyline.cxx test_HYDROData_Bathymetry.cxx - test_HYDROData_Calculation.cxx test_HYDROData_BSplineOperation.cxx + test_HYDROData_Calculation.cxx + test_HYDROData_Document.cxx + test_HYDROData_Entity.cxx + test_HYDROData_Image.cxx + test_HYDROData_Iterator.cxx test_HYDROData_OperationsFactory.cxx + test_HYDROData_Polyline.cxx ) set(TEST_EXE test_HYDROData) diff --git a/src/HYDROData/test_HYDROData_Entity.cxx b/src/HYDROData/test_HYDROData_Entity.cxx new file mode 100644 index 00000000..07007168 --- /dev/null +++ b/src/HYDROData/test_HYDROData_Entity.cxx @@ -0,0 +1,48 @@ +#include + +#include +#include + +#include + +void test_HYDROData_Entity::testName() +{ + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + + Handle(HYDROData_Entity) anObj = aDoc->CreateObject(KIND_IMAGE); // any object + static const QString aName("test_name"); + anObj->SetName(aName); + CPPUNIT_ASSERT_EQUAL(aName.toStdString(), anObj->GetName().toStdString()); + + aDoc->Close(); +} + +void test_HYDROData_Entity::testRemove() +{ + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + + Handle(HYDROData_Entity) anObj = aDoc->CreateObject(KIND_IMAGE); // any object + CPPUNIT_ASSERT(!anObj->IsRemoved()); + anObj->Remove(); + CPPUNIT_ASSERT(anObj->IsRemoved()); + + aDoc->Close(); +} + +void test_HYDROData_Entity::testCopy() +{ + Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); + + Handle(HYDROData_Entity) anObj = aDoc->CreateObject(KIND_IMAGE); // any object + static const QString aName("test_name"); + anObj->SetName(aName); + + Handle(HYDROData_Entity) aCopy = aDoc->CreateObject(KIND_IMAGE); // object for copy + CPPUNIT_ASSERT(aCopy->GetName().isEmpty()); + anObj->CopyTo(aCopy); + + // check the copied object has same name as original + CPPUNIT_ASSERT_EQUAL(aName.toStdString(), aCopy->GetName().toStdString()); + + aDoc->Close(); +} diff --git a/src/HYDROData/test_HYDROData_Entity.h b/src/HYDROData/test_HYDROData_Entity.h new file mode 100644 index 00000000..d313802a --- /dev/null +++ b/src/HYDROData/test_HYDROData_Entity.h @@ -0,0 +1,29 @@ +#include + +class test_HYDROData_Entity : public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(test_HYDROData_Entity); + CPPUNIT_TEST(testName); + CPPUNIT_TEST(testRemove); + CPPUNIT_TEST(testCopy); + CPPUNIT_TEST_SUITE_END(); + +private: + +public: + + void setUp() {} + + void tearDown() {} + + // checks the "name" methods + void testName(); + + // checks the remove of object + void testRemove(); + + // checks the copying of object + void testCopy(); +}; + +CPPUNIT_TEST_SUITE_REGISTRATION(test_HYDROData_Entity); +CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(test_HYDROData_Entity, "HYDROData_Entity"); diff --git a/src/HYDROData/test_HYDROData_Object.cxx b/src/HYDROData/test_HYDROData_Object.cxx deleted file mode 100644 index 7e96fda3..00000000 --- a/src/HYDROData/test_HYDROData_Object.cxx +++ /dev/null @@ -1,48 +0,0 @@ -#include - -#include -#include - -#include - -void test_HYDROData_Object::testName() -{ - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); - - Handle(HYDROData_Object) anObj = aDoc->CreateObject(KIND_IMAGE); // any object - static const QString aName("test_name"); - anObj->SetName(aName); - CPPUNIT_ASSERT_EQUAL(aName.toStdString(), anObj->GetName().toStdString()); - - aDoc->Close(); -} - -void test_HYDROData_Object::testRemove() -{ - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); - - Handle(HYDROData_Object) anObj = aDoc->CreateObject(KIND_IMAGE); // any object - CPPUNIT_ASSERT(!anObj->IsRemoved()); - anObj->Remove(); - CPPUNIT_ASSERT(anObj->IsRemoved()); - - aDoc->Close(); -} - -void test_HYDROData_Object::testCopy() -{ - Handle(HYDROData_Document) aDoc = HYDROData_Document::Document(1); - - Handle(HYDROData_Object) anObj = aDoc->CreateObject(KIND_IMAGE); // any object - static const QString aName("test_name"); - anObj->SetName(aName); - - Handle(HYDROData_Object) aCopy = aDoc->CreateObject(KIND_IMAGE); // object for copy - CPPUNIT_ASSERT(aCopy->GetName().isEmpty()); - anObj->CopyTo(aCopy); - - // check the copied object has same name as original - CPPUNIT_ASSERT_EQUAL(aName.toStdString(), aCopy->GetName().toStdString()); - - aDoc->Close(); -} diff --git a/src/HYDROData/test_HYDROData_Object.h b/src/HYDROData/test_HYDROData_Object.h deleted file mode 100644 index 12284fac..00000000 --- a/src/HYDROData/test_HYDROData_Object.h +++ /dev/null @@ -1,29 +0,0 @@ -#include - -class test_HYDROData_Object : public CppUnit::TestFixture { - CPPUNIT_TEST_SUITE(test_HYDROData_Object); - CPPUNIT_TEST(testName); - CPPUNIT_TEST(testRemove); - CPPUNIT_TEST(testCopy); - CPPUNIT_TEST_SUITE_END(); - -private: - -public: - - void setUp() {} - - void tearDown() {} - - // checks the "name" methods - void testName(); - - // checks the remove of object - void testRemove(); - - // checks the copying of object - void testCopy(); -}; - -CPPUNIT_TEST_SUITE_REGISTRATION(test_HYDROData_Object); -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(test_HYDROData_Object, "HYDROData_Object"); diff --git a/src/HYDROData/test_HYDROData_OperationsFactory.cxx b/src/HYDROData/test_HYDROData_OperationsFactory.cxx index bea1c987..b5d068fe 100644 --- a/src/HYDROData/test_HYDROData_OperationsFactory.cxx +++ b/src/HYDROData/test_HYDROData_OperationsFactory.cxx @@ -60,7 +60,7 @@ void test_HYDROData_OperationsFactory::testCrop() aPolylineData << aPolylineSect; - aCropPolyline->setPolylineData( aPolylineData ); + aCropPolyline->SetPolylineData( aPolylineData ); // prepare Composer Operation ImageComposer_Operator* aCropOp = diff --git a/src/HYDROData/test_HYDROData_Polyline.cxx b/src/HYDROData/test_HYDROData_Polyline.cxx index 290fffad..8899ee29 100755 --- a/src/HYDROData/test_HYDROData_Polyline.cxx +++ b/src/HYDROData/test_HYDROData_Polyline.cxx @@ -14,15 +14,15 @@ void test_HYDROData_Polyline::testPolyline() Handle(HYDROData_Polyline)::DownCast(aDoc->CreateObject(KIND_POLYLINE)); // empty image - int aDim = aPolyline->getDimension(); + int aDim = aPolyline->GetDimension(); CPPUNIT_ASSERT(aDim == 0 ); - aPolyline->setDimension(2); - aDim = aPolyline->getDimension(); + aPolyline->SetDimension(2); + aDim = aPolyline->GetDimension(); CPPUNIT_ASSERT( aDim == 2 ); - aPolyline->setDimension(3); - aDim = aPolyline->getDimension(); + aPolyline->SetDimension(3); + aDim = aPolyline->GetDimension(); CPPUNIT_ASSERT( aDim == 3 ); PolylineSection aSect1; @@ -39,8 +39,8 @@ void test_HYDROData_Polyline::testPolyline() aSect1.myIsClosed = true; aSections << aSect2; - aPolyline->setPolylineData( aSections ); - QList aRestoredSect = aPolyline->getPolylineData(); + aPolyline->SetPolylineData( aSections ); + QList aRestoredSect = aPolyline->GetPolylineData(); int aRestSize = aRestoredSect.size(); CPPUNIT_ASSERT( aRestSize == 2 ); diff --git a/src/HYDROGUI/CMakeLists.txt b/src/HYDROGUI/CMakeLists.txt index 7db85c37..d121c61b 100644 --- a/src/HYDROGUI/CMakeLists.txt +++ b/src/HYDROGUI/CMakeLists.txt @@ -41,7 +41,6 @@ set(PROJECT_HEADERS HYDROGUI_PrsZoneDriver.h HYDROGUI_Shape.h HYDROGUI_ShowHideOp.h - HYDROGUI_SplitZonesTool.h HYDROGUI_Tool.h HYDROGUI_TwoImagesDlg.h HYDROGUI_TwoImagesOp.h @@ -91,7 +90,6 @@ set(PROJECT_SOURCES HYDROGUI_PrsZoneDriver.cxx HYDROGUI_Shape.cxx HYDROGUI_ShowHideOp.cxx - HYDROGUI_SplitZonesTool.cxx HYDROGUI_Tool.cxx HYDROGUI_TwoImagesDlg.cxx HYDROGUI_TwoImagesOp.cxx