From 635fafc22953c0b587b85dc8e9c614783107a2af Mon Sep 17 00:00:00 2001 From: Hennadii Chernyshchyk Date: Tue, 3 Sep 2024 23:05:57 +0300 Subject: [PATCH] Remove `DummyComponent` from server event tests It's unnecessary. Spawning any replicated entity is enough to trigger the world change. --- tests/server_event.rs | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/tests/server_event.rs b/tests/server_event.rs index 4c7200f6..65c691f6 100644 --- a/tests/server_event.rs +++ b/tests/server_event.rs @@ -206,14 +206,13 @@ fn event_queue() { ..Default::default() }), )) - .replicate::() .add_server_event::(ChannelKind::Ordered); } server_app.connect_client(&mut client_app); // Spawn entity to trigger world change. - server_app.world_mut().spawn((Replicated, DummyComponent)); + server_app.world_mut().spawn(Replicated); server_app.update(); server_app.exchange_with_client(&mut client_app); @@ -316,7 +315,6 @@ fn independent() { ..Default::default() }), )) - .replicate::() .add_server_event::(ChannelKind::Ordered) .make_independent::(); } @@ -324,7 +322,7 @@ fn independent() { server_app.connect_client(&mut client_app); // Spawn entity to trigger world change. - server_app.world_mut().spawn((Replicated, DummyComponent)); + server_app.world_mut().spawn(Replicated); server_app.update(); server_app.exchange_with_client(&mut client_app); @@ -380,14 +378,13 @@ fn before_started_replication() { ..Default::default() }), )) - .replicate::() .add_server_event::(ChannelKind::Ordered); } server_app.connect_client(&mut client_app); // Spawn entity to trigger world change. - server_app.world_mut().spawn((Replicated, DummyComponent)); + server_app.world_mut().spawn(Replicated); server_app.world_mut().send_event(ToClients { mode: SendMode::Broadcast, @@ -416,7 +413,6 @@ fn independent_before_started_replication() { ..Default::default() }), )) - .replicate::() .add_server_event::(ChannelKind::Ordered) .make_independent::(); } @@ -424,7 +420,7 @@ fn independent_before_started_replication() { server_app.connect_client(&mut client_app); // Spawn entity to trigger world change. - server_app.world_mut().spawn((Replicated, DummyComponent)); + server_app.world_mut().spawn(Replicated); server_app.world_mut().send_event(ToClients { mode: SendMode::Broadcast, @@ -452,7 +448,6 @@ fn different_ticks() { ..Default::default() }), )) - .replicate::() .add_server_event::(ChannelKind::Ordered); } @@ -460,7 +455,7 @@ fn different_ticks() { server_app.connect_client(&mut client_app1); // Spawn entity to trigger world change. - server_app.world_mut().spawn((Replicated, DummyComponent)); + server_app.world_mut().spawn(Replicated); // Update client 1 to initialize their replicon tick. server_app.update(); @@ -495,9 +490,6 @@ fn different_ticks() { ); } -#[derive(Component, Serialize, Deserialize)] -struct DummyComponent; - #[derive(Deserialize, Event, Serialize)] struct DummyEvent;