1
1
extern crate libc;
2
+
3
+ use std:: os:: raw:: { c_char, c_int, c_long, c_uchar, c_uint, c_ulonglong, c_void} ;
4
+
2
5
use crate :: isdbs:: isdbd:: * ;
3
6
use crate :: isdbs:: isdbs:: * ;
4
7
@@ -111,11 +114,21 @@ mod tests {
111
114
raster_color : 0 ,
112
115
layout_state : ISDBSubLayout {
113
116
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
+ } ,
115
123
font_size : 0 ,
116
- font_scale : FontScale { fscx : 0 , fscy : 0 } ,
124
+ font_scale : FScale { fscx : 0 , fscy : 0 } ,
117
125
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
+ } ,
119
132
ccc : 0 ,
120
133
acps : 0 ,
121
134
} ,
@@ -140,11 +153,21 @@ mod tests {
140
153
fn test_init_layout ( ) {
141
154
let mut layout = ISDBSubLayout {
142
155
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 } ,
145
163
format : WritingFormat :: None ,
146
164
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
+ } ,
148
171
ccc : 0 ,
149
172
acps : 0 ,
150
173
} ;
@@ -185,14 +208,24 @@ mod tests {
185
208
fn test_init_layout_custom_values ( ) {
186
209
let mut layout = ISDBSubLayout {
187
210
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 {
190
218
fscx : 150 ,
191
219
fscy : 150 ,
192
220
} ,
193
221
format : WritingFormat :: None ,
194
222
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
+ } ,
196
229
ccc : 0 ,
197
230
acps : 0 ,
198
231
} ;
@@ -549,7 +582,7 @@ mod tests {
549
582
}
550
583
551
584
#[ test]
552
- unsafe fn test_delete_isdb_decoder_with_entries ( ) {
585
+ fn test_delete_isdb_decoder_with_entries ( ) {
553
586
let mut ctx = ISDBSubContext {
554
587
text_list_head : ListHead {
555
588
next : ptr:: null_mut ( ) ,
@@ -582,7 +615,7 @@ mod tests {
582
615
next : ptr:: null_mut ( ) ,
583
616
prev : ptr:: null_mut ( ) ,
584
617
} ,
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 } ,
586
619
used : 0 ,
587
620
len : 128 ,
588
621
pos : ISDBPos { x : 0 , y : 0 } ,
@@ -596,7 +629,7 @@ mod tests {
596
629
next : ptr:: null_mut ( ) ,
597
630
prev : ptr:: null_mut ( ) ,
598
631
} ,
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 } ,
600
633
used : 0 ,
601
634
len : 128 ,
602
635
pos : ISDBPos { x : 0 , y : 0 } ,
@@ -640,14 +673,24 @@ mod tests {
640
673
fn test_allocate_text_node ( ) {
641
674
let layout = ISDBSubLayout {
642
675
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 {
645
683
fscx : 100 ,
646
684
fscy : 100 ,
647
685
} ,
648
686
format : WritingFormat :: None ,
649
687
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
+ } ,
651
694
ccc : 0 ,
652
695
acps : 0 ,
653
696
} ;
@@ -785,7 +828,7 @@ mod tests {
785
828
}
786
829
787
830
#[ test]
788
- fn test_append_char ( ) {
831
+ fn test_append_char_1 ( ) {
789
832
let mut ctx = ISDBSubContext {
790
833
nb_char : 0 ,
791
834
nb_line : 0 ,
@@ -858,7 +901,7 @@ mod tests {
858
901
}
859
902
860
903
#[ test]
861
- fn test_list_empty ( ) {
904
+ fn test_list_empty_1 ( ) {
862
905
let mut head = ListHead {
863
906
next : ptr:: null_mut ( ) ,
864
907
prev : ptr:: null_mut ( ) ,
@@ -872,7 +915,7 @@ mod tests {
872
915
}
873
916
874
917
#[ test]
875
- fn test_append_char ( ) {
918
+ fn test_append_char_2 ( ) {
876
919
let mut ctx = ISDBSubContext {
877
920
nb_char : 0 ,
878
921
nb_line : 0 ,
@@ -945,7 +988,7 @@ mod tests {
945
988
}
946
989
947
990
#[ test]
948
- fn test_list_empty ( ) {
991
+ fn test_list_empty_2 ( ) {
949
992
let mut head = ListHead {
950
993
next : ptr:: null_mut ( ) ,
951
994
prev : ptr:: null_mut ( ) ,
0 commit comments