From e97f6acccd31673fa96a1b2fc4f302388103af0f Mon Sep 17 00:00:00 2001 From: Lars-Magnus Skog Date: Fri, 7 Jun 2019 19:42:05 +0200 Subject: [PATCH] test: move test_arr_to_string() to dc_array.rs --- src/dc_array.rs | 15 ++++++++++++++- tests/stress.rs | 14 -------------- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/dc_array.rs b/src/dc_array.rs index be10d86ec..a079dc03c 100644 --- a/src/dc_array.rs +++ b/src/dc_array.rs @@ -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); } } - } diff --git a/tests/stress.rs b/tests/stress.rs index cb245e21e..5a7b6eaba 100644 --- a/tests/stress.rs +++ b/tests/stress.rs @@ -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 _) }; -}