diff options
Diffstat (limited to 'src/test/propertywatchgentest.cpp')
-rw-r--r-- | src/test/propertywatchgentest.cpp | 80 |
1 files changed, 36 insertions, 44 deletions
diff --git a/src/test/propertywatchgentest.cpp b/src/test/propertywatchgentest.cpp index 5973f92..2e446a4 100644 --- a/src/test/propertywatchgentest.cpp +++ b/src/test/propertywatchgentest.cpp @@ -12,48 +12,42 @@ using Index = std::map<std::tuple<size_t, size_t, size_t>, size_t>; auto expectedStorageCount = 16; -const std::array<Index, 4> expectedIndicies = -{ +const std::array<Index, 4> expectedIndicies = {{ { - { - {Index::key_type{0, 0, 0}, 0}, - {Index::key_type{0, 1, 0}, 1}, - {Index::key_type{1, 0, 0}, 2}, - {Index::key_type{1, 1, 0}, 3}, - {Index::key_type{2, 0, 0}, 4}, - {Index::key_type{2, 1, 0}, 5}, - {Index::key_type{3, 0, 0}, 6}, - {Index::key_type{3, 1, 0}, 7}, - }, - { - {Index::key_type{2, 2, 1}, 8}, - {Index::key_type{2, 2, 2}, 9}, - {Index::key_type{3, 2, 1}, 10}, - {Index::key_type{3, 2, 2}, 11}, - {Index::key_type{4, 2, 1}, 12}, - {Index::key_type{4, 2, 2}, 13}, - {Index::key_type{5, 2, 1}, 14}, - {Index::key_type{5, 2, 2}, 15}, - }, - { - {Index::key_type{3, 0, 0}, 6}, - }, - { - {Index::key_type{3, 2, 2}, 11}, - {Index::key_type{5, 2, 2}, 15}, - }, - } -}; - -const std::array<std::tuple<std::string, size_t>, 4> expectedWatches = -{ + {Index::key_type{0, 0, 0}, 0}, + {Index::key_type{0, 1, 0}, 1}, + {Index::key_type{1, 0, 0}, 2}, + {Index::key_type{1, 1, 0}, 3}, + {Index::key_type{2, 0, 0}, 4}, + {Index::key_type{2, 1, 0}, 5}, + {Index::key_type{3, 0, 0}, 6}, + {Index::key_type{3, 1, 0}, 7}, + }, { - std::tuple<std::string, size_t>{"std::string"s, 0}, - std::tuple<std::string, size_t>{"uint32_t"s, 1}, - std::tuple<std::string, size_t>{"int32_t"s, 2}, - std::tuple<std::string, size_t>{"std::string"s, 3}, - } -}; + {Index::key_type{2, 2, 1}, 8}, + {Index::key_type{2, 2, 2}, 9}, + {Index::key_type{3, 2, 1}, 10}, + {Index::key_type{3, 2, 2}, 11}, + {Index::key_type{4, 2, 1}, 12}, + {Index::key_type{4, 2, 2}, 13}, + {Index::key_type{5, 2, 1}, 14}, + {Index::key_type{5, 2, 2}, 15}, + }, + { + {Index::key_type{3, 0, 0}, 6}, + }, + { + {Index::key_type{3, 2, 2}, 11}, + {Index::key_type{5, 2, 2}, 15}, + }, +}}; + +const std::array<std::tuple<std::string, size_t>, 4> expectedWatches = {{ + std::tuple<std::string, size_t>{"std::string"s, 0}, + std::tuple<std::string, size_t>{"uint32_t"s, 1}, + std::tuple<std::string, size_t>{"int32_t"s, 2}, + std::tuple<std::string, size_t>{"std::string"s, 3}, +}}; TEST(PropertyWatchGenTest, storageCount) { @@ -75,8 +69,7 @@ TEST(PropertyWatchGenTest, WatchesSameContent) size_t i; for (i = 0; i < expectedWatches.size(); ++i) { - ASSERT_EQ(watches[i], - expectedWatches[i]); + ASSERT_EQ(watches[i], expectedWatches[i]); } } @@ -85,7 +78,6 @@ TEST(PropertyWatchGenTest, IndiciesSameContent) size_t i; for (i = 0; i < expectedIndicies.size(); ++i) { - ASSERT_EQ(indices[i], - expectedIndicies[i]); + ASSERT_EQ(indices[i], expectedIndicies[i]); } } |