Преглед изворни кода

test: use the new snapshot get functions in the test suite

Michele Caini пре 2 година
родитељ
комит
5c704636ef
1 измењених фајлова са 19 додато и 19 уклоњено
  1. 19 19
      test/snapshot/snapshot.cpp

+ 19 - 19
test/snapshot/snapshot.cpp

@@ -65,20 +65,20 @@ TEST(Snapshot, Full) {
         // output finishes flushing its contents when it goes out of scope
         // output finishes flushing its contents when it goes out of scope
         cereal::JSONOutputArchive output{storage};
         cereal::JSONOutputArchive output{storage};
         entt::snapshot{source}
         entt::snapshot{source}
-            .entities(output)
-            .component<position>(output)
-            .component<timer>(output)
-            .component<relationship>(output)
-            .component<entt::tag<"empty"_hs>>(output);
+            .get<entt::entity>(output)
+            .get<position>(output)
+            .get<timer>(output)
+            .get<relationship>(output)
+            .get<entt::tag<"empty"_hs>>(output);
     }
     }
 
 
     cereal::JSONInputArchive input{storage};
     cereal::JSONInputArchive input{storage};
     entt::snapshot_loader{destination}
     entt::snapshot_loader{destination}
-        .entities(input)
-        .component<position>(input)
-        .component<timer>(input)
-        .component<relationship>(input)
-        .component<entt::tag<"empty"_hs>>(input);
+        .get<entt::entity>(input)
+        .get<position>(input)
+        .get<timer>(input)
+        .get<relationship>(input)
+        .get<entt::tag<"empty"_hs>>(input);
 
 
     ASSERT_TRUE(destination.valid(e0));
     ASSERT_TRUE(destination.valid(e0));
     ASSERT_TRUE(destination.all_of<position>(e0));
     ASSERT_TRUE(destination.all_of<position>(e0));
@@ -140,20 +140,20 @@ TEST(Snapshot, Continuous) {
         // output finishes flushing its contents when it goes out of scope
         // output finishes flushing its contents when it goes out of scope
         cereal::JSONOutputArchive output{storage};
         cereal::JSONOutputArchive output{storage};
         entt::snapshot{source}
         entt::snapshot{source}
-            .entities(output)
-            .component<position>(output)
-            .component<relationship>(output)
-            .component<timer>(output)
-            .component<entt::tag<"empty"_hs>>(output);
+            .get<entt::entity>(output)
+            .get<position>(output)
+            .get<relationship>(output)
+            .get<timer>(output)
+            .get<entt::tag<"empty"_hs>>(output);
     }
     }
 
 
     cereal::JSONInputArchive input{storage};
     cereal::JSONInputArchive input{storage};
     entt::continuous_loader loader{destination};
     entt::continuous_loader loader{destination};
     loader.entities(input)
     loader.entities(input)
-        .component<position>(input)
-        .component<relationship>(input, &relationship::parent)
-        .component<timer>(input)
-        .component<entt::tag<"empty"_hs>>(input);
+        .get<position>(input)
+        .get<relationship, &relationship::parent>(input)
+        .get<timer>(input)
+        .get<entt::tag<"empty"_hs>>(input);
 
 
     ASSERT_FALSE(destination.valid(e0));
     ASSERT_FALSE(destination.valid(e0));
     ASSERT_TRUE(loader.contains(e0));
     ASSERT_TRUE(loader.contains(e0));