Skip #[cfg(test)] and mod tests, not needed

This commit is contained in:
Lars-Magnus Skog
2019-05-11 17:51:35 +02:00
parent c9b6bb6a9b
commit e3e56d9f7e

View File

@@ -4467,20 +4467,16 @@ unsafe fn stress_functions(context: &dc_context_t) {
};
}
#[cfg(test)]
mod tests {
use super::*;
unsafe extern "C" fn cb(
unsafe extern "C" fn cb(
_context: &dc_context_t,
_event: Event,
_data1: uintptr_t,
_data2: uintptr_t,
) -> uintptr_t {
) -> uintptr_t {
0
}
}
unsafe fn create_context() -> dc_context_t {
unsafe fn create_context() -> dc_context_t {
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();
@@ -4494,13 +4490,12 @@ mod tests {
);
ctx
}
}
#[test]
fn run_stress_tests() {
#[test]
fn run_stress_tests() {
unsafe {
let ctx = create_context();
stress_functions(&ctx);
}
}
}