no message
git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@58 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
parent
0fd2f91c64
commit
386bf14a8c
1 changed files with 19 additions and 16 deletions
|
@ -23,29 +23,32 @@ struct DataGeneratorsTest : public Test
|
|||
{
|
||||
this->printName(result);
|
||||
|
||||
using namespace Loki;
|
||||
using namespace Loki::TL;
|
||||
|
||||
bool b;
|
||||
typedef Loki::TL::MakeTypelist<>::Result null_tl;
|
||||
typedef Loki::TL::MakeTypelist<char,
|
||||
unsigned char,
|
||||
signed char,
|
||||
wchar_t>::Result char_types;
|
||||
int n = Loki::TL::Length<char_types>::value;
|
||||
typedef MakeTypelist<>::Result null_tl;
|
||||
typedef MakeTypelist<char,
|
||||
unsigned char,
|
||||
signed char,
|
||||
wchar_t>::Result char_types;
|
||||
int n = Length<char_types>::value;
|
||||
|
||||
std::vector<const char*> names;
|
||||
names.reserve(n);
|
||||
Loki::TL::IterateTypes<char_types, Loki::TL::name_from_type> makenames;
|
||||
//Some gcc fascist decided to make all temporaries /const/!
|
||||
makenames(remove_const(std::back_inserter(names)));
|
||||
//Some fascist decided that all temporaries should be const.
|
||||
//The following line of code stupidity is a direct result of the half-baked idea
|
||||
iterate_types<char_types, name_from_type>(remove_const(std::back_inserter(names)));
|
||||
b = names.size() == n;
|
||||
testAssert("iterate_types - Check Length", b, result);
|
||||
|
||||
std::vector<size_t> sizes;
|
||||
sizes.reserve(n);
|
||||
typedef Loki::TL::MakeTypelist<char,
|
||||
short,
|
||||
int,
|
||||
double>::Result some_types;
|
||||
Loki::TL::iterate_types<some_types, Loki::TL::sizeof_type>(remove_const(std::back_inserter(sizes)));
|
||||
typedef MakeTypelist<char,
|
||||
short,
|
||||
int,
|
||||
double>::Result some_types;
|
||||
iterate_types<some_types, sizeof_type>(remove_const(std::back_inserter(sizes)));
|
||||
size_t apriori_size[] = {sizeof(char), sizeof(short), sizeof(int), sizeof(double)};
|
||||
b = true;
|
||||
for(int i=0; i<n; ++i)
|
||||
|
@ -53,12 +56,12 @@ struct DataGeneratorsTest : public Test
|
|||
testAssert("iterate_types - Check Elements", b, result);
|
||||
|
||||
sizes.resize(0);
|
||||
Loki::TL::iterate_types<null_tl, Loki::TL::sizeof_type>(sizes);
|
||||
iterate_types<null_tl, sizeof_type>(sizes);
|
||||
b = sizes.size() == 0;
|
||||
testAssert("iterate_types - Degenerate Case 1 - Null List", b, result);
|
||||
|
||||
sizes.resize(0);
|
||||
Loki::TL::iterate_types<Loki::NullType, Loki::TL::sizeof_type>(sizes);
|
||||
iterate_types<Loki::NullType, sizeof_type>(sizes);
|
||||
b = sizes.size() == 0;
|
||||
testAssert("iterate_types - Degenerate Case 2 - NullType", b, result);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue