wibble
1.1
wibble
singleton.test.h
Go to the documentation of this file.
1
/* -*- C++ -*- (c) 2007 Petr Rockai <me@mornfall.net>
2
(c) 2007 Enrico Zini <enrico@enricozini.org> */
3
4
#include <
wibble/test.h
>
5
#include <
wibble/singleton.h
>
6
7
namespace
{
8
9
using namespace
std;
10
using namespace
wibble
;
11
12
struct
TestSingleton {
13
14
Test
simple() {
15
Singleton<int>
container
=
singleton
(5);
16
17
assert_eq
(
container
.size(), 1u);
18
19
Singleton<int>::iterator
i =
container
.begin();
20
assert
(!(i ==
container
.end()));
21
assert
(i !=
container
.end());
22
assert_eq
(*i, 5);
23
24
++i;
25
assert
(i ==
container
.end());
26
assert
(!(i !=
container
.end()));
27
}
28
29
};
30
31
}
wibble::Singleton::iterator
Definition
singleton.h:60
wibble
Definition
amorph.h:17
wibble::singleton
Singleton< T > singleton(const T &value)
Definition
singleton.h:102
singleton.h
wibble::SanitizeReturn
Definition
amorph.h:30
test.h
assert_eq
#define assert_eq(x, y)
Definition
test.h:33
assert
#define assert(x)
Definition
test.h:30
Generated by
1.9.8