ソースを参照

code coverage

Michele Caini 6 年 前
コミット
9f8e9a1916
2 ファイル変更6 行追加2 行削除
  1. 1 0
      TODO
  2. 5 2
      test/entt/entity/snapshot.cpp

+ 1 - 0
TODO

@@ -22,6 +22,7 @@
 * early out in views using bitmasks with bloom filter like access based on modulus
   - standard each, use bitmask to speed up the whole thing and avoid accessing the pools to test for the page
   - iterator based each with a couple of iterators passed from outside (use bitmask + has)
+* stable component handle that isn't affected by reallocations
 * multi component registry::remove and some others?
 * move CONTRIBUTING.md within doc (for GitHub)
 * reactive systems

+ 5 - 2
test/entt/entity/snapshot.cpp

@@ -67,6 +67,7 @@ TEST(Snapshot, Dump) {
     registry.assign<int>(e2, 3);
 
     const auto e3 = registry.create();
+    registry.assign<a_component>(e3);
     registry.assign<char>(e3, '0');
 
     registry.destroy(e1);
@@ -77,6 +78,7 @@ TEST(Snapshot, Dump) {
         std::queue<int>,
         std::queue<char>,
         std::queue<double>,
+        std::queue<a_component>,
         std::queue<another_component>
     >;
 
@@ -87,7 +89,7 @@ TEST(Snapshot, Dump) {
     registry.snapshot()
             .entities(output)
             .destroyed(output)
-            .component<int, char, another_component, double>(output);
+            .component<int, char, double, a_component, another_component>(output);
 
     registry.reset();
 
@@ -99,7 +101,7 @@ TEST(Snapshot, Dump) {
     registry.loader()
             .entities(input)
             .destroyed(input)
-            .component<int, char, another_component, double>(input)
+            .component<int, char, double, a_component, another_component>(input)
             .orphans();
 
     ASSERT_TRUE(registry.valid(e0));
@@ -117,6 +119,7 @@ TEST(Snapshot, Dump) {
     ASSERT_EQ(registry.current(e1), v1);
     ASSERT_EQ(registry.get<int>(e2), 3);
     ASSERT_EQ(registry.get<char>(e3), '0');
+    ASSERT_TRUE(registry.has<a_component>(e3));
 
     ASSERT_TRUE(registry.empty<another_component>());
 }