1 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License.
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
22 // File : testUUnit.cxx
29 #include "MEDMEM_Unit.hxx"
30 using namespace MEDMEM;
32 int main (int argc, char ** argv)
35 cout << "UNIT Test" << endl ;
36 cout << "---------" << endl;
41 testu.setName("ForTesting") ;
43 catch ( const std::exception &e )
45 cout << "-----------------" << endl;
46 cout << " pb avec setName " << endl;
47 cout << "-----------------" << endl;
48 MESSAGE( "catched exception : " << e.what() ) ;
53 cout << "-----------------" << endl;
54 cout << " pb avec setName " << endl;
55 cout << "-----------------" << endl;
61 testu.setDescription("all values are setted 10") ;
63 catch ( const std::exception &e )
65 cout << "------------------------" << endl;
66 cout << " pb avec setDescription " << endl;
67 cout << "------------------------" << endl;
68 MESSAGE( "catched exception : " << e.what() ) ;
73 cout << "------------------------" << endl;
74 cout << " pb avec setDescription " << endl;
75 cout << "------------------------" << endl;
83 catch ( const std::exception &e )
85 cout << "------------------" << endl;
86 cout << " pb avec setMasse " << endl;
87 cout << "------------------" << endl;
88 MESSAGE( "catched exception : " << e.what() ) ;
93 cout << "------------------" << endl;
94 cout << " pb avec setMasse " << endl;
95 cout << "------------------" << endl;
103 catch ( const std::exception &e )
105 cout << "-------------------" << endl;
106 cout << " pb avec setLength " << endl;
107 cout << "-------------------" << endl;
108 MESSAGE( "catched exception : " << e.what() ) ;
109 return EXIT_FAILURE ;
113 cout << "-------------------" << endl;
114 cout << " pb avec setLength " << endl;
115 cout << "-------------------" << endl;
116 return EXIT_FAILURE ;
123 catch ( const std::exception &e )
125 cout << "-----------------" << endl;
126 cout << " pb avec setTime " << endl;
127 cout << "-----------------" << endl;
128 MESSAGE( "catched exception : " << e.what() ) ;
129 return EXIT_FAILURE ;
133 cout << "-----------------" << endl;
134 cout << " pb avec setTime " << endl;
135 cout << "-----------------" << endl;
136 return EXIT_FAILURE ;
141 testu.setTemperature(10);
143 catch ( const std::exception &e )
145 cout << "------------------------" << endl;
146 cout << " pb avec setTemperature " << endl;
147 cout << "------------------------" << endl;
148 MESSAGE( "catched exception : " << e.what() ) ;
149 return EXIT_FAILURE ;
153 cout << "------------------------" << endl;
154 cout << " pb avec setTemperature " << endl;
155 cout << "------------------------" << endl;
156 return EXIT_FAILURE ;
161 testu.setMatterQuantity(10);
163 catch ( const std::exception &e )
165 cout << "---------------------------" << endl;
166 cout << " pb avec setMatterQuantity " << endl;
167 cout << "---------------------------" << endl;
168 MESSAGE( "catched exception : " << e.what() ) ;
169 return EXIT_FAILURE ;
173 cout << "---------------------------" << endl;
174 cout << " pb avec setMatterQuantity " << endl;
175 cout << "---------------------------" << endl;
176 return EXIT_FAILURE ;
181 testu.setCurrentStrength(10) ;
183 catch ( const std::exception &e )
185 cout << "---------------------------" << endl;
186 cout << " pb avec setCurrentStrengt " << endl;
187 cout << "---------------------------" << endl;
188 MESSAGE( "catched exception : " << e.what() ) ;
189 return EXIT_FAILURE ;
193 cout << "---------------------------" << endl;
194 cout << " pb avec setCurrentStrengt " << endl;
195 cout << "---------------------------" << endl;
196 return EXIT_FAILURE ;
201 testu.setLightIntensity(10) ;
203 catch ( const std::exception &e )
205 cout << "---------------------------" << endl;
206 cout << " pb avec setLightIntensity " << endl;
207 cout << "---------------------------" << endl;
208 MESSAGE( "catched exception : " << e.what() ) ;
209 return EXIT_FAILURE ;
213 cout << "---------------------------" << endl;
214 cout << " pb avec setLightIntensity " << endl;
215 cout << "---------------------------" << endl;
216 return EXIT_FAILURE ;
222 cout << testu.getName() << endl ;
224 catch ( const std::exception &e )
226 cout << "-----------------" << endl;
227 cout << " pb avec getName " << endl;
228 cout << "-----------------" << endl;
229 MESSAGE( "catched exception : " << e.what() ) ;
230 return EXIT_FAILURE ;
234 cout << "-----------------" << endl;
235 cout << " pb avec getName " << endl;
236 cout << "-----------------" << endl;
237 return EXIT_FAILURE ;
242 cout << testu.getDescription() << endl ;
244 catch ( const std::exception &e )
246 cout << "------------------------" << endl;
247 cout << " pb avec getDescription " << endl;
248 cout << "------------------------" << endl;
249 MESSAGE( "catched exception : " << e.what() ) ;
250 return EXIT_FAILURE ;
254 cout << "------------------------" << endl;
255 cout << " pb avec getDescription " << endl;
256 cout << "------------------------" << endl;
257 return EXIT_FAILURE ;
262 cout << testu.getMasse() << endl ;
264 catch ( const std::exception &e )
266 cout << "------------------" << endl;
267 cout << " pb avec getMasse " << endl;
268 cout << "------------------" << endl;
269 MESSAGE( "catched exception : " << e.what() ) ;
270 return EXIT_FAILURE ;
274 cout << "------------------" << endl;
275 cout << " pb avec getMasse " << endl;
276 cout << "------------------" << endl;
277 return EXIT_FAILURE ;
282 cout << testu.getLength() << endl ;
284 catch ( const std::exception &e )
286 cout << "-------------------" << endl;
287 cout << " pb avec getLength " << endl;
288 cout << "-------------------" << endl;
289 MESSAGE( "catched exception : " << e.what() ) ;
290 return EXIT_FAILURE ;
294 cout << "-------------------" << endl;
295 cout << " pb avec getLength " << endl;
296 cout << "-------------------" << endl;
297 return EXIT_FAILURE ;
302 cout << testu.getTime() << endl ;
304 catch ( const std::exception &e )
306 cout << "-----------------" << endl;
307 cout << " pb avec getTime " << endl;
308 cout << "-----------------" << endl;
309 MESSAGE( "catched exception : " << e.what() ) ;
310 return EXIT_FAILURE ;
314 cout << "-----------------" << endl;
315 cout << " pb avec getTime " << endl;
316 cout << "-----------------" << endl;
317 return EXIT_FAILURE ;
322 cout << testu.getTemperature() << endl ;
324 catch ( const std::exception &e )
326 cout << "------------------------" << endl;
327 cout << " pb avec getTemperature " << endl;
328 cout << "------------------------" << endl;
329 MESSAGE( "catched exception : " << e.what() ) ;
330 return EXIT_FAILURE ;
334 cout << "------------------------" << endl;
335 cout << " pb avec getTemperature " << endl;
336 cout << "------------------------" << endl;
337 return EXIT_FAILURE ;
342 cout << testu.getMatterQuantity() << endl ;
344 catch ( const std::exception &e )
346 cout << "---------------------------" << endl;
347 cout << " pb avec getMatterQuantity " << endl;
348 cout << "---------------------------" << endl;
349 MESSAGE( "catched exception : " << e.what() ) ;
350 return EXIT_FAILURE ;
354 cout << "---------------------------" << endl;
355 cout << " pb avec getMatterQuantity " << endl;
356 cout << "---------------------------" << endl;
357 return EXIT_FAILURE ;
362 cout << testu.getCurrentStrength() << endl ;
364 catch ( const std::exception &e )
366 cout << "----------------------------" << endl;
367 cout << " pb avec getCurrentStrength " << endl;
368 cout << "----------------------------" << endl;
369 MESSAGE( "catched exception : " << e.what() ) ;
370 return EXIT_FAILURE ;
374 cout << "----------------------------" << endl;
375 cout << " pb avec getCurrentStrength " << endl;
376 cout << "----------------------------" << endl;
377 return EXIT_FAILURE ;
382 cout << testu.getLightIntensity() << endl ;
384 catch ( const std::exception &e )
386 cout << "---------------------------" << endl;
387 cout << " pb avec getLightIntensity " << endl;
388 cout << "---------------------------" << endl;
389 MESSAGE( "catched exception : " << e.what() ) ;
390 return EXIT_FAILURE ;
394 cout << "---------------------------" << endl;
395 cout << " pb avec getLightIntensity " << endl;
396 cout << "---------------------------" << endl;
397 return EXIT_FAILURE ;
400 return EXIT_SUCCESS ;