mirror of
https://github.com/chatmail/core.git
synced 2026-05-19 23:06:32 +03:00
Add fuzzy-test for dc_mimeparser_parser
This commit is contained in:
committed by
holger krekel
parent
7b73103133
commit
a773b7929c
@@ -1546,6 +1546,7 @@ pub unsafe fn mailimf_find_optional_field(
|
|||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::test_utils::*;
|
use crate::test_utils::*;
|
||||||
|
use proptest::prelude::*;
|
||||||
use std::ffi::CStr;
|
use std::ffi::CStr;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@@ -1630,6 +1631,14 @@ mod tests {
|
|||||||
assert_eq!(mimeparser.parts.len(), 1);
|
assert_eq!(mimeparser.parts.len(), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
proptest! {
|
||||||
|
#[test]
|
||||||
|
fn test_dc_mailmime_parse_crash_fuzzy(data in "[!-~\t ]{2000,}") {
|
||||||
|
let context = dummy_context();
|
||||||
|
unsafe { dc_mimeparser_parse(&context.ctx, data.as_bytes()) }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_mimeparser_with_context() {
|
fn test_mimeparser_with_context() {
|
||||||
unsafe {
|
unsafe {
|
||||||
|
|||||||
Reference in New Issue
Block a user