1 // Copyright (C) 2007-2015 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #ifndef __TU_INTERPOLATION_PLANAR_TEST_SUITE_HXX__
21 #define __TU_INTERPOLATION_PLANAR_TEST_SUITE_HXX__
23 #include <cppunit/extensions/HelperMacros.h>
32 * \brief Base class for planar mesh intersection test suites.
35 class InterpolationPlanarTestSuite : public CppUnit::TestFixture
43 * Sets up the test suite.
53 // bool checkDequesEqual(std::deque< double > deque1, std::deque< double > deque2, double epsilon);
54 // bool checkVectorsEqual(std::vector< double > Vect1, std::vector< double > Vect2, double epsilon);
55 // void dequePrintOut(std::deque< double > deque1);
56 // void vectPrintOut(std::vector< double > vect);
57 // void tabPrintOut( const double * tab, int size);
59 bool checkDequesEqual(std::deque< double > deque1,
60 std::deque< double > deque2, double epsilon)
62 int size1 = deque1.size();
63 int size2 = deque2.size();
64 bool are_equal = size1 == size2;
67 for(int i = 0; i < size1 && are_equal; i++)
68 are_equal = fabs(deque1[i] - deque2[i]) < epsilon;
72 bool checkVectorsEqual(std::vector< double > vect1,
73 std::vector< double > vect2, double epsilon)
75 int size1 = vect1.size();
76 int size2 = vect2.size();
77 bool are_equal = size1 == size2;
80 for(int i = 0; i < size1 && are_equal; i++)
81 are_equal = fabs(vect1[i] - vect2[i]) < epsilon;
85 void dequePrintOut(std::deque< double > deque1)
87 for(int i = 0; i< (int)deque1.size(); i++)
89 std::cerr << deque1[i] << " ";
91 std::cerr<< std::endl;
93 void vectPrintOut(std::vector< double > vect)
95 for(int i = 0; i< (int)vect.size(); i++)
97 std::cerr << vect[i] << " ";
99 std::cerr<< std::endl;
101 void tabPrintOut( const double * tab,int size)
103 for(int i = 0; i< size; i++)
105 std::cerr << tab[i] << " ";
107 std::cerr<< std::endl;
111 * Cleans up after the test suite.
112 * Liberates the MeshTestToolkit object used by the tests.
116 // delete _testTools;
122 // /// MeshTestToolkit object to which the tests are delegated
123 // MeshTestToolkit* _testTools;