mirror of
https://github.com/Devolutions/IronRDP.git
synced 2025-07-07 17:45:01 +00:00
test: regression test case for cliprdr_format target (#405)
This commit is contained in:
parent
220df049b6
commit
e92d8c3e17
12 changed files with 31 additions and 14 deletions
|
@ -199,9 +199,9 @@ impl BitmapInfoHeader {
|
|||
|
||||
let size = src.read_u32();
|
||||
|
||||
let width = src.read_i32();
|
||||
|
||||
// NOTE: .abs() could panic on i32::MIN, therefore we have a check for it first.
|
||||
|
||||
let width = src.read_i32();
|
||||
check_invariant(width != i32::MIN && width.abs() <= 10_000)
|
||||
.ok_or_else(|| invalid_message_err!("biWidth", "width is too big"))?;
|
||||
|
||||
|
|
Binary file not shown.
28
crates/ironrdp-testsuite-core/tests/fuzz_regression.rs
Normal file
28
crates/ironrdp-testsuite-core/tests/fuzz_regression.rs
Normal file
|
@ -0,0 +1,28 @@
|
|||
macro_rules! check {
|
||||
($oracle:ident) => {{
|
||||
use ironrdp_fuzzing::oracles;
|
||||
|
||||
const REGRESSION_DATA_FOLDER: &str = concat!(
|
||||
env!("CARGO_MANIFEST_DIR"),
|
||||
concat!("/test_data/fuzz_regression/", stringify!($oracle))
|
||||
);
|
||||
|
||||
println!("Read directory {REGRESSION_DATA_FOLDER}");
|
||||
for entry in std::fs::read_dir(REGRESSION_DATA_FOLDER).unwrap() {
|
||||
let entry = entry.unwrap();
|
||||
println!("Check {}", entry.path().display());
|
||||
let test_case = std::fs::read(entry.path()).unwrap();
|
||||
oracles::$oracle(&test_case);
|
||||
}
|
||||
}};
|
||||
}
|
||||
|
||||
#[test]
|
||||
pub fn check_pdu_decode() {
|
||||
check!(pdu_decode);
|
||||
}
|
||||
|
||||
#[test]
|
||||
pub fn check_cliprdr_format() {
|
||||
check!(cliprdr_format);
|
||||
}
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
mod clipboard;
|
||||
mod displaycontrol;
|
||||
mod fuzz_regression;
|
||||
mod graphics;
|
||||
mod input;
|
||||
mod pcb;
|
||||
|
|
|
@ -4,6 +4,5 @@ mod input;
|
|||
mod mcs;
|
||||
mod pointer;
|
||||
mod rdp;
|
||||
mod regression;
|
||||
mod rfx;
|
||||
mod x224;
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
const REGRESSION_DATA_FOLDER: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/test_data/pdu/regression/");
|
||||
|
||||
#[test]
|
||||
pub fn check() {
|
||||
for entry in std::fs::read_dir(REGRESSION_DATA_FOLDER).unwrap() {
|
||||
let entry = entry.unwrap();
|
||||
println!("Check {}", entry.path().display());
|
||||
let test_case = std::fs::read(entry.path()).unwrap();
|
||||
ironrdp_fuzzing::oracles::pdu_decode(&test_case);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue