@@ -124,10 +124,10 @@ mod tests {
124
124
} ,
125
125
font_size : 0 ,
126
126
font_scale : FScale { fscx : 0 , fscy : 0 } ,
127
- cell_spacing : 0 ,
127
+ cell_spacing : Spacing { col : 0 , row : 0 } ,
128
128
cursor_pos : ISDBPos { x : 0 , y : 0 } ,
129
- ccc : 0 ,
130
- acps : 0 ,
129
+ ccc : IsdbCCComposition :: None ,
130
+ acps : [ 0 , 0 ] ,
131
131
} ,
132
132
} ,
133
133
tmd : IsdbTmd :: Free ,
@@ -158,10 +158,10 @@ mod tests {
158
158
} ,
159
159
font_scale : FScale { fscx : 0 , fscy : 0 } ,
160
160
format : WritingFormat :: None ,
161
- cell_spacing : 0 ,
161
+ cell_spacing : Spacing { col : 0 , row : 0 } ,
162
162
cursor_pos : ISDBPos { x : 0 , y : 0 } ,
163
- ccc : 0 ,
164
- acps : 0 ,
163
+ ccc : IsdbCCComposition :: None ,
164
+ acps : [ 0 , 0 ] ,
165
165
} ;
166
166
init_layout ( & mut layout) ;
167
167
unsafe {
@@ -190,7 +190,55 @@ mod tests {
190
190
fn test_isdb_set_global_time_zero ( ) {
191
191
let mut ctx = ISDBSubContext {
192
192
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 ,
194
242
} ;
195
243
isdb_set_global_time ( & mut ctx, 0 ) ;
196
244
assert_eq ! ( ctx. timestamp, 0 ) ;
@@ -211,10 +259,10 @@ mod tests {
211
259
fscy : 150 ,
212
260
} ,
213
261
format : WritingFormat :: None ,
214
- cell_spacing : 0 ,
262
+ cell_spacing : Spacing { col : 0 , row : 0 } ,
215
263
cursor_pos : ISDBPos { x : 0 , y : 0 } ,
216
- ccc : 0 ,
217
- acps : 0 ,
264
+ ccc : IsdbCCComposition :: None ,
265
+ acps : [ 0 , 0 ] ,
218
266
} ;
219
267
init_layout ( & mut layout) ;
220
268
unsafe {
@@ -410,7 +458,7 @@ mod tests {
410
458
len : 0 ,
411
459
used : 0 ,
412
460
pos : 0 ,
413
- txt_tail : ptr :: null_mut ( ) ,
461
+ txt_tail : 0 ,
414
462
timestamp : 0 ,
415
463
refcount : 0 ,
416
464
} ;
@@ -423,7 +471,7 @@ mod tests {
423
471
len : 0 ,
424
472
used : 0 ,
425
473
pos : 0 ,
426
- txt_tail : ptr :: null_mut ( ) ,
474
+ txt_tail : 0 ,
427
475
timestamp : 0 ,
428
476
refcount : 0 ,
429
477
} ;
@@ -451,14 +499,14 @@ mod tests {
451
499
len : 0 ,
452
500
used : 0 ,
453
501
pos : 0 ,
454
- txt_tail : ptr :: null_mut ( ) ,
502
+ txt_tail : 0 ,
455
503
timestamp : 0 ,
456
504
refcount : 0 ,
457
505
} ;
458
506
let list_ptr = & mut node. list as * mut ListHead ;
459
507
let text_ptr = unsafe { list_entry ( list_ptr, b"list\0 " . as_ptr ( ) ) } ;
460
508
unsafe {
461
- assert_eq ! ( ( * text_ptr) . data , 42 ) ;
509
+ assert_eq ! ( ( * text_ptr) . len , 0 ) ;
462
510
}
463
511
}
464
512
@@ -473,14 +521,14 @@ mod tests {
473
521
len : 0 ,
474
522
used : 0 ,
475
523
pos : 0 ,
476
- txt_tail : ptr :: null_mut ( ) ,
524
+ txt_tail : 0 ,
477
525
timestamp : 0 ,
478
526
refcount : 0 ,
479
527
} ;
480
528
let list_ptr = & mut node. list as * mut ListHead ;
481
529
let text_ptr = unsafe { container_of ( list_ptr, b"list\0 " . as_ptr ( ) ) } ;
482
530
unsafe {
483
- assert_eq ! ( ( * text_ptr) . data , 42 ) ;
531
+ assert_eq ! ( ( * text_ptr) . len , 42 ) ;
484
532
}
485
533
}
486
534
@@ -577,7 +625,36 @@ mod tests {
577
625
nb_char : 0 ,
578
626
nb_line : 0 ,
579
627
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
+ } ,
581
658
tmd : IsdbTmd :: Free ,
582
659
nb_lang : 0 ,
583
660
offset_time : OffsetTime {
@@ -600,7 +677,7 @@ mod tests {
600
677
used : 0 ,
601
678
len : 128 ,
602
679
pos : ISDBPos { x : 0 , y : 0 } ,
603
- txt_tail : ptr :: null_mut ( ) ,
680
+ txt_tail : 0 ,
604
681
timestamp : 0 ,
605
682
refcount : 0 ,
606
683
} ;
@@ -665,10 +742,10 @@ mod tests {
665
742
fscy : 100 ,
666
743
} ,
667
744
format : WritingFormat :: None ,
668
- cell_spacing : 0 ,
745
+ cell_spacing : Spacing { col : 0 , row : 0 } ,
669
746
cursor_pos : ISDBPos { x : 0 , y : 0 } ,
670
- ccc : 0 ,
671
- acps : 0 ,
747
+ ccc : IsdbCCComposition :: None ,
748
+ acps : [ 0 , 0 ] ,
672
749
} ;
673
750
674
751
let text_node = allocate_text_node ( & layout) ;
@@ -696,7 +773,7 @@ mod tests {
696
773
used : 0 ,
697
774
len : 128 ,
698
775
pos : ISDBPos { x : 0 , y : 0 } ,
699
- txt_tail : ptr :: null_mut ( ) ,
776
+ txt_tail : 0 ,
700
777
timestamp : 0 ,
701
778
refcount : 0 ,
702
779
} ;
0 commit comments