File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,33 @@ mod test {
37
37
assert ! ( blk. truncated( ) ) ;
38
38
assert ! ( !blk. speculative( ) ) ;
39
39
}
40
+
41
+ #[ test]
42
+ fn test_block_notruncate ( ) {
43
+ let data: [ u8 ; 15 ] = [ 17 ; 15 ] ;
44
+ let blk = Block ( pt_block {
45
+ ip : 1 ,
46
+ end_ip : 2 ,
47
+ isid : 3 ,
48
+ mode : pt_exec_mode_ptem_32bit,
49
+ iclass : pt_insn_class_ptic_error,
50
+ ninsn : 4 ,
51
+ raw : data,
52
+ size : 8 ,
53
+ _bitfield_1 : pt_block:: new_bitfield_1 ( 0 , 0 ) ,
54
+ __bindgen_padding_0 : Default :: default ( )
55
+ } ) ;
56
+
57
+ assert_eq ! ( blk. ip( ) , 1 ) ;
58
+ assert_eq ! ( blk. end_ip( ) , 2 ) ;
59
+ assert_eq ! ( blk. isid( ) , 3 ) ;
60
+ assert_eq ! ( blk. mode( ) , ExecModeType :: Bit32 ) ;
61
+ assert_eq ! ( blk. class( ) , Class :: Error ) ;
62
+ assert_eq ! ( blk. ninsn( ) , 4 ) ;
63
+ assert ! ( blk. raw( ) . is_none( ) ) ;
64
+ assert ! ( !blk. truncated( ) ) ;
65
+ assert ! ( !blk. speculative( ) ) ;
66
+ }
40
67
}
41
68
42
69
/// A block of instructions.
You can’t perform that action at this time.
0 commit comments