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"
31 int main (int argc, char ** argv)
34 cout << "UNIT Test" << endl ;
35 cout << "---------" << endl;
40 testu.setName("ForTesting") ;
42 catch ( const std::exception &e )
44 cout << "-----------------" << endl;
45 cout << " pb avec setName " << endl;
46 cout << "-----------------" << endl;
47 MESSAGE( "catched exception : " << e.what() ) ;
52 cout << "-----------------" << endl;
53 cout << " pb avec setName " << endl;
54 cout << "-----------------" << endl;
60 testu.setDescription("all values are setted 10") ;
62 catch ( const std::exception &e )
64 cout << "------------------------" << endl;
65 cout << " pb avec setDescription " << endl;
66 cout << "------------------------" << endl;
67 MESSAGE( "catched exception : " << e.what() ) ;
72 cout << "------------------------" << endl;
73 cout << " pb avec setDescription " << endl;
74 cout << "------------------------" << endl;
82 catch ( const std::exception &e )
84 cout << "------------------" << endl;
85 cout << " pb avec setMasse " << endl;
86 cout << "------------------" << endl;
87 MESSAGE( "catched exception : " << e.what() ) ;
92 cout << "------------------" << endl;
93 cout << " pb avec setMasse " << endl;
94 cout << "------------------" << endl;
102 catch ( const std::exception &e )
104 cout << "-------------------" << endl;
105 cout << " pb avec setLength " << endl;
106 cout << "-------------------" << endl;
107 MESSAGE( "catched exception : " << e.what() ) ;
108 return EXIT_FAILURE ;
112 cout << "-------------------" << endl;
113 cout << " pb avec setLength " << endl;
114 cout << "-------------------" << endl;
115 return EXIT_FAILURE ;
122 catch ( const std::exception &e )
124 cout << "-----------------" << endl;
125 cout << " pb avec setTime " << endl;
126 cout << "-----------------" << endl;
127 MESSAGE( "catched exception : " << e.what() ) ;
128 return EXIT_FAILURE ;
132 cout << "-----------------" << endl;
133 cout << " pb avec setTime " << endl;
134 cout << "-----------------" << endl;
135 return EXIT_FAILURE ;
140 testu.setTemperature(10);
142 catch ( const std::exception &e )
144 cout << "------------------------" << endl;
145 cout << " pb avec setTemperature " << endl;
146 cout << "------------------------" << endl;
147 MESSAGE( "catched exception : " << e.what() ) ;
148 return EXIT_FAILURE ;
152 cout << "------------------------" << endl;
153 cout << " pb avec setTemperature " << endl;
154 cout << "------------------------" << endl;
155 return EXIT_FAILURE ;
160 testu.setMatterQuantity(10);
162 catch ( const std::exception &e )
164 cout << "---------------------------" << endl;
165 cout << " pb avec setMatterQuantity " << endl;
166 cout << "---------------------------" << endl;
167 MESSAGE( "catched exception : " << e.what() ) ;
168 return EXIT_FAILURE ;
172 cout << "---------------------------" << endl;
173 cout << " pb avec setMatterQuantity " << endl;
174 cout << "---------------------------" << endl;
175 return EXIT_FAILURE ;
180 testu.setCurrentStrength(10) ;
182 catch ( const std::exception &e )
184 cout << "---------------------------" << endl;
185 cout << " pb avec setCurrentStrengt " << endl;
186 cout << "---------------------------" << endl;
187 MESSAGE( "catched exception : " << e.what() ) ;
188 return EXIT_FAILURE ;
192 cout << "---------------------------" << endl;
193 cout << " pb avec setCurrentStrengt " << endl;
194 cout << "---------------------------" << endl;
195 return EXIT_FAILURE ;
200 testu.setLightIntensity(10) ;
202 catch ( const std::exception &e )
204 cout << "---------------------------" << endl;
205 cout << " pb avec setLightIntensity " << endl;
206 cout << "---------------------------" << endl;
207 MESSAGE( "catched exception : " << e.what() ) ;
208 return EXIT_FAILURE ;
212 cout << "---------------------------" << endl;
213 cout << " pb avec setLightIntensity " << endl;
214 cout << "---------------------------" << endl;
215 return EXIT_FAILURE ;
221 cout << testu.getName() << endl ;
223 catch ( const std::exception &e )
225 cout << "-----------------" << endl;
226 cout << " pb avec getName " << endl;
227 cout << "-----------------" << endl;
228 MESSAGE( "catched exception : " << e.what() ) ;
229 return EXIT_FAILURE ;
233 cout << "-----------------" << endl;
234 cout << " pb avec getName " << endl;
235 cout << "-----------------" << endl;
236 return EXIT_FAILURE ;
241 cout << testu.getDescription() << endl ;
243 catch ( const std::exception &e )
245 cout << "------------------------" << endl;
246 cout << " pb avec getDescription " << endl;
247 cout << "------------------------" << endl;
248 MESSAGE( "catched exception : " << e.what() ) ;
249 return EXIT_FAILURE ;
253 cout << "------------------------" << endl;
254 cout << " pb avec getDescription " << endl;
255 cout << "------------------------" << endl;
256 return EXIT_FAILURE ;
261 cout << testu.getMasse() << endl ;
263 catch ( const std::exception &e )
265 cout << "------------------" << endl;
266 cout << " pb avec getMasse " << endl;
267 cout << "------------------" << endl;
268 MESSAGE( "catched exception : " << e.what() ) ;
269 return EXIT_FAILURE ;
273 cout << "------------------" << endl;
274 cout << " pb avec getMasse " << endl;
275 cout << "------------------" << endl;
276 return EXIT_FAILURE ;
281 cout << testu.getLength() << endl ;
283 catch ( const std::exception &e )
285 cout << "-------------------" << endl;
286 cout << " pb avec getLength " << endl;
287 cout << "-------------------" << endl;
288 MESSAGE( "catched exception : " << e.what() ) ;
289 return EXIT_FAILURE ;
293 cout << "-------------------" << endl;
294 cout << " pb avec getLength " << endl;
295 cout << "-------------------" << endl;
296 return EXIT_FAILURE ;
301 cout << testu.getTime() << endl ;
303 catch ( const std::exception &e )
305 cout << "-----------------" << endl;
306 cout << " pb avec getTime " << endl;
307 cout << "-----------------" << endl;
308 MESSAGE( "catched exception : " << e.what() ) ;
309 return EXIT_FAILURE ;
313 cout << "-----------------" << endl;
314 cout << " pb avec getTime " << endl;
315 cout << "-----------------" << endl;
316 return EXIT_FAILURE ;
321 cout << testu.getTemperature() << endl ;
323 catch ( const std::exception &e )
325 cout << "------------------------" << endl;
326 cout << " pb avec getTemperature " << endl;
327 cout << "------------------------" << endl;
328 MESSAGE( "catched exception : " << e.what() ) ;
329 return EXIT_FAILURE ;
333 cout << "------------------------" << endl;
334 cout << " pb avec getTemperature " << endl;
335 cout << "------------------------" << endl;
336 return EXIT_FAILURE ;
341 cout << testu.getMatterQuantity() << endl ;
343 catch ( const std::exception &e )
345 cout << "---------------------------" << endl;
346 cout << " pb avec getMatterQuantity " << endl;
347 cout << "---------------------------" << endl;
348 MESSAGE( "catched exception : " << e.what() ) ;
349 return EXIT_FAILURE ;
353 cout << "---------------------------" << endl;
354 cout << " pb avec getMatterQuantity " << endl;
355 cout << "---------------------------" << endl;
356 return EXIT_FAILURE ;
361 cout << testu.getCurrentStrength() << endl ;
363 catch ( const std::exception &e )
365 cout << "----------------------------" << endl;
366 cout << " pb avec getCurrentStrength " << endl;
367 cout << "----------------------------" << endl;
368 MESSAGE( "catched exception : " << e.what() ) ;
369 return EXIT_FAILURE ;
373 cout << "----------------------------" << endl;
374 cout << " pb avec getCurrentStrength " << endl;
375 cout << "----------------------------" << endl;
376 return EXIT_FAILURE ;
381 cout << testu.getLightIntensity() << endl ;
383 catch ( const std::exception &e )
385 cout << "---------------------------" << endl;
386 cout << " pb avec getLightIntensity " << endl;
387 cout << "---------------------------" << endl;
388 MESSAGE( "catched exception : " << e.what() ) ;
389 return EXIT_FAILURE ;
393 cout << "---------------------------" << endl;
394 cout << " pb avec getLightIntensity " << endl;
395 cout << "---------------------------" << endl;
396 return EXIT_FAILURE ;
399 return EXIT_SUCCESS ;