test: move dc_atof/dc_ftoa tests to dc_tools.rs

This commit is contained in:
Lars-Magnus Skog
2019-05-13 15:00:15 +02:00
parent 4183141424
commit ab96264c1a
2 changed files with 19 additions and 23 deletions

View File

@@ -544,29 +544,6 @@ unsafe fn stress_functions(context: &dc_context_t) {
} else {
};
free(mime_0 as *mut libc::c_void);
let f: libc::c_double = dc_atof(b"1.23\x00" as *const u8 as *const libc::c_char);
if 0 != !(f > 1.22f64 && f < 1.24f64) as libc::c_int as libc::c_long {
__assert_rtn(
(*::std::mem::transmute::<&[u8; 17], &[libc::c_char; 17]>(b"stress_functions\x00"))
.as_ptr(),
b"../cmdline/stress.c\x00" as *const u8 as *const libc::c_char,
374i32,
b"f>1.22 && f<1.24\x00" as *const u8 as *const libc::c_char,
);
} else {
};
let s: *mut libc::c_char = dc_ftoa(1.23f64);
if 0 != !(dc_atof(s) > 1.22f64 && dc_atof(s) < 1.24f64) as libc::c_int as libc::c_long {
__assert_rtn(
(*::std::mem::transmute::<&[u8; 17], &[libc::c_char; 17]>(b"stress_functions\x00"))
.as_ptr(),
b"../cmdline/stress.c\x00" as *const u8 as *const libc::c_char,
377i32,
b"dc_atof(s)>1.22 && dc_atof(s)<1.24\x00" as *const u8 as *const libc::c_char,
);
} else {
};
free(s as *mut libc::c_void);
let mut str: *mut libc::c_char = strdup(b"aaa\x00" as *const u8 as *const libc::c_char);
let replacements: libc::c_int = dc_str_replace(