singleton.test.h
Go to the documentation of this file.
/* -*- C++ -*- (c) 2007 Petr Rockai <me@mornfall.net>
(c) 2007 Enrico Zini <enrico@enricozini.org> */
#include <wibble/test.h>
#include <wibble/singleton.h>
namespace {
using namespace std;
using namespace wibble;
struct TestSingleton {
Test simple() {
Singleton<int> container = singleton(5);
assert_eq(container.size(), 1u);
Singleton<int>::iterator i = container.begin();
assert(!(i == container.end()));
assert(i != container.end());
assert_eq(*i, 5);
++i;
assert(i == container.end());
assert(!(i != container.end()));
}
};
}
wibble::Singleton::size
size_t size() const
Definition: singleton.h:82
singleton.h
wibble::Singleton::begin
iterator begin()
Definition: singleton.h:84
wibble::Singleton
Definition: singleton.h:32
Test
void Test
Definition: test.h:178
test.h
std
assert_eq
#define assert_eq(x, y)
Definition: test.h:33
assert
#define assert(x)
Definition: test.h:30
wibble::singleton
Singleton< T > singleton(const T &value)
Definition: singleton.h:102
wibble::Singleton::iterator
Definition: singleton.h:59
wibble
Definition: amorph.h:17
wibble::Singleton::end
iterator end()
Definition: singleton.h:85