#include #include #include struct C0 {}; struct C1 {}; struct C2 {}; struct C3 {}; struct T0 {}; struct T1 {}; using listAll = EC::Meta::TypeList; using listSome = EC::Meta::TypeList; using listTagsAll = EC::Meta::TypeList; TEST(Meta, Contains) { int size = listAll::size; EXPECT_EQ(size, 4); bool result = EC::Meta::Contains::value; EXPECT_TRUE(result); result = EC::Meta::Contains::value; EXPECT_TRUE(result); result = EC::Meta::Contains::value; EXPECT_TRUE(result); result = EC::Meta::Contains::value; EXPECT_TRUE(result); size = listSome::size; EXPECT_EQ(size, 2); result = EC::Meta::Contains::value; EXPECT_FALSE(result); result = EC::Meta::Contains::value; EXPECT_TRUE(result); result = EC::Meta::Contains::value; EXPECT_FALSE(result); result = EC::Meta::Contains::value; EXPECT_TRUE(result); } TEST(Meta, ContainsAll) { bool contains = EC::Meta::ContainsAll::value; EXPECT_TRUE(contains); contains = EC::Meta::ContainsAll::value; EXPECT_FALSE(contains); contains = EC::Meta::ContainsAll::value; EXPECT_TRUE(contains); } TEST(Meta, IndexOf) { int index = EC::Meta::IndexOf::value; EXPECT_EQ(index, 0); index = EC::Meta::IndexOf::value; EXPECT_EQ(index, 1); index = EC::Meta::IndexOf::value; EXPECT_EQ(index, 2); index = EC::Meta::IndexOf::value; EXPECT_EQ(index, 3); index = EC::Meta::IndexOf::value; EXPECT_EQ(index, 0); index = EC::Meta::IndexOf::value; EXPECT_EQ(index, 1); } TEST(Meta, Bitset) { EC::Bitset bitset; EXPECT_EQ(bitset.size(), listAll::size + listTagsAll::size); bitset[1] = true; EXPECT_TRUE(bitset.getComponentBit()); bitset.flip(); EXPECT_FALSE(bitset.getComponentBit()); bitset.reset(); bitset[4] = true; EXPECT_TRUE(bitset.getTagBit()); bitset.flip(); EXPECT_FALSE(bitset.getTagBit()); }