Add fuzzy-test for dc_mimeparser_parser

This commit is contained in:
Dmitry Bogatov
2019-09-15 01:57:21 +00:00
committed by holger krekel
parent 7b73103133
commit a773b7929c

View File

@@ -1546,6 +1546,7 @@ pub unsafe fn mailimf_find_optional_field(
mod tests {
use super::*;
use crate::test_utils::*;
use proptest::prelude::*;
use std::ffi::CStr;
#[test]
@@ -1630,6 +1631,14 @@ mod tests {
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]
fn test_mimeparser_with_context() {
unsafe {