mirror of
https://github.com/ArcaneChat/core.git
synced 2026-07-03 14:05:33 +02:00
test: move test_arr_to_string() to dc_array.rs
This commit is contained in:
+14
-1
@@ -404,6 +404,20 @@ mod tests {
|
||||
use super::*;
|
||||
use std::ffi::CStr;
|
||||
|
||||
#[test]
|
||||
fn test_dc_arr_to_string() {
|
||||
let arr2: [uint32_t; 4] = [
|
||||
0i32 as uint32_t,
|
||||
12i32 as uint32_t,
|
||||
133i32 as uint32_t,
|
||||
1999999i32 as uint32_t,
|
||||
];
|
||||
|
||||
let str_0 = unsafe { dc_arr_to_string(arr2.as_ptr(), 4i32) };
|
||||
assert_eq!(to_string(str_0), "0,12,133,1999999");
|
||||
unsafe { free(str_0 as *mut _) };
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_dc_array() {
|
||||
unsafe {
|
||||
@@ -491,5 +505,4 @@ mod tests {
|
||||
dc_array_unref(arr);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -952,17 +952,3 @@ fn test_stress_tests() {
|
||||
stress_functions(&context.ctx);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_arr_to_string() {
|
||||
let arr2: [uint32_t; 4] = [
|
||||
0i32 as uint32_t,
|
||||
12i32 as uint32_t,
|
||||
133i32 as uint32_t,
|
||||
1999999i32 as uint32_t,
|
||||
];
|
||||
|
||||
let str_0 = unsafe { dc_arr_to_string(arr2.as_ptr(), 4i32) };
|
||||
assert_eq!(to_string(str_0), "0,12,133,1999999");
|
||||
unsafe { free(str_0 as *mut _) };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user