mirror of
https://github.com/chatmail/core.git
synced 2026-05-05 14:26:30 +03:00
Skip #[cfg(test)] and mod tests, not needed
This commit is contained in:
@@ -4467,40 +4467,35 @@ unsafe fn stress_functions(context: &dc_context_t) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
unsafe extern "C" fn cb(
|
||||||
mod tests {
|
_context: &dc_context_t,
|
||||||
use super::*;
|
_event: Event,
|
||||||
|
_data1: uintptr_t,
|
||||||
|
_data2: uintptr_t,
|
||||||
|
) -> uintptr_t {
|
||||||
|
0
|
||||||
|
}
|
||||||
|
|
||||||
unsafe extern "C" fn cb(
|
unsafe fn create_context() -> dc_context_t {
|
||||||
_context: &dc_context_t,
|
let mut ctx = dc_context_new(cb, std::ptr::null_mut(), std::ptr::null_mut());
|
||||||
_event: Event,
|
let dir = tempdir().unwrap();
|
||||||
_data1: uintptr_t,
|
let dbfile = CString::new(dir.path().join("db.sqlite").to_str().unwrap()).unwrap();
|
||||||
_data2: uintptr_t,
|
assert_eq!(
|
||||||
) -> uintptr_t {
|
dc_open(&mut ctx, dbfile.as_ptr(), std::ptr::null()),
|
||||||
0
|
1,
|
||||||
}
|
"Failed to open {}",
|
||||||
|
CStr::from_ptr(dbfile.as_ptr() as *const libc::c_char)
|
||||||
|
.to_str()
|
||||||
|
.unwrap()
|
||||||
|
);
|
||||||
|
|
||||||
unsafe fn create_context() -> dc_context_t {
|
ctx
|
||||||
let mut ctx = dc_context_new(cb, std::ptr::null_mut(), std::ptr::null_mut());
|
}
|
||||||
let dir = tempdir().unwrap();
|
|
||||||
let dbfile = CString::new(dir.path().join("db.sqlite").to_str().unwrap()).unwrap();
|
|
||||||
assert_eq!(
|
|
||||||
dc_open(&mut ctx, dbfile.as_ptr(), std::ptr::null()),
|
|
||||||
1,
|
|
||||||
"Failed to open {}",
|
|
||||||
CStr::from_ptr(dbfile.as_ptr() as *const libc::c_char)
|
|
||||||
.to_str()
|
|
||||||
.unwrap()
|
|
||||||
);
|
|
||||||
|
|
||||||
ctx
|
#[test]
|
||||||
}
|
fn run_stress_tests() {
|
||||||
|
unsafe {
|
||||||
#[test]
|
let ctx = create_context();
|
||||||
fn run_stress_tests() {
|
stress_functions(&ctx);
|
||||||
unsafe {
|
|
||||||
let ctx = create_context();
|
|
||||||
stress_functions(&ctx);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user