@@ -9,31 +9,20 @@ use std::rc::Rc;
99pub unsafe fn test_time_0 ( ) {
1010 assert ! ( ( ( ( ( libc:: time( std:: ptr:: null_mut( ) ) ) > ( 0_i64 ) ) as i32 ) != 0 ) ) ;
1111}
12- pub unsafe fn test_gettimeofday_1 ( ) {
13- let mut tv: timeval = std:: mem:: zeroed :: < timeval > ( ) ;
14- tv. tv_sec = 0_i64 ;
15- tv. tv_usec = 0_i64 ;
16- assert ! (
17- ( ( ( ( libc:: gettimeofday(
18- ( & mut tv as * mut timeval) ,
19- ( 0 as * mut :: libc:: c_void) as * mut :: libc:: timezone
20- ) ) == ( 0 ) ) as i32 )
21- != 0 )
22- ) ;
23- assert ! ( ( ( ( ( tv. tv_sec) > ( 0_i64 ) ) as i32 ) != 0 ) ) ;
24- assert ! ( ( ( ( ( tv. tv_usec) >= ( 0_i64 ) ) as i32 ) != 0 ) ) ;
25- assert ! ( ( ( ( ( tv. tv_usec) < ( 1000000_i64 ) ) as i32 ) != 0 ) ) ;
26- }
27- pub unsafe fn test_clock_gettime_2 ( ) {
12+ pub unsafe fn test_clock_gettime_1 ( ) {
2813 let mut ts: timespec = std:: mem:: zeroed :: < timespec > ( ) ;
2914 ts. tv_sec = 0_i64 ;
3015 ts. tv_nsec = 0_i64 ;
31- assert ! ( ( ( ( ( libc:: clock_gettime( 1 , ( & mut ts as * mut timespec) ) ) == ( 0 ) ) as i32 ) != 0 ) ) ;
16+ assert ! (
17+ ( ( ( ( libc:: clock_gettime( 1 as :: libc:: clockid_t, ( & mut ts as * mut timespec) ) ) == ( 0 ) )
18+ as i32 )
19+ != 0 )
20+ ) ;
3221 assert ! ( ( ( ( ( ts. tv_sec) > ( 0_i64 ) ) as i32 ) != 0 ) ) ;
3322 assert ! ( ( ( ( ( ts. tv_nsec) >= ( 0_i64 ) ) as i32 ) != 0 ) ) ;
3423 assert ! ( ( ( ( ( ts. tv_nsec) < ( 1000000000_i64 ) ) as i32 ) != 0 ) ) ;
3524}
36- pub unsafe fn test_localtime_r_3 ( ) {
25+ pub unsafe fn test_localtime_r_2 ( ) {
3726 let mut t: i64 = 0_i64 ;
3827 let mut tm: tm = std:: mem:: zeroed :: < tm > ( ) ;
3928 assert ! (
@@ -43,7 +32,7 @@ pub unsafe fn test_localtime_r_3() {
4332 ) ;
4433 assert ! ( ( ( ( ( tm. tm_year) == ( 70 ) ) as i32 ) != 0 ) ) ;
4534}
46- pub unsafe fn test_gmtime_r_4 ( ) {
35+ pub unsafe fn test_gmtime_r_3 ( ) {
4736 let mut t: i64 = 0_i64 ;
4837 let mut tm: tm = std:: mem:: zeroed :: < tm > ( ) ;
4938 assert ! (
@@ -56,7 +45,7 @@ pub unsafe fn test_gmtime_r_4() {
5645 assert ! ( ( ( ( ( tm. tm_mday) == ( 1 ) ) as i32 ) != 0 ) ) ;
5746 assert ! ( ( ( ( ( tm. tm_hour) == ( 0 ) ) as i32 ) != 0 ) ) ;
5847}
59- pub unsafe fn test_strftime_5 ( ) {
48+ pub unsafe fn test_strftime_4 ( ) {
6049 let mut t: i64 = 0_i64 ;
6150 let mut tm: tm = std:: mem:: zeroed :: < tm > ( ) ;
6251 libc:: gmtime_r ( ( & mut t as * mut i64 ) . cast_const ( ) , ( & mut tm as * mut tm ) ) ;
@@ -79,7 +68,7 @@ pub unsafe fn test_strftime_5() {
7968 != 0 )
8069 ) ;
8170}
82- pub unsafe fn test_utimes_6 ( ) {
71+ pub unsafe fn test_utimes_5 ( ) {
8372 let mut path: * const u8 = ( b"/tmp/cpp2rust_utimes_test.tmp\0 " . as_ptr ( ) . cast_mut ( ) ) . cast_const ( ) ;
8473 let mut fp: * mut :: std:: fs:: File =
8574 match std:: ffi:: CStr :: from_ptr ( ( b"wb\0 " . as_ptr ( ) . cast_mut ( ) ) . cast_const ( ) as * const i8 )
@@ -137,11 +126,10 @@ pub fn main() {
137126}
138127unsafe fn main_0 ( ) -> i32 {
139128 ( unsafe { test_time_0 ( ) } ) ;
140- ( unsafe { test_gettimeofday_1 ( ) } ) ;
141- ( unsafe { test_clock_gettime_2 ( ) } ) ;
142- ( unsafe { test_localtime_r_3 ( ) } ) ;
143- ( unsafe { test_gmtime_r_4 ( ) } ) ;
144- ( unsafe { test_strftime_5 ( ) } ) ;
145- ( unsafe { test_utimes_6 ( ) } ) ;
129+ ( unsafe { test_clock_gettime_1 ( ) } ) ;
130+ ( unsafe { test_localtime_r_2 ( ) } ) ;
131+ ( unsafe { test_gmtime_r_3 ( ) } ) ;
132+ ( unsafe { test_strftime_4 ( ) } ) ;
133+ ( unsafe { test_utimes_5 ( ) } ) ;
146134 return 0 ;
147135}
0 commit comments