Remove redundant tests

This commit is contained in:
Truman Kilen 2023-02-07 23:07:07 -06:00
parent 04c5bbfddc
commit 03358df460

View file

@ -554,61 +554,3 @@ fn encrypt(key: Aes256Enc, bytes: &mut [u8]) {
key.encrypt_block(aes::Block::from_mut_slice(chunk)) key.encrypt_block(aes::Block::from_mut_slice(chunk))
} }
} }
#[cfg(test)]
mod test {
#[test]
fn test_rewrite_pak_v8b() {
use std::io::Cursor;
let bytes = include_bytes!("../tests/packs/pack_v8b.pak");
let mut reader = Cursor::new(bytes);
let pak_reader = super::PakReader::new_any(&mut reader, None).unwrap();
let writer = Cursor::new(vec![]);
let mut pak_writer = super::PakWriter::new(
writer,
None,
super::Version::V8B,
pak_reader.mount_point().to_owned(),
None,
);
for path in pak_reader.files() {
let data = pak_reader.get(&path, &mut reader).unwrap();
pak_writer
.write_file(&path, &mut std::io::Cursor::new(data))
.unwrap();
}
let out_bytes = pak_writer.write_index().unwrap().into_inner();
assert_eq!(&bytes[..], &out_bytes[..]);
}
#[test]
fn test_rewrite_pak_v11() {
use std::io::Cursor;
let bytes = include_bytes!("../tests/packs/pack_v11.pak");
let mut reader = Cursor::new(bytes);
let pak_reader = super::PakReader::new_any(&mut reader, None).unwrap();
let writer = Cursor::new(vec![]);
let mut pak_writer = super::PakWriter::new(
writer,
None,
super::Version::V11,
pak_reader.mount_point().to_owned(),
Some(0x205C5A7D),
);
for path in pak_reader.files() {
let data = pak_reader.get(&path, &mut reader).unwrap();
pak_writer
.write_file(&path, &mut std::io::Cursor::new(data))
.unwrap();
}
let out_bytes = pak_writer.write_index().unwrap().into_inner();
assert_eq!(&bytes[..], &out_bytes[..]);
}
}