StRoot
1
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Groups
Pages
StEEmcPool
macros
TTM
tdd.C
1
// a cheap implementation of real TDD
2
// this actually is very hard in C-scheiss-scheiss
3
4
class
Assert
{
5
6
public
:
7
static
bool
IsEqual(
double
v,
double
a,
double
eps=0.001)
8
{
9
assert(fabs(v-a)<eps);
10
}
11
12
static
bool
IsEqual(
int
v,
int
a)
13
{
14
assert(v==a);
15
}
16
17
18
static
bool
IsEqual(
const
char
*v,
const
char
*a,
int
len=0)
19
{
20
if
(len<=0) len=strlen(v);
21
assert(strncmp(v,a,len)==0);
22
}
23
24
static
bool
IsTrue(
bool
l)
25
{
26
assert(l==
true
);
27
}
28
29
30
static
bool
IsFalse(
bool
l)
31
{
32
assert(l==
false
);
33
}
34
35
36
private
:
37
Assert
();
38
~
Assert
();
39
40
};
41
Assert
Definition:
tdd.C:4
Generated by
1.8.5