source: PSPA/madxPSPA/tools/numdiff/src/utest.h @ 430

Last change on this file since 430 was 430, checked in by touze, 11 years ago

import madx-5.01.00

File size: 961 bytes
Line 
1#ifndef UTEST_H
2#define UTEST_H
3
4/*
5 o---------------------------------------------------------------------o
6 |
7 | Numdiff
8 |
9 | Copyright (c) 2012+ laurent.deniau@cern.ch
10 | Gnu General Public License
11 |
12 o---------------------------------------------------------------------o
13 
14   Purpose:
15     manage unit tests
16     display results
17 
18 o---------------------------------------------------------------------o
19*/
20
21#include <stdio.h>
22
23// ----- types
24
25struct utest;
26
27// ----- interface
28
29#define T struct utest
30
31T*   utest_alloc (FILE*);
32void utest_free  (T*);
33void utest_title (T*, const char*);
34void utest_init  (T*, const char*);
35void utest_fini  (T*);
36void utest_stat  (T*);
37
38// return the number of failed tests, prefer the UTEST macro
39int  utest_test  (T*, int pass, const char *cond, const char *file, int line);
40
41#undef T
42
43// ----- macros
44
45// assume T* to be named "utest"
46#define UTEST(cond) utest_test(utest, (cond), #cond, __FILE__, __LINE__)
47
48#endif
Note: See TracBrowser for help on using the repository browser.