@@ -5,6 +5,8 @@ use std::os::raw::{c_char, c_int, c_long, c_uchar, c_uint, c_ulonglong, c_void};
5
5
use crate :: isdbs:: isdbd:: * ;
6
6
use crate :: isdbs:: isdbs:: * ;
7
7
8
+ use std:: ffi:: CStr ;
9
+
8
10
#[ cfg( test) ]
9
11
mod tests {
10
12
use super :: * ;
@@ -123,12 +125,7 @@ mod tests {
123
125
font_size : 0 ,
124
126
font_scale : FScale { fscx : 0 , fscy : 0 } ,
125
127
cell_spacing : 0 ,
126
- cursor_pos : DispArea {
127
- x : 0 ,
128
- y : 0 ,
129
- w : 0 ,
130
- h : 0 ,
131
- } ,
128
+ cursor_pos : ISDBPos { x : 0 , y : 0 } ,
132
129
ccc : 0 ,
133
130
acps : 0 ,
134
131
} ,
@@ -162,12 +159,7 @@ mod tests {
162
159
font_scale : FScale { fscx : 0 , fscy : 0 } ,
163
160
format : WritingFormat :: None ,
164
161
cell_spacing : 0 ,
165
- cursor_pos : DispArea {
166
- x : 0 ,
167
- y : 0 ,
168
- w : 0 ,
169
- h : 0 ,
170
- } ,
162
+ cursor_pos : ISDBPos { x : 0 , y : 0 } ,
171
163
ccc : 0 ,
172
164
acps : 0 ,
173
165
} ;
@@ -220,12 +212,7 @@ mod tests {
220
212
} ,
221
213
format : WritingFormat :: None ,
222
214
cell_spacing : 0 ,
223
- cursor_pos : DispArea {
224
- x : 0 ,
225
- y : 0 ,
226
- w : 0 ,
227
- h : 0 ,
228
- } ,
215
+ cursor_pos : ISDBPos { x : 0 , y : 0 } ,
229
216
ccc : 0 ,
230
217
acps : 0 ,
231
218
} ;
@@ -290,9 +277,6 @@ mod tests {
290
277
}
291
278
}
292
279
293
- use super :: * ;
294
- use std:: ptr;
295
-
296
280
#[ test]
297
281
fn test___list_del ( ) {
298
282
let mut head = ListHead {
@@ -411,9 +395,6 @@ mod tests {
411
395
}
412
396
}
413
397
414
- use super :: * ;
415
- use std:: ptr;
416
-
417
398
#[ test]
418
399
fn test_list_for_each_entry_safe ( ) {
419
400
let mut head = ListHead {
@@ -685,12 +666,7 @@ mod tests {
685
666
} ,
686
667
format : WritingFormat :: None ,
687
668
cell_spacing : 0 ,
688
- cursor_pos : DispArea {
689
- x : 0 ,
690
- y : 0 ,
691
- w : 0 ,
692
- h : 0 ,
693
- } ,
669
+ cursor_pos : ISDBPos { x : 0 , y : 0 } ,
694
670
ccc : 0 ,
695
671
acps : 0 ,
696
672
} ;
@@ -719,7 +695,7 @@ mod tests {
719
695
buf : unsafe { alloc ( Layout :: from_size_align ( 128 , 1 ) . unwrap ( ) ) } as * mut i8 ,
720
696
used : 0 ,
721
697
len : 128 ,
722
- pos : Position { x : 0 , y : 0 } ,
698
+ pos : ISDBPos { x : 0 , y : 0 } ,
723
699
txt_tail : ptr:: null_mut ( ) ,
724
700
timestamp : 0 ,
725
701
refcount : 0 ,
@@ -737,9 +713,6 @@ mod tests {
737
713
}
738
714
}
739
715
740
- use super :: * ;
741
- use std:: ptr;
742
-
743
716
#[ test]
744
717
fn test_list_add ( ) {
745
718
let mut head = ListHead {
@@ -893,7 +866,7 @@ mod tests {
893
866
}
894
867
895
868
#[ test]
896
- fn test_ccx_strstr_ignorespace ( ) {
869
+ fn test_ccx_strstr_ignorespace_1 ( ) {
897
870
let str1 = CString :: new ( "hello world" ) . unwrap ( ) ;
898
871
let str2 = CString :: new ( "hello world" ) . unwrap ( ) ;
899
872
let result = ccx_strstr_ignorespace ( str1. as_ptr ( ) , str2. as_ptr ( ) ) ;
@@ -980,7 +953,7 @@ mod tests {
980
953
}
981
954
982
955
#[ test]
983
- fn test_ccx_strstr_ignorespace ( ) {
956
+ fn test_ccx_strstr_ignorespace_2 ( ) {
984
957
let str1 = CString :: new ( "hello world" ) . unwrap ( ) ;
985
958
let str2 = CString :: new ( "hello world" ) . unwrap ( ) ;
986
959
let result = ccx_strstr_ignorespace ( str1. as_ptr ( ) , str2. as_ptr ( ) ) ;
0 commit comments