@@ -44,33 +44,7 @@ pub fn test_time_0() {
4444 assert ! ( ( ( ( ( * t2. borrow( ) ) == ( * t3. borrow( ) ) ) as i32 ) != 0 ) ) ;
4545 assert ! ( ( ( ( ( * t3. borrow( ) ) >= ( * t1. borrow( ) ) ) as i32 ) != 0 ) ) ;
4646}
47- pub fn test_clock_gettime_1 ( ) {
48- let ts: Value < libcc2rs:: Timespec > = Rc :: new ( RefCell :: new ( Default :: default ( ) ) ) ;
49- assert ! (
50- ( ( ( match nix:: time:: clock_gettime( nix:: time:: ClockId :: CLOCK_REALTIME ) {
51- Ok ( __ts) => {
52- ( ts. as_pointer( ) ) . with_mut( |__t| {
53- * __t. tv_sec. borrow_mut( ) = __ts. tv_sec( ) as i64 ;
54- * __t. tv_nsec. borrow_mut( ) = __ts. tv_nsec( ) as i64 ;
55- } ) ;
56- 0
57- }
58- Err ( __e) => {
59- libcc2rs:: cpp2rust_errno( ) . write( __e as i32 ) ;
60- -1
61- }
62- } == 0 ) as i32 )
63- != 0 )
64- ) ;
65- assert ! ( ( ( ( ( * ( * ts. borrow( ) ) . tv_sec. borrow( ) ) > 1500000000_i64 ) as i32 ) != 0 ) ) ;
66- assert ! (
67- ( ( ( ( ( ( ( * ( * ts. borrow( ) ) . tv_nsec. borrow( ) ) >= 0_i64 ) as i32 ) != 0 )
68- && ( ( ( ( * ( * ts. borrow( ) ) . tv_nsec. borrow( ) ) < 1000000000_i64 ) as i32 ) != 0 ) )
69- as i32 )
70- != 0 )
71- ) ;
72- }
73- pub fn print_tm_2 ( t : i64 ) {
47+ pub fn print_tm_1 ( t : i64 ) {
7448 let t: Value < i64 > = Rc :: new ( RefCell :: new ( t) ) ;
7549 let tm: Value < libcc2rs:: Tm > = Rc :: new ( RefCell :: new ( Default :: default ( ) ) ) ;
7650 assert ! (
@@ -106,19 +80,19 @@ pub fn print_tm_2(t: i64) {
10680 ( * ( * tm. borrow( ) ) . tm_isdst. borrow( ) )
10781 ) ;
10882}
109- pub fn test_gmtime_r_3 ( ) {
110- ( { print_tm_2 ( 0_i64 ) } ) ;
111- ( { print_tm_2 ( 1_i64 ) } ) ;
112- ( { print_tm_2 ( 86399_i64 ) } ) ;
113- ( { print_tm_2 ( 86400_i64 ) } ) ;
114- ( { print_tm_2 ( 951782400_i64 ) } ) ;
115- ( { print_tm_2 ( 951868799_i64 ) } ) ;
116- ( { print_tm_2 ( 1704067199_i64 ) } ) ;
117- ( { print_tm_2 ( 1704067200_i64 ) } ) ;
118- ( { print_tm_2 ( 1721126096_i64 ) } ) ;
119- ( { print_tm_2 ( 4102444800_i64 ) } ) ;
83+ pub fn test_gmtime_r_2 ( ) {
84+ ( { print_tm_1 ( 0_i64 ) } ) ;
85+ ( { print_tm_1 ( 1_i64 ) } ) ;
86+ ( { print_tm_1 ( 86399_i64 ) } ) ;
87+ ( { print_tm_1 ( 86400_i64 ) } ) ;
88+ ( { print_tm_1 ( 951782400_i64 ) } ) ;
89+ ( { print_tm_1 ( 951868799_i64 ) } ) ;
90+ ( { print_tm_1 ( 1704067199_i64 ) } ) ;
91+ ( { print_tm_1 ( 1704067200_i64 ) } ) ;
92+ ( { print_tm_1 ( 1721126096_i64 ) } ) ;
93+ ( { print_tm_1 ( 4102444800_i64 ) } ) ;
12094}
121- pub fn test_strftime_4 ( ) {
95+ pub fn test_strftime_3 ( ) {
12296 let t: Value < i64 > = Rc :: new ( RefCell :: new ( 1721126096_i64 ) ) ;
12397 let tm: Value < libcc2rs:: Tm > = Rc :: new ( RefCell :: new ( Default :: default ( ) ) ) ;
12498 assert ! (
@@ -288,8 +262,7 @@ pub fn main() {
288262}
289263fn main_0 ( ) -> i32 {
290264 ( { test_time_0 ( ) } ) ;
291- ( { test_clock_gettime_1 ( ) } ) ;
292- ( { test_gmtime_r_3 ( ) } ) ;
293- ( { test_strftime_4 ( ) } ) ;
265+ ( { test_gmtime_r_2 ( ) } ) ;
266+ ( { test_strftime_3 ( ) } ) ;
294267 return 0 ;
295268}
0 commit comments