@@ -124,10 +124,10 @@ mod tests {
124124 } ,
125125 font_size : 0 ,
126126 font_scale : FScale { fscx : 0 , fscy : 0 } ,
127- cell_spacing : 0 ,
127+ cell_spacing : Spacing { col : 0 , row : 0 } ,
128128 cursor_pos : ISDBPos { x : 0 , y : 0 } ,
129- ccc : 0 ,
130- acps : 0 ,
129+ ccc : IsdbCCComposition :: None ,
130+ acps : [ 0 , 0 ] ,
131131 } ,
132132 } ,
133133 tmd : IsdbTmd :: Free ,
@@ -158,10 +158,10 @@ mod tests {
158158 } ,
159159 font_scale : FScale { fscx : 0 , fscy : 0 } ,
160160 format : WritingFormat :: None ,
161- cell_spacing : 0 ,
161+ cell_spacing : Spacing { col : 0 , row : 0 } ,
162162 cursor_pos : ISDBPos { x : 0 , y : 0 } ,
163- ccc : 0 ,
164- acps : 0 ,
163+ ccc : IsdbCCComposition :: None ,
164+ acps : [ 0 , 0 ] ,
165165 } ;
166166 init_layout ( & mut layout) ;
167167 unsafe {
@@ -190,7 +190,55 @@ mod tests {
190190 fn test_isdb_set_global_time_zero ( ) {
191191 let mut ctx = ISDBSubContext {
192192 timestamp : 123456789 ,
193- ..Default :: default ( )
193+ nb_char : 0 ,
194+ nb_line : 0 ,
195+ prev_timestamp : 0 ,
196+ text_list_head : ListHead {
197+ next : std:: ptr:: null_mut ( ) ,
198+ prev : std:: ptr:: null_mut ( ) ,
199+ } ,
200+ buffered_text : ListHead {
201+ next : std:: ptr:: null_mut ( ) ,
202+ prev : std:: ptr:: null_mut ( ) ,
203+ } ,
204+ current_state : ISDBSubState {
205+ auto_display : 0 ,
206+ rollup_mode : 0 ,
207+ need_init : 0 ,
208+ clut_high_idx : 0 ,
209+ fg_color : 0 ,
210+ bg_color : 0 ,
211+ hfg_color : 0 ,
212+ hbg_color : 0 ,
213+ mat_color : 0 ,
214+ raster_color : 0 ,
215+ layout_state : ISDBSubLayout {
216+ format : WritingFormat :: None ,
217+ display_area : DispArea {
218+ x : 0 ,
219+ y : 0 ,
220+ w : 0 ,
221+ h : 0 ,
222+ } ,
223+ font_size : 0 ,
224+ font_scale : FScale { fscx : 0 , fscy : 0 } ,
225+ cell_spacing : Spacing { col : 0 , row : 0 } ,
226+ cursor_pos : ISDBPos { x : 0 , y : 0 } ,
227+ ccc : IsdbCCComposition :: None ,
228+ acps : [ 0 , 0 ] ,
229+ } ,
230+ } ,
231+ tmd : IsdbTmd :: Free ,
232+ nb_lang : 0 ,
233+ offset_time : OffsetTime {
234+ hour : 0 ,
235+ min : 0 ,
236+ sec : 0 ,
237+ milli : 0 ,
238+ } ,
239+ dmf : 0 ,
240+ dc : 0 ,
241+ cfg_no_rollup : 0 ,
194242 } ;
195243 isdb_set_global_time ( & mut ctx, 0 ) ;
196244 assert_eq ! ( ctx. timestamp, 0 ) ;
@@ -211,10 +259,10 @@ mod tests {
211259 fscy : 150 ,
212260 } ,
213261 format : WritingFormat :: None ,
214- cell_spacing : 0 ,
262+ cell_spacing : Spacing { col : 0 , row : 0 } ,
215263 cursor_pos : ISDBPos { x : 0 , y : 0 } ,
216- ccc : 0 ,
217- acps : 0 ,
264+ ccc : IsdbCCComposition :: None ,
265+ acps : [ 0 , 0 ] ,
218266 } ;
219267 init_layout ( & mut layout) ;
220268 unsafe {
@@ -410,7 +458,7 @@ mod tests {
410458 len : 0 ,
411459 used : 0 ,
412460 pos : 0 ,
413- txt_tail : ptr :: null_mut ( ) ,
461+ txt_tail : 0 ,
414462 timestamp : 0 ,
415463 refcount : 0 ,
416464 } ;
@@ -423,7 +471,7 @@ mod tests {
423471 len : 0 ,
424472 used : 0 ,
425473 pos : 0 ,
426- txt_tail : ptr :: null_mut ( ) ,
474+ txt_tail : 0 ,
427475 timestamp : 0 ,
428476 refcount : 0 ,
429477 } ;
@@ -451,14 +499,14 @@ mod tests {
451499 len : 0 ,
452500 used : 0 ,
453501 pos : 0 ,
454- txt_tail : ptr :: null_mut ( ) ,
502+ txt_tail : 0 ,
455503 timestamp : 0 ,
456504 refcount : 0 ,
457505 } ;
458506 let list_ptr = & mut node. list as * mut ListHead ;
459507 let text_ptr = unsafe { list_entry ( list_ptr, b"list\0 " . as_ptr ( ) ) } ;
460508 unsafe {
461- assert_eq ! ( ( * text_ptr) . data , 42 ) ;
509+ assert_eq ! ( ( * text_ptr) . len , 0 ) ;
462510 }
463511 }
464512
@@ -473,14 +521,14 @@ mod tests {
473521 len : 0 ,
474522 used : 0 ,
475523 pos : 0 ,
476- txt_tail : ptr :: null_mut ( ) ,
524+ txt_tail : 0 ,
477525 timestamp : 0 ,
478526 refcount : 0 ,
479527 } ;
480528 let list_ptr = & mut node. list as * mut ListHead ;
481529 let text_ptr = unsafe { container_of ( list_ptr, b"list\0 " . as_ptr ( ) ) } ;
482530 unsafe {
483- assert_eq ! ( ( * text_ptr) . data , 42 ) ;
531+ assert_eq ! ( ( * text_ptr) . len , 42 ) ;
484532 }
485533 }
486534
@@ -577,7 +625,36 @@ mod tests {
577625 nb_char : 0 ,
578626 nb_line : 0 ,
579627 prev_timestamp : 0 ,
580- current_state : ISDBSubState :: default ( ) ,
628+ current_state : ISDBSubState {
629+ auto_display : 0 ,
630+ rollup_mode : 0 ,
631+ need_init : 0 ,
632+ clut_high_idx : 0 ,
633+ fg_color : 0 ,
634+ bg_color : 0 ,
635+ hfg_color : 0 ,
636+ hbg_color : 0 ,
637+ mat_color : 0 ,
638+ raster_color : 0 ,
639+ layout_state : ISDBSubLayout {
640+ format : WritingFormat :: HorizontalStdDensity ,
641+ display_area : DispArea {
642+ x : 0 ,
643+ y : 0 ,
644+ w : 0 ,
645+ h : 0 ,
646+ } ,
647+ font_size : 36 ,
648+ font_scale : FScale {
649+ fscx : 100 ,
650+ fscy : 100 ,
651+ } ,
652+ cell_spacing : Spacing { col : 0 , row : 0 } ,
653+ cursor_pos : ISDBPos { x : 0 , y : 0 } ,
654+ ccc : IsdbCCComposition :: None ,
655+ acps : [ 0 ; 2 ] ,
656+ } ,
657+ } ,
581658 tmd : IsdbTmd :: Free ,
582659 nb_lang : 0 ,
583660 offset_time : OffsetTime {
@@ -600,7 +677,7 @@ mod tests {
600677 used : 0 ,
601678 len : 128 ,
602679 pos : ISDBPos { x : 0 , y : 0 } ,
603- txt_tail : ptr :: null_mut ( ) ,
680+ txt_tail : 0 ,
604681 timestamp : 0 ,
605682 refcount : 0 ,
606683 } ;
@@ -665,10 +742,10 @@ mod tests {
665742 fscy : 100 ,
666743 } ,
667744 format : WritingFormat :: None ,
668- cell_spacing : 0 ,
745+ cell_spacing : Spacing { col : 0 , row : 0 } ,
669746 cursor_pos : ISDBPos { x : 0 , y : 0 } ,
670- ccc : 0 ,
671- acps : 0 ,
747+ ccc : IsdbCCComposition :: None ,
748+ acps : [ 0 , 0 ] ,
672749 } ;
673750
674751 let text_node = allocate_text_node ( & layout) ;
@@ -696,7 +773,7 @@ mod tests {
696773 used : 0 ,
697774 len : 128 ,
698775 pos : ISDBPos { x : 0 , y : 0 } ,
699- txt_tail : ptr :: null_mut ( ) ,
776+ txt_tail : 0 ,
700777 timestamp : 0 ,
701778 refcount : 0 ,
702779 } ;
0 commit comments