File: test_singleton.cpp

package info (click to toggle)
libwibble 0.1.9
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 500 kB
  • ctags: 1,183
  • sloc: cpp: 5,760; sh: 113; makefile: 71
file content (29 lines) | stat: -rw-r--r-- 575 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <wibble/config.h>
#include <wibble/singleton.h>
using namespace std;
using namespace wibble;

#include <wibble/tests/tut-wibble.h>

namespace tut {

struct singleton_shar {};
TESTGRP( singleton );

template<> template<>
void to::test< 1 >() {
    Singleton<int> container = singleton(5);

    ensure_equals(container.size(), 1u);

    Singleton<int>::iterator i = container.begin();
    ensure(!(i == container.end()));
    ensure(i != container.end());
    ensure_equals(*i, 5);

    ++i;
    ensure(i == container.end());
    ensure(!(i != container.end()));
}

}