mirror of
https://github.com/chatmail/core.git
synced 2026-05-03 05:16:28 +03:00
test that bad credentials do not panic
This commit is contained in:
@@ -660,3 +660,32 @@ pub fn read_autoconf_file(context: &Context, url: &str) -> *mut libc::c_char {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod tests {
|
||||||
|
|
||||||
|
use crate::test_utils::*;
|
||||||
|
use crate::config::*;
|
||||||
|
use crate::configure::dc_job_do_DC_JOB_CONFIGURE_IMAP;
|
||||||
|
use crate::job::*;
|
||||||
|
use crate::param::*;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_no_panic_on_bad_credentials() {
|
||||||
|
let t = dummy_context();
|
||||||
|
t.ctx.set_config(Config::Addr, Some("probably@unexistant.addr")).unwrap();
|
||||||
|
t.ctx.set_config(Config::MailPw, Some("123456")).unwrap();
|
||||||
|
let job = Job {
|
||||||
|
job_id: 1,
|
||||||
|
action: Action::ConfigureImap,
|
||||||
|
foreign_id: 0,
|
||||||
|
desired_timestamp: 0,
|
||||||
|
added_timestamp: 0,
|
||||||
|
tries: 0,
|
||||||
|
param: Params::new(),
|
||||||
|
try_again: 0,
|
||||||
|
pending_error: None,
|
||||||
|
};
|
||||||
|
unsafe { dc_job_do_DC_JOB_CONFIGURE_IMAP(&t.ctx, &job); }
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user