more tests
This commit is contained in:
1
TODO
1
TODO
@@ -7,5 +7,6 @@
|
||||
* does it worth it to add an optional functor to the member functions of snapshot so as to filter out instances and entities?
|
||||
* ease the assignment of tags as string (use a template class with a non-type template parameter behind the scene)
|
||||
* dictionary based dependency class (templates copied over) + prefabs (shared state/copy-on-write)
|
||||
* are const Registry::view/::persistent/::raw possible?
|
||||
* "singleton mode" for tags (see #66)
|
||||
* AOB
|
||||
|
||||
@@ -561,6 +561,37 @@ TEST(RawView, Functionalities) {
|
||||
ASSERT_TRUE(view.empty());
|
||||
}
|
||||
|
||||
TEST(RawView, BeginEnd) {
|
||||
entt::DefaultRegistry registry;
|
||||
auto view = registry.raw<int>();
|
||||
|
||||
for(auto i = 0; i < 3; ++i) {
|
||||
registry.assign<int>(registry.create());
|
||||
}
|
||||
|
||||
auto begin = view.begin();
|
||||
auto end = view.end();
|
||||
|
||||
ASSERT_NE(begin, end);
|
||||
ASSERT_NE(++begin, end);
|
||||
ASSERT_NE(begin++, end);
|
||||
ASSERT_EQ(begin+1, end);
|
||||
ASSERT_NE(begin, end);
|
||||
ASSERT_EQ((begin += 1), end);
|
||||
ASSERT_EQ(begin, end);
|
||||
|
||||
auto cbegin = view.cbegin();
|
||||
auto cend = view.cend();
|
||||
|
||||
ASSERT_NE(cbegin, cend);
|
||||
ASSERT_NE(++cbegin, cend);
|
||||
ASSERT_NE(cbegin++, cend);
|
||||
ASSERT_EQ(cbegin+1, cend);
|
||||
ASSERT_NE(cbegin, cend);
|
||||
ASSERT_EQ((cbegin += 1), cend);
|
||||
ASSERT_EQ(cbegin, cend);
|
||||
}
|
||||
|
||||
TEST(RawView, Empty) {
|
||||
entt::DefaultRegistry registry;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user