From 068935d1050c56d5cb20791b0444bf6d71af40ff Mon Sep 17 00:00:00 2001 From: Jake Probst Date: Wed, 4 Sep 2019 09:20:53 -0700 Subject: [PATCH] fix test --- src/login/character.rs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/login/character.rs b/src/login/character.rs index e2cfc21..fbf2eff 100644 --- a/src/login/character.rs +++ b/src/login/character.rs @@ -174,7 +174,7 @@ impl ServerState for CharacterServerState { Box::new(self.char_select(sel).into_iter().map(move |pkt| (id, pkt))) } RecvCharacterPacket::Checksum(checksum) => { - Box::new(self.validate_checksum().into_iter()) + Box::new(self.validate_checksum().into_iter().map(move |pkt| (id, pkt))) } } } @@ -225,14 +225,13 @@ mod test { #[test] fn test_user_checksum() { - struct TestData {} - impl DataAccess for TestData{} - let shared = SharedLoginState::new(TestData {}); - let mut server = CharacterServerState::new(shared); - let send = server.handle(&RecvCharacterPacket::Checksum(Checksum {flag: 0})).collect::>(); + struct TestData; + impl DataAccess for TestData {} + let mut server = CharacterServerState::new(TestData {}); + let send = server.handle(1, &RecvCharacterPacket::Checksum(Checksum {flag: 0})).collect::>(); assert!(send.len() == 1); - let bytes = send[0].as_bytes(); + let bytes = send[0].1.as_bytes(); assert!(bytes == [0xC, 0, 0xE8, 0x02, 0,0,0,0, 1,0,0,0]); } -} \ No newline at end of file +}