| 21 | using namespace loco; |
| 22 | |
| 23 | TEST(PemutationTest, feature) |
| 24 | { |
| 25 | Permutation<Domain::Feature> perm; |
| 26 | |
| 27 | // All values are invalid at the beginning |
| 28 | ASSERT_FALSE(perm.mapped(FeatureAxis::Count)); |
| 29 | ASSERT_FALSE(perm.mapped(FeatureAxis::Depth)); |
| 30 | ASSERT_FALSE(perm.mapped(FeatureAxis::Height)); |
| 31 | ASSERT_FALSE(perm.mapped(FeatureAxis::Width)); |
| 32 | |
| 33 | // Update mapping |
| 34 | perm[FeatureAxis::Count] = 5; |
| 35 | perm[FeatureAxis::Depth] = 6; |
| 36 | perm[FeatureAxis::Height] = 7; |
| 37 | perm[FeatureAxis::Width] = 8; |
| 38 | |
| 39 | // Now perm has a mapping for all the axes |
| 40 | ASSERT_TRUE(perm.mapped(FeatureAxis::Count)); |
| 41 | ASSERT_TRUE(perm.mapped(FeatureAxis::Depth)); |
| 42 | ASSERT_TRUE(perm.mapped(FeatureAxis::Height)); |
| 43 | ASSERT_TRUE(perm.mapped(FeatureAxis::Width)); |
| 44 | |
| 45 | // Check the value |
| 46 | ASSERT_EQ(5, perm[FeatureAxis::Count]); |
| 47 | ASSERT_EQ(6, perm[FeatureAxis::Depth]); |
| 48 | ASSERT_EQ(7, perm[FeatureAxis::Height]); |
| 49 | ASSERT_EQ(8, perm[FeatureAxis::Width]); |
| 50 | } |
| 51 | |
| 52 | TEST(PemutationTest, filter) |
| 53 | { |