Ver Fonte

test: guarantee code coverage, we'll update the test later on

Michele Caini há 2 anos atrás
pai
commit
29298c0eb1
1 ficheiros alterados com 21 adições e 20 exclusões
  1. 21 20
      test/snapshot/snapshot.cpp

+ 21 - 20
test/snapshot/snapshot.cpp

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