1
Fork 0
mirror of https://github.com/redstrate/Kawari.git synced 2025-05-20 17:47:46 +00:00

Restore the test_packet_sizes test

This commit is contained in:
Joshua Goins 2025-03-18 19:53:56 -04:00
parent d2df321159
commit 1314659402

View file

@ -224,12 +224,31 @@ pub async fn send_keep_alive<T: ReadWriteIpcSegment>(
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
// TODO: Restore this test use crate::packet::IpcSegment;
/*
use super::*; use super::*;
/// Ensure that the packet size as reported matches up with what we write /// Ensure that the packet size as reported matches up with what we write
#[test] #[test]
fn test_packet_sizes() { fn test_packet_sizes() {
#[binrw]
#[brw(repr = u16)]
#[derive(Clone, PartialEq, Debug)]
enum ClientLobbyIpcType {
Dummy = 0x1,
}
#[binrw]
#[br(import(magic: &ClientLobbyIpcType))]
#[derive(Debug, Clone)]
enum ClientLobbyIpcData {
Dummy(),
}
type ClientLobbyIpcSegment = IpcSegment<ClientLobbyIpcType, ClientLobbyIpcData>;
impl ReadWriteIpcSegment for ClientLobbyIpcSegment {}
let packet_types = [ let packet_types = [
SegmentType::InitializeEncryption { SegmentType::InitializeEncryption {
phrase: String::new(), phrase: String::new(),
@ -249,7 +268,7 @@ mod tests {
for packet in &packet_types { for packet in &packet_types {
let mut cursor = Cursor::new(Vec::new()); let mut cursor = Cursor::new(Vec::new());
let packet_segment = PacketSegment { let packet_segment: PacketSegment<ClientLobbyIpcSegment> = PacketSegment {
source_actor: 0, source_actor: 0,
target_actor: 0, target_actor: 0,
segment_type: packet.clone(), segment_type: packet.clone(),
@ -260,5 +279,5 @@ mod tests {
assert_eq!(buffer.len(), packet_segment.calc_size() as usize); assert_eq!(buffer.len(), packet_segment.calc_size() as usize);
} }
}*/ }
} }