mirror of
https://github.com/xavo95/repak.git
synced 2025-01-18 19:04:07 +00:00
Remove redundant tests
This commit is contained in:
parent
04c5bbfddc
commit
03358df460
1 changed files with 0 additions and 58 deletions
|
@ -554,61 +554,3 @@ fn encrypt(key: Aes256Enc, bytes: &mut [u8]) {
|
|||
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[..]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue