mirror of
https://github.com/chatmail/core.git
synced 2026-04-18 14:06:29 +03:00
Make dc_open arguments rusty
This commit is contained in:
@@ -7,8 +7,6 @@ use tempfile::{tempdir, TempDir};
|
||||
use crate::context::{dc_context_new, dc_open, Context};
|
||||
use crate::types::dc_callback_t;
|
||||
|
||||
use crate::dc_tools::OsStrExt;
|
||||
|
||||
/// A Context and temporary directory.
|
||||
///
|
||||
/// The temporary directory can be used to store the SQLite database,
|
||||
@@ -29,10 +27,8 @@ pub fn test_context(cb: Option<dc_callback_t>) -> TestContext {
|
||||
let mut ctx = dc_context_new(cb, std::ptr::null_mut(), std::ptr::null_mut());
|
||||
let dir = tempdir().unwrap();
|
||||
let dbfile = dir.path().join("db.sqlite");
|
||||
let dbfile_c = dbfile.to_c_string().unwrap();
|
||||
assert_eq!(
|
||||
dc_open(&mut ctx, dbfile_c.as_ptr(), std::ptr::null()),
|
||||
1,
|
||||
assert!(
|
||||
dc_open(&mut ctx, dbfile.to_str().unwrap(), None),
|
||||
"Failed to open {}",
|
||||
dbfile.display(),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user