File tree Expand file tree Collapse file tree 6 files changed +20
-12
lines changed Expand file tree Collapse file tree 6 files changed +20
-12
lines changed Original file line number Diff line number Diff line change @@ -39,17 +39,19 @@ use libipt_sys::{
3939#[ cfg( test) ]
4040mod test {
4141 use super :: * ;
42+ use crate :: config:: ConfigBuilder ;
4243
4344 #[ test]
4445 fn test_blkdec_alloc ( ) {
45- BlockDecoder :: new ( & Config :: < ( ) > :: new ( & mut [ 0 ; 0 ] ) ) . unwrap ( ) ;
46+ BlockDecoder :: new ( & ConfigBuilder :: new ( & mut [ 0 ; 0 ] ) . finish ( ) ) . unwrap ( ) ;
4647 }
4748
4849 #[ test ]
4950 fn test_blkdec_props ( ) {
5051 // this just checks memory safety for property access
5152 // usage can be found in the integration tests
52- let mut b = BlockDecoder :: new ( & Config :: < ( ) > :: new ( & mut [ 0 ; 0 ] ) ) . unwrap ( ) ;
53+ let mut b = BlockDecoder :: new (
54+ & ConfigBuilder :: new ( & mut [ 0 ; 0 ] ) . finish ( ) ) . unwrap ( ) ;
5355 let a = b. asid ( ) . unwrap ( ) ;
5456 assert ! ( a. cr3( ) . is_none( ) ) ;
5557 assert ! ( a. vmcs( ) . is_none( ) ) ;
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ mod test {
99
1010 #[ test]
1111 fn test_addrfilter ( ) {
12- let mut filter = AddrFilterBuilder :: new ( )
12+ let filter = AddrFilterBuilder :: new ( )
1313 . addr0 ( AddrRange :: new ( 1 , 2 , AddrConfig :: DISABLED ) )
1414 . addr1 ( AddrRange :: new ( 3 , 4 , AddrConfig :: FILTER ) )
1515 . addr2 ( AddrRange :: new ( 5 , 6 , AddrConfig :: STOP ) )
Original file line number Diff line number Diff line change @@ -21,18 +21,19 @@ use libipt_sys::{
2121#[ cfg( test) ]
2222mod tests {
2323 use super :: * ;
24+ use crate :: config:: ConfigBuilder ;
2425 use crate :: packet:: mnt:: Mnt ;
2526
2627 #[ test]
2728 fn test_pktdec_alloc ( ) {
28- Encoder :: new ( & mut Config :: < ( ) > :: new ( & mut [ 0 ; 0 ] ) ) . unwrap ( ) ;
29+ Encoder :: new ( & mut ConfigBuilder :: new ( & mut [ 0 ; 0 ] ) . finish ( ) ) . unwrap ( ) ;
2930 }
3031
3132 #[ test ]
3233 fn test_pktdec_props ( ) {
3334 // this just checks memory safety for property access
3435 // usage can be found in the integration tests
35- let mut p = Encoder :: new ( & mut Config :: < ( ) > :: new ( & mut [ 0 ; 0 ] ) )
36+ let mut p = Encoder :: new ( & mut ConfigBuilder :: new ( & mut [ 0 ; 0 ] ) . finish ( ) )
3637 . unwrap ( ) ;
3738
3839 assert ! ( p. config( ) . is_ok( ) ) ;
Original file line number Diff line number Diff line change @@ -39,17 +39,19 @@ use libipt_sys::{
3939#[ cfg( test) ]
4040mod test {
4141 use super :: * ;
42+ use crate :: config:: ConfigBuilder ;
4243
4344 #[ test]
4445 fn test_insndec_alloc ( ) {
45- InsnDecoder :: new ( & Config :: < ( ) > :: new ( & mut [ 0 ; 0 ] ) ) . unwrap ( ) ;
46+ InsnDecoder :: new ( & ConfigBuilder :: new ( & mut [ 0 ; 0 ] ) . finish ( ) ) . unwrap ( ) ;
4647 }
4748
4849 #[ test ]
4950 fn test_insndec_props ( ) {
5051 // this just checks memory safety for property access
5152 // usage can be found in the integration tests
52- let mut b = InsnDecoder :: new ( & Config :: < ( ) > :: new ( & mut [ 0 ; 0 ] ) ) . unwrap ( ) ;
53+ let mut b = InsnDecoder :: new (
54+ & ConfigBuilder :: new ( & mut [ 0 ; 0 ] ) . finish ( ) ) . unwrap ( ) ;
5355 let a = b. asid ( ) . unwrap ( ) ;
5456 assert ! ( a. cr3( ) . is_none( ) ) ;
5557 assert ! ( a. vmcs( ) . is_none( ) ) ;
Original file line number Diff line number Diff line change @@ -26,17 +26,19 @@ use libipt_sys::{
2626#[ cfg( test) ]
2727mod test {
2828 use super :: * ;
29+ use crate :: config:: ConfigBuilder ;
2930
3031 #[ test]
3132 fn test_pktdec_alloc ( ) {
32- PacketDecoder :: new ( & Config :: < ( ) > :: new ( & mut [ 0 ; 0 ] ) ) . unwrap ( ) ;
33+ PacketDecoder :: new ( & ConfigBuilder :: new ( & mut [ 0 ; 0 ] ) . finish ( ) ) . unwrap ( ) ;
3334 }
3435
3536 #[ test ]
3637 fn test_pktdec_props ( ) {
3738 // this just checks memory safety for property access
3839 // usage can be found in the integration tests
39- let mut p = PacketDecoder :: new ( & Config :: < ( ) > :: new ( & mut [ 0 ; 0 ] ) ) . unwrap ( ) ;
40+ let mut p = PacketDecoder :: new (
41+ & ConfigBuilder :: new ( & mut [ 0 ; 0 ] ) . finish ( ) ) . unwrap ( ) ;
4042 assert ! ( p. config( ) . is_ok( ) ) ;
4143 assert ! ( p. offset( ) . is_err( ) ) ;
4244 assert ! ( p. sync_offset( ) . is_err( ) ) ;
Original file line number Diff line number Diff line change @@ -33,18 +33,19 @@ use libipt_sys::{
3333#[ cfg( test) ]
3434mod test {
3535 use super :: * ;
36+ use crate :: config:: ConfigBuilder ;
3637
3738 #[ test]
3839 fn test_qrydec_alloc ( ) {
39- QueryDecoder :: new ( & Config :: < ( ) > :: new ( & mut [ 0 ; 0 ] ) ) . unwrap ( ) ;
40+ QueryDecoder :: new ( & ConfigBuilder :: new ( & mut [ 0 ; 0 ] ) . finish ( ) ) . unwrap ( ) ;
4041 }
4142
4243 #[ test ]
4344 fn test_qrydec_props ( ) {
4445 // this just checks memory safety for property access
4546 // usage can be found in the integration tests
46- let mut b = QueryDecoder :: new ( & Config :: < ( ) > :: new ( & mut [ 0 ; 0 ] ) )
47- . unwrap ( ) ;
47+ let mut b = QueryDecoder :: new (
48+ & ConfigBuilder :: new ( & mut [ 0 ; 0 ] ) . finish ( ) ) . unwrap ( ) ;
4849
4950 assert ! ( b. cond_branch( ) . is_err( ) ) ;
5051 assert ! ( b. indirect_branch( ) . is_err( ) ) ;
You can’t perform that action at this time.
0 commit comments