Skip to content

Commit

Permalink
test: Delete a unit test that's no longer needed
Browse files Browse the repository at this point in the history
  • Loading branch information
Pr0methean committed Jun 4, 2024
1 parent 362a112 commit b4970dd
Showing 1 changed file with 3 additions and 62 deletions.
65 changes: 3 additions & 62 deletions src/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1908,18 +1908,16 @@ const EXTRA_FIELD_MAPPING: [u16; 49] = [

#[cfg(test)]
mod test {
use super::{ExtendedFileOptions, FileOptions, ZipWriter};
use super::{FileOptions, ZipWriter};
use crate::compression::CompressionMethod;
use crate::result::ZipResult;
use crate::types::DateTime;
use crate::write::EncryptWith::Aes;
use crate::write::SimpleFileOptions;
use crate::CompressionMethod::{Deflated, Stored};
use crate::{AesMode, ZipArchive};
use crate::CompressionMethod::{Stored};
use crate::{ZipArchive};
use std::io;
use std::io::{Cursor, Read, Write};
use std::path::PathBuf;
use std::sync::Arc;

#[test]
fn write_empty_zip() {
Expand Down Expand Up @@ -2490,61 +2488,4 @@ mod test {
let _ = ZipArchive::new(first_writer.finish()?)?;
Ok(())
}

#[test]
fn test_fuzz_failure_2024_06_04() -> ZipResult<()> {
let mut writer = ZipWriter::new(Cursor::new(Vec::new()));
writer.set_flush_on_finish_file(false);
let options = FileOptions {
compression_method: Deflated,
compression_level: Some(20),
last_modified_time: DateTime::from_date_and_time(2107, 4, 8, 7, 0, 19)?,
permissions: Some(4281355088),
large_file: false,
encrypt_with: Some(Aes {
mode: AesMode::Aes128,
password: "",
}),
extended_options: ExtendedFileOptions {
extra_data: Arc::new(vec![]),
central_extra_data: Arc::new(vec![]),
},
alignment: 14335,
zopfli_buffer_size: Some(9223372036854775808),
};
writer.start_file_from_path("", options)?;
writer.write_all(&[46])?;
writer.write_all(&[])?;
writer.write_all(&[41, 0])?;
writer.write_all(&[255, 255, 46])?;
writer.write_all(&[])?;
writer.write_all(&[41, 0])?;
writer.write_all(&[255, 7])?;
writer.write_all(&[80, 255])?;
writer.write_all(&[6, 255])?;
writer.write_all(&[41, 255, 246, 255, 255, 255])?;
writer.write_all(&[255, 7])?;
writer.write_all(&[255])?;
writer.write_all(&[255, 7])?;
writer.write_all(&[80, 255])?;
writer.write_all(&[255, 45])?;
writer.write_all(&[56, 255, 0, 255, 56, 195, 255, 7])?;
writer.write_all(&[80, 255])?;
writer.write_all(&[246, 255, 255, 255, 7])?;
writer.write_all(&[80, 255, 255])?;
writer.write_all(&[255, 7])?;
writer.write_all(&[80, 255])?;
writer.write_all(&[255])?;
writer.write_all(
&[
56, 195, 255, 7, 80, 255, 246, 255, 255, 255, 7, 80, 255, 6, 255, 255, 0, 255, 80,
255, 7, 80, 255, 44, 255, 246, 255, 255, 255, 7, 80, 255, 255, 56, 195, 255, 7, 80,
255, 246, 255, 255, 255, 7, 80, 255, 255, 255, 7, 2, 75, 255, 56, 195, 255, 7, 80,
255, 246, 255, 255, 255, 7, 80, 255, 6, 255, 41, 255, 255, 7, 80, 255, 255, 45, 52,
255, 0, 255, 255, 0, 255, 80, 255, 246,
]
)?;
writer.finish_into_readable()?;
Ok(())
}
}

0 comments on commit b4970dd

Please sign in to comment.