feat: port commandline tests

This commit is contained in:
dignifiedquire
2019-04-28 00:14:23 +03:00
parent 956609f565
commit 7c50702221
9 changed files with 7218 additions and 4 deletions

View File

@@ -180,7 +180,7 @@ pub const DC_LP_SMTP_SOCKET_FLAGS: usize =
// If you do not want to handle an event, it is always safe to return 0,
// so there is no need to add a "case" for every event.
#[derive(Debug, Clone, Copy)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, FromPrimitive, ToPrimitive)]
#[repr(u32)]
pub enum Event {
/// The library-user may write an informational string to the log.

View File

@@ -1,5 +1,7 @@
use libc;
pub type size_t = libc::c_ulong;
use crate::types::*;
/*
Copyright (c) 2010 Serge A. Zaitsev

View File

@@ -19,9 +19,10 @@
#[macro_use]
extern crate failure;
#[macro_use]
extern crate num_derive;
mod pgp;
mod x;
pub mod dc_aheader;
pub mod dc_apeerstate;
@@ -66,6 +67,7 @@ pub mod dc_strencode;
pub mod dc_token;
pub mod dc_tools;
pub mod types;
pub mod x;
pub mod constants;
pub use self::constants::*;

View File

@@ -13,8 +13,10 @@ extern "C" {
pub type _telldir;
pub type mailstream_cancel;
pub static mut __stdinp: *mut FILE;
}
pub type FILE = libc::FILE;
pub type sqlite_int64 = libc::c_longlong;
pub type sqlite3_int64 = sqlite_int64;
@@ -30,6 +32,16 @@ pub type __darwin_size_t = libc::c_ulong;
pub type __darwin_ssize_t = libc::c_long;
pub type __darwin_time_t = libc::c_long;
pub type __darwin_pid_t = __int32_t;
pub type pthread_attr_t = __darwin_pthread_attr_t;
pub type __darwin_pthread_attr_t = _opaque_pthread_attr_t;
#[derive(Copy, Clone)]
#[repr(C)]
pub struct _opaque_pthread_attr_t {
pub __sig: libc::c_long,
pub __opaque: [libc::c_char; 56],
}
#[derive(Copy, Clone)]
#[repr(C)]
pub struct __darwin_pthread_handler_rec {

View File

@@ -6,6 +6,17 @@ use crate::types::*;
extern "C" {
pub static mut _DefaultRuneLocale: _RuneLocale;
pub fn fgets(_: *mut libc::c_char, _: libc::c_int, _: *mut FILE);
pub fn pthread_create(
_: *mut pthread_t,
_: *const pthread_attr_t,
_: Option<unsafe extern "C" fn(_: *mut libc::c_void) -> *mut libc::c_void>,
_: *mut libc::c_void,
) -> libc::c_int;
pub fn pthread_join(_: pthread_t, _: *mut *mut libc::c_void) -> libc::c_int;
pub fn system(_: *const libc::c_char) -> libc::c_int;
pub fn printf(_: *const libc::c_char, _: ...) -> libc::c_int;
pub fn calloc(_: libc::c_ulong, _: libc::c_ulong) -> *mut libc::c_void;
pub fn free(_: *mut libc::c_void);
pub fn exit(_: libc::c_int) -> !;