wibble 0.1.28
|
00001 /* -*- C++ -*- (c) 2007 Petr Rockai <me@mornfall.net> 00002 (c) 2007 Enrico Zini <enrico@enricozini.org> */ 00003 00004 #include <wibble/test.h> 00005 #include <wibble/singleton.h> 00006 00007 namespace { 00008 00009 using namespace std; 00010 using namespace wibble; 00011 00012 struct TestSingleton { 00013 00014 Test simple() { 00015 Singleton<int> container = singleton(5); 00016 00017 assert_eq(container.size(), 1u); 00018 00019 Singleton<int>::iterator i = container.begin(); 00020 assert(!(i == container.end())); 00021 assert(i != container.end()); 00022 assert_eq(*i, 5); 00023 00024 ++i; 00025 assert(i == container.end()); 00026 assert(!(i != container.end())); 00027 } 00028 00029 }; 00030 00031 }