]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
*** empty log message ***
authorageay <ageay>
Fri, 8 Oct 2010 14:32:52 +0000 (14:32 +0000)
committerageay <ageay>
Fri, 8 Oct 2010 14:32:52 +0000 (14:32 +0000)
src/MEDCoupling/Test/MEDCouplingBasicsTest.hxx
src/MEDCoupling/Test/MEDCouplingBasicsTest2.cxx

index ad916caa0d46f2db9865860a390c383f11a76557..9bbdb8519fde4e6c1bcd0f8ed2c69bc0aae21cf5 100644 (file)
@@ -123,6 +123,7 @@ namespace ParaMEDMEM
     CPPUNIT_TEST( testChangeNbOfComponents );
     CPPUNIT_TEST( testSortPerTuple1 );
     CPPUNIT_TEST( testIsEqualWithoutConsideringStr1 );
+    CPPUNIT_TEST( testGetNodeIdsOfCell1 );
     //MEDCouplingBasicsTestInterp.cxx
     CPPUNIT_TEST( test2DInterpP0P0_1 );
     CPPUNIT_TEST( test2DInterpP0P0PL_1 );
@@ -274,6 +275,7 @@ namespace ParaMEDMEM
     void testChangeNbOfComponents();
     void testSortPerTuple1();
     void testIsEqualWithoutConsideringStr1();
+    void testGetNodeIdsOfCell1();
     //MEDCouplingBasicsTestInterp.cxx
     void test2DInterpP0P0_1();
     void test2DInterpP0P0PL_1();
index a36e06349ae15dde741562e4dbb6beb2174e03d4..acf8efe7dd1523bd3f4356cc652fe6990e70d990 100644 (file)
@@ -1960,3 +1960,20 @@ void MEDCouplingBasicsTest::testIsEqualWithoutConsideringStr1()
   mesh1->decrRef();
   mesh2->decrRef();
 }
+
+void MEDCouplingBasicsTest::testGetNodeIdsOfCell1()
+{
+  MEDCouplingUMesh *mesh1=build2DTargetMesh_1();
+  std::vector<int> nodeIds;
+  mesh1->getNodeIdsOfCell(1,nodeIds);
+  CPPUNIT_ASSERT_EQUAL(3,(int)nodeIds.size());
+  CPPUNIT_ASSERT_EQUAL(1,nodeIds[0]);
+  CPPUNIT_ASSERT_EQUAL(4,nodeIds[1]);
+  CPPUNIT_ASSERT_EQUAL(2,nodeIds[2]);
+  std::vector<double> coords;
+  mesh1->getCoordinatesOfNode(4,coords);
+  CPPUNIT_ASSERT_EQUAL(2,(int)coords.size());
+  CPPUNIT_ASSERT_DOUBLES_EQUAL(0.2,coords[0],1e-13);
+  CPPUNIT_ASSERT_DOUBLES_EQUAL(0.2,coords[1],1e-13);
+  mesh1->decrRef();
+}