11extern crate libc;
2+
3+ use std:: os:: raw:: { c_char, c_int, c_long, c_uchar, c_uint, c_ulonglong, c_void} ;
4+
25use crate :: isdbs:: isdbd:: * ;
36use crate :: isdbs:: isdbs:: * ;
47
@@ -111,11 +114,21 @@ mod tests {
111114 raster_color : 0 ,
112115 layout_state : ISDBSubLayout {
113116 format : WritingFormat :: None ,
114- display_area : DisplayArea { x : 0 , y : 0 } ,
117+ display_area : DispArea {
118+ x : 0 ,
119+ y : 0 ,
120+ w : 0 ,
121+ h : 0 ,
122+ } ,
115123 font_size : 0 ,
116- font_scale : FontScale { fscx : 0 , fscy : 0 } ,
124+ font_scale : FScale { fscx : 0 , fscy : 0 } ,
117125 cell_spacing : 0 ,
118- cursor_pos : DisplayArea { x : 0 , y : 0 } ,
126+ cursor_pos : DispArea {
127+ x : 0 ,
128+ y : 0 ,
129+ w : 0 ,
130+ h : 0 ,
131+ } ,
119132 ccc : 0 ,
120133 acps : 0 ,
121134 } ,
@@ -140,11 +153,21 @@ mod tests {
140153 fn test_init_layout ( ) {
141154 let mut layout = ISDBSubLayout {
142155 font_size : 0 ,
143- display_area : DisplayArea { x : 0 , y : 0 } ,
144- font_scale : FontScale { fscx : 0 , fscy : 0 } ,
156+ display_area : DispArea {
157+ x : 0 ,
158+ y : 0 ,
159+ w : 0 ,
160+ h : 0 ,
161+ } ,
162+ font_scale : FScale { fscx : 0 , fscy : 0 } ,
145163 format : WritingFormat :: None ,
146164 cell_spacing : 0 ,
147- cursor_pos : DisplayArea { x : 0 , y : 0 } ,
165+ cursor_pos : DispArea {
166+ x : 0 ,
167+ y : 0 ,
168+ w : 0 ,
169+ h : 0 ,
170+ } ,
148171 ccc : 0 ,
149172 acps : 0 ,
150173 } ;
@@ -185,14 +208,24 @@ mod tests {
185208 fn test_init_layout_custom_values ( ) {
186209 let mut layout = ISDBSubLayout {
187210 font_size : 50 ,
188- display_area : DisplayArea { x : 10 , y : 20 } ,
189- font_scale : FontScale {
211+ display_area : DispArea {
212+ x : 10 ,
213+ y : 20 ,
214+ w : 0 ,
215+ h : 0 ,
216+ } ,
217+ font_scale : FScale {
190218 fscx : 150 ,
191219 fscy : 150 ,
192220 } ,
193221 format : WritingFormat :: None ,
194222 cell_spacing : 0 ,
195- cursor_pos : DisplayArea { x : 0 , y : 0 } ,
223+ cursor_pos : DispArea {
224+ x : 0 ,
225+ y : 0 ,
226+ w : 0 ,
227+ h : 0 ,
228+ } ,
196229 ccc : 0 ,
197230 acps : 0 ,
198231 } ;
@@ -549,7 +582,7 @@ mod tests {
549582 }
550583
551584 #[ test]
552- unsafe fn test_delete_isdb_decoder_with_entries ( ) {
585+ fn test_delete_isdb_decoder_with_entries ( ) {
553586 let mut ctx = ISDBSubContext {
554587 text_list_head : ListHead {
555588 next : ptr:: null_mut ( ) ,
@@ -582,7 +615,7 @@ mod tests {
582615 next : ptr:: null_mut ( ) ,
583616 prev : ptr:: null_mut ( ) ,
584617 } ,
585- buf : alloc ( Layout :: from_size_align ( 128 , 1 ) . unwrap ( ) ) as * mut i8 ,
618+ buf : unsafe { alloc ( Layout :: from_size_align ( 128 , 1 ) . unwrap ( ) ) as * mut i8 } ,
586619 used : 0 ,
587620 len : 128 ,
588621 pos : ISDBPos { x : 0 , y : 0 } ,
@@ -596,7 +629,7 @@ mod tests {
596629 next : ptr:: null_mut ( ) ,
597630 prev : ptr:: null_mut ( ) ,
598631 } ,
599- buf : alloc ( Layout :: from_size_align ( 128 , 1 ) . unwrap ( ) ) as * mut i8 ,
632+ buf : unsafe { alloc ( Layout :: from_size_align ( 128 , 1 ) . unwrap ( ) ) as * mut i8 } ,
600633 used : 0 ,
601634 len : 128 ,
602635 pos : ISDBPos { x : 0 , y : 0 } ,
@@ -640,14 +673,24 @@ mod tests {
640673 fn test_allocate_text_node ( ) {
641674 let layout = ISDBSubLayout {
642675 font_size : 36 ,
643- display_area : DisplayArea { x : 0 , y : 0 } ,
644- font_scale : FontScale {
676+ display_area : DispArea {
677+ x : 0 ,
678+ y : 0 ,
679+ w : 0 ,
680+ h : 0 ,
681+ } ,
682+ font_scale : FScale {
645683 fscx : 100 ,
646684 fscy : 100 ,
647685 } ,
648686 format : WritingFormat :: None ,
649687 cell_spacing : 0 ,
650- cursor_pos : DisplayArea { x : 0 , y : 0 } ,
688+ cursor_pos : DispArea {
689+ x : 0 ,
690+ y : 0 ,
691+ w : 0 ,
692+ h : 0 ,
693+ } ,
651694 ccc : 0 ,
652695 acps : 0 ,
653696 } ;
@@ -785,7 +828,7 @@ mod tests {
785828 }
786829
787830 #[ test]
788- fn test_append_char ( ) {
831+ fn test_append_char_1 ( ) {
789832 let mut ctx = ISDBSubContext {
790833 nb_char : 0 ,
791834 nb_line : 0 ,
@@ -858,7 +901,7 @@ mod tests {
858901 }
859902
860903 #[ test]
861- fn test_list_empty ( ) {
904+ fn test_list_empty_1 ( ) {
862905 let mut head = ListHead {
863906 next : ptr:: null_mut ( ) ,
864907 prev : ptr:: null_mut ( ) ,
@@ -872,7 +915,7 @@ mod tests {
872915 }
873916
874917 #[ test]
875- fn test_append_char ( ) {
918+ fn test_append_char_2 ( ) {
876919 let mut ctx = ISDBSubContext {
877920 nb_char : 0 ,
878921 nb_line : 0 ,
@@ -945,7 +988,7 @@ mod tests {
945988 }
946989
947990 #[ test]
948- fn test_list_empty ( ) {
991+ fn test_list_empty_2 ( ) {
949992 let mut head = ListHead {
950993 next : ptr:: null_mut ( ) ,
951994 prev : ptr:: null_mut ( ) ,
0 commit comments