1 // Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
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.
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 _MEDMEMTEST_HXX_
21 #define _MEDMEMTEST_HXX_
23 #include "MEDMEMCppTestExport.hxx"
24 #include "MEDMEMTest_Utils.hxx"
26 #include <cppunit/extensions/HelperMacros.h>
27 #include "MEDMEM_Field.hxx"
38 class MEDMEMCPPTEST_EXPORT MEDMEMTest : public CppUnit::TestFixture
40 CPPUNIT_TEST_SUITE( MEDMEMTest );
42 CPPUNIT_TEST( testArray );
43 CPPUNIT_TEST( testArrayConvert );
44 //CPPUNIT_TEST( testArrayInterface /* not in spec */ );
45 CPPUNIT_TEST( testAsciiFieldDriver );
46 //CPPUNIT_TEST( testCellModel /* not in spec */ );
47 CPPUNIT_TEST( testConnectivity );
48 CPPUNIT_TEST( testCoordinate );
49 CPPUNIT_TEST( testDriverFactory );
50 //CPPUNIT_TEST( testDriversDef /* not in spec */ );
52 //CPPUNIT_TEST( testDriverTools /* not in spec */ );
53 //CPPUNIT_TEST( testException /* not in spec */ );
54 CPPUNIT_TEST( testFamily );
55 CPPUNIT_TEST( testField );
56 CPPUNIT_TEST( testFieldConvert );
57 CPPUNIT_TEST( testFormulae );
58 CPPUNIT_TEST( testGaussLocalization );
59 CPPUNIT_TEST( testGibiMeshDriver );
61 //CPPUNIT_TEST( testGrid );
62 CPPUNIT_TEST( testGroup );
63 CPPUNIT_TEST( testIndexCheckingPolicy );
64 CPPUNIT_TEST( testInit /* cxx */ );
65 //CPPUNIT_TEST( testInterlacingPolicy /* not in spec */ );
66 //CPPUNIT_TEST( testInterlacingTraits /* not in spec */ );
67 CPPUNIT_TEST( testMedFieldDriver );
68 CPPUNIT_TEST( testReadFieldOnNodesAndCells );
69 //CPPUNIT_TEST( testMedFieldDriver /* not in spec */ );
70 CPPUNIT_TEST( testMedFileBrowser );
72 //CPPUNIT_TEST( testMEDMEMchampLire /* not in spec */ );
73 //CPPUNIT_TEST( testMEDMEMgaussEcr /* not in spec */ );
74 //CPPUNIT_TEST( testMEDMEMprofilEcr /* not in spec */ );
75 CPPUNIT_TEST( testMedMeshDriver );
76 //CPPUNIT_TEST( testMedMeshDriver /* not in spec */ );
77 CPPUNIT_TEST( testMedVersion );
79 CPPUNIT_TEST( testMeshAndMeshing );
80 CPPUNIT_TEST( testModulusArray );
81 CPPUNIT_TEST( testnArray );
82 CPPUNIT_TEST( testPartialDescendingConnectivity );
83 CPPUNIT_TEST( testPointerOf );
84 CPPUNIT_TEST( testPorflowMeshDriver );
85 //CPPUNIT_TEST( testRCBase /* not in spec */ );
86 //CPPUNIT_TEST( testSetInterlacingType /* not in spec */ );
87 CPPUNIT_TEST( testSkyLineArray );
89 CPPUNIT_TEST( testSTRING );
90 CPPUNIT_TEST( testSupport );
91 //CPPUNIT_TEST( testTags /* not in spec */ );
92 //CPPUNIT_TEST( testTopLevel );
93 // CPPUNIT_TEST( testTypeMeshDriver );
94 CPPUNIT_TEST( testUnit );
95 CPPUNIT_TEST( testVtkFieldDriver );
96 CPPUNIT_TEST( testVtkMedDriver );
97 CPPUNIT_TEST( testVtkMeshDriver );
98 //CPPUNIT_TEST( testmedimport_src /* not in spec */ );
100 CPPUNIT_TEST( testExtractor );
101 CPPUNIT_TEST( testMeshFuse );
102 CPPUNIT_TEST( testDesactivateFacesComputation ); // issue 0020411
103 CPPUNIT_TEST( testGetVolumeAbs );
104 CPPUNIT_TEST( test_remapper4 );
105 CPPUNIT_TEST( test_remapper5 );
106 CPPUNIT_TEST( test_remapper6 );
107 CPPUNIT_TEST( test_remapper7 );
108 CPPUNIT_TEST( test_remapper3DTo1D );
109 CPPUNIT_TEST( test_RemapperP0P0 );
110 CPPUNIT_TEST( test_RemapperP1P1 );
111 CPPUNIT_TEST( test_RemapperP1P0 );
112 CPPUNIT_TEST( test_RemapperP0P1 );
113 CPPUNIT_TEST( testGetGaussPointsCoordinates );
114 CPPUNIT_TEST_SUITE_END();
121 void testArrayConvert();
122 //void testArrayInterface() /* not in spec */;
123 void testAsciiFieldDriver();
124 //void testCellModel() /* not in spec */;
125 void testConnectivity();
126 void testCoordinate();
127 void testDriverFactory();
128 //void testDriversDef() /* not in spec */;
130 //void testDriverTools() /* not in spec */;
131 void testException() /* not in spec */;
134 void testFieldConvert();
136 void testGaussLocalization();
137 void testGibiMeshDriver();
141 void testIndexCheckingPolicy();
142 void testInit() /* cxx */;
143 //void testInterlacingPolicy() /* not in spec */;
144 //void testInterlacingTraits() /* not in spec */;
145 void testMedFieldDriver();
146 void testReadFieldOnNodesAndCells();
147 //void testMedFieldDriver /* not in spec */();
148 void testMedFileBrowser();
150 //void testMEDMEMchampLire() /* not in spec */;
151 //void testMEDMEMgaussEcr() /* not in spec */;
152 //void testMEDMEMprofilEcr() /* not in spec */;
153 void testMedMeshDriver();
154 //void testMedMeshDriver() /* not in spec */;
155 void testMedVersion();
157 void testMeshAndMeshing();
158 void testModulusArray();
160 void testPartialDescendingConnectivity();
161 void testPointerOf();
162 void testPorflowMeshDriver();
163 //void testRCBase() /* not in spec */;
164 //void testSetInterlacingType /* IMED_MESH_RDWR_DRIVER(driver), not in spec */();
165 void testSkyLineArray();
169 //void testTags() /* not in spec */;
171 void testTypeMeshDriver();
173 void testVtkFieldDriver();
174 void testVtkMedDriver();
175 void testVtkMeshDriver();
176 //void testmedimport_src() /* not in spec */;
178 void testExtractor();
180 void testDesactivateFacesComputation(); // issue 0020411
181 void testGetVolumeAbs();
182 void test_RemapperP0P0();
183 void test_RemapperP1P1();
184 void test_RemapperP1P0();
185 void test_RemapperP0P1();
186 void test_remapper4();
187 void test_remapper5();
188 void test_remapper6();
189 void test_remapper7();
190 void test_remapper3DTo1D();
191 void testGetGaussPointsCoordinates();
194 void absField(MEDMEM::FIELD<double>&);
196 double sumAll(const std::vector< std::map<int,double> >& matrix);
199 // to create a mesh with certain filling
200 MEDMEMCPPTEST_EXPORT MEDMEM::MESH * MEDMEMTest_createTestMesh();
202 // to automatically remove temporary files from disk
203 class MEDMEMCPPTEST_EXPORT MEDMEMTest_TmpFilesRemover
206 MEDMEMTest_TmpFilesRemover() {}
207 ~MEDMEMTest_TmpFilesRemover();
208 bool Register(const std::string theTmpFile);
211 std::set<std::string> myTmpFiles;
215 * Tool to print array to stream.
218 void MEDMEMTest_DumpArray (std::ostream & stream, const T* array, const int length, const std::string text)
220 stream << text << ": {";
223 for (int i = 1; i < length; i++) {
224 stream << ", " << array[i];
227 stream << "}" << std::endl;