|
|
@@ -129,3 +129,36 @@ TEST(DefaultRegistry, ViewMultipleComponent) {
|
|
|
ASSERT_NO_THROW((registry.view<int, char>().begin()++));
|
|
|
ASSERT_NO_THROW((++registry.view<int, char>().begin()));
|
|
|
}
|
|
|
+
|
|
|
+TEST(DefaultRegistry, EmptyViewSingleComponent) {
|
|
|
+ using registry_type = entt::DefaultRegistry<char, int, double>;
|
|
|
+
|
|
|
+ registry_type registry;
|
|
|
+
|
|
|
+ registry.create<char, double>();
|
|
|
+ registry.create<char>();
|
|
|
+
|
|
|
+ auto view = registry.view<int>();
|
|
|
+
|
|
|
+ ASSERT_EQ(view.size(), registry_type::size_type{0});
|
|
|
+
|
|
|
+ registry.reset();
|
|
|
+}
|
|
|
+
|
|
|
+TEST(DefaultRegistry, EmptyViewMultipleComponent) {
|
|
|
+ using registry_type = entt::DefaultRegistry<char, int, float, double>;
|
|
|
+
|
|
|
+ registry_type registry;
|
|
|
+
|
|
|
+ registry.create<double, int, float>();
|
|
|
+ registry.create<char, float>();
|
|
|
+
|
|
|
+ auto view = registry.view<char, int, float>();
|
|
|
+
|
|
|
+ for(auto entity: view) {
|
|
|
+ (void)entity;
|
|
|
+ FAIL();
|
|
|
+ }
|
|
|
+
|
|
|
+ registry.reset();
|
|
|
+}
|