File tree 1 file changed +2
-9
lines changed
1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -712,13 +712,6 @@ mod tests {
712
712
assert_almost_eq ! ( a - second + second, a) ;
713
713
assert_almost_eq ! ( a. checked_sub( second) . unwrap( ) . checked_add( second) . unwrap( ) , a) ;
714
714
715
- // A difference of 80 and 800 years cannot fit inside a 32-bit time_t
716
- if !( cfg ! ( unix) && crate :: mem:: size_of :: < libc:: time_t > ( ) <= 4 ) {
717
- let eighty_years = second * 60 * 60 * 24 * 365 * 80 ;
718
- assert_almost_eq ! ( a - eighty_years + eighty_years, a) ;
719
- assert_almost_eq ! ( a - ( eighty_years * 10 ) + ( eighty_years * 10 ) , a) ;
720
- }
721
-
722
715
let one_second_from_epoch = UNIX_EPOCH + Duration :: new ( 1 , 0 ) ;
723
716
let one_second_from_epoch2 = UNIX_EPOCH + Duration :: new ( 0 , 500_000_000 )
724
717
+ Duration :: new ( 0 , 500_000_000 ) ;
@@ -747,8 +740,8 @@ mod tests {
747
740
#[ test]
748
741
fn since_epoch ( ) {
749
742
let ts = SystemTime :: now ( ) ;
750
- let a = ts. duration_since ( UNIX_EPOCH ) . unwrap ( ) ;
751
- let b = ts. duration_since ( UNIX_EPOCH - Duration :: new ( 1 , 0 ) ) . unwrap ( ) ;
743
+ let a = ts. duration_since ( UNIX_EPOCH + Duration :: new ( 1 , 0 ) ) . unwrap ( ) ;
744
+ let b = ts. duration_since ( UNIX_EPOCH ) . unwrap ( ) ;
752
745
assert ! ( b > a) ;
753
746
assert_eq ! ( b - a, Duration :: new( 1 , 0 ) ) ;
754
747
You can’t perform that action at this time.
0 commit comments