@@ -80,57 +80,7 @@ pub fn print_tm_1(t: i64) {
8080 ( * ( * tm. borrow( ) ) . tm_isdst. borrow( ) )
8181 ) ;
8282}
83- pub fn test_clock_gettime_2 ( ) {
84- let ts: Value < libcc2rs:: Timespec > = Rc :: new ( RefCell :: new ( Default :: default ( ) ) ) ;
85- assert ! (
86- ( ( ( match nix:: time:: clock_gettime( nix:: time:: ClockId :: CLOCK_REALTIME ) {
87- Ok ( __ts) => {
88- ( ts. as_pointer( ) ) . with_mut( |__t| {
89- * __t. tv_sec. borrow_mut( ) = __ts. tv_sec( ) as i64 ;
90- * __t. tv_nsec. borrow_mut( ) = __ts. tv_nsec( ) as i64 ;
91- } ) ;
92- 0
93- }
94- Err ( __e) => {
95- libcc2rs:: cpp2rust_errno( ) . write( __e as i32 ) ;
96- -1
97- }
98- } == 0 ) as i32 )
99- != 0 )
100- ) ;
101- assert ! ( ( ( ( ( * ( * ts. borrow( ) ) . tv_sec. borrow( ) ) > 1500000000_i64 ) as i32 ) != 0 ) ) ;
102- assert ! (
103- ( ( ( ( ( ( ( * ( * ts. borrow( ) ) . tv_nsec. borrow( ) ) >= 0_i64 ) as i32 ) != 0 )
104- && ( ( ( ( * ( * ts. borrow( ) ) . tv_nsec. borrow( ) ) < 1000000000_i64 ) as i32 ) != 0 ) )
105- as i32 )
106- != 0 )
107- ) ;
108- let mono: Value < libcc2rs:: Timespec > = Rc :: new ( RefCell :: new ( Default :: default ( ) ) ) ;
109- assert ! (
110- ( ( ( match nix:: time:: clock_gettime( nix:: time:: ClockId :: CLOCK_MONOTONIC ) {
111- Ok ( __ts) => {
112- ( mono. as_pointer( ) ) . with_mut( |__t| {
113- * __t. tv_sec. borrow_mut( ) = __ts. tv_sec( ) as i64 ;
114- * __t. tv_nsec. borrow_mut( ) = __ts. tv_nsec( ) as i64 ;
115- } ) ;
116- 0
117- }
118- Err ( __e) => {
119- libcc2rs:: cpp2rust_errno( ) . write( __e as i32 ) ;
120- -1
121- }
122- } == 0 ) as i32 )
123- != 0 )
124- ) ;
125- assert ! ( ( ( ( ( * ( * mono. borrow( ) ) . tv_sec. borrow( ) ) >= 0_i64 ) as i32 ) != 0 ) ) ;
126- assert ! (
127- ( ( ( ( ( ( ( * ( * mono. borrow( ) ) . tv_nsec. borrow( ) ) >= 0_i64 ) as i32 ) != 0 )
128- && ( ( ( ( * ( * mono. borrow( ) ) . tv_nsec. borrow( ) ) < 1000000000_i64 ) as i32 ) != 0 ) )
129- as i32 )
130- != 0 )
131- ) ;
132- }
133- pub fn test_gmtime_r_3 ( ) {
83+ pub fn test_gmtime_r_2 ( ) {
13484 ( { print_tm_1 ( 0_i64 ) } ) ;
13585 ( { print_tm_1 ( 1_i64 ) } ) ;
13686 ( { print_tm_1 ( 86399_i64 ) } ) ;
@@ -142,7 +92,7 @@ pub fn test_gmtime_r_3() {
14292 ( { print_tm_1 ( 1721126096_i64 ) } ) ;
14393 ( { print_tm_1 ( 4102444800_i64 ) } ) ;
14494}
145- pub fn print_local_tm_4 ( t : i64 ) {
95+ pub fn print_local_tm_3 ( t : i64 ) {
14696 let t: Value < i64 > = Rc :: new ( RefCell :: new ( t) ) ;
14797 let tm: Value < libcc2rs:: Tm > = Rc :: new ( RefCell :: new ( Default :: default ( ) ) ) ;
14898 assert ! (
@@ -185,14 +135,14 @@ pub fn print_local_tm_4(t: i64) {
185135 ( * ( * tm. borrow( ) ) . tm_isdst. borrow( ) )
186136 ) ;
187137}
188- pub fn test_localtime_r_5 ( ) {
189- ( { print_local_tm_4 ( 0_i64 ) } ) ;
190- ( { print_local_tm_4 ( 951782400_i64 ) } ) ;
191- ( { print_local_tm_4 ( 1704067199_i64 ) } ) ;
192- ( { print_local_tm_4 ( 1721126096_i64 ) } ) ;
193- ( { print_local_tm_4 ( 1735689600_i64 ) } ) ;
138+ pub fn test_localtime_r_4 ( ) {
139+ ( { print_local_tm_3 ( 0_i64 ) } ) ;
140+ ( { print_local_tm_3 ( 951782400_i64 ) } ) ;
141+ ( { print_local_tm_3 ( 1704067199_i64 ) } ) ;
142+ ( { print_local_tm_3 ( 1721126096_i64 ) } ) ;
143+ ( { print_local_tm_3 ( 1735689600_i64 ) } ) ;
194144}
195- pub fn test_strftime_6 ( ) {
145+ pub fn test_strftime_5 ( ) {
196146 let t: Value < i64 > = Rc :: new ( RefCell :: new ( 1721126096_i64 ) ) ;
197147 let tm: Value < libcc2rs:: Tm > = Rc :: new ( RefCell :: new ( Default :: default ( ) ) ) ;
198148 assert ! (
@@ -352,9 +302,8 @@ pub fn main() {
352302}
353303fn main_0 ( ) -> i32 {
354304 ( { test_time_0 ( ) } ) ;
355- ( { test_clock_gettime_2 ( ) } ) ;
356- ( { test_gmtime_r_3 ( ) } ) ;
357- ( { test_localtime_r_5 ( ) } ) ;
358- ( { test_strftime_6 ( ) } ) ;
305+ ( { test_gmtime_r_2 ( ) } ) ;
306+ ( { test_localtime_r_4 ( ) } ) ;
307+ ( { test_strftime_5 ( ) } ) ;
359308 return 0 ;
360309}
0 commit comments