File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -23,10 +23,16 @@ mod t {
23
23
fn compare ( major : c_uint , minor : c_uint ) {
24
24
let dev = unsafe { makedev_ffi ( major, minor) } ;
25
25
assert_eq ! ( libc:: makedev( major, minor) , dev) ;
26
- let major = unsafe { major_ffi ( dev) } ;
27
- let minor = unsafe { minor_ffi ( dev) } ;
28
- assert_eq ! ( libc:: major( dev) , major. try_into( ) . expect( "Conversion should succeed" ) ) ;
29
- assert_eq ! ( libc:: minor( dev) , minor. try_into( ) . expect( "Conversion should succeed" ) ) ;
26
+ let expected_major = unsafe { major_ffi ( dev) } ;
27
+ let expected_minor = unsafe { minor_ffi ( dev) } ;
28
+ let expected_major_i64: i64 = expected_major. try_into ( ) . unwrap ( ) ;
29
+ let expected_minor_i64: i64 = expected_minor. try_into ( ) . unwrap ( ) ;
30
+ let actual_major = libc:: major ( dev) ;
31
+ let actual_minor = libc:: minor ( dev) ;
32
+ let actual_major_i64: i64 = actual_major. try_into ( ) . unwrap ( ) ;
33
+ let actual_minor_i64: i64 = actual_minor. try_into ( ) . unwrap ( ) ;
34
+ assert_eq ! ( actual_major_i64, expected_major_i64) ;
35
+ assert_eq ! ( actual_minor_i64, expected_minor_i64) ;
30
36
}
31
37
32
38
// Every OS should be able to handle 8 bit major and minor numbers
You can’t perform that action at this time.
0 commit comments