File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -21,6 +21,8 @@ pub unsafe fn test_stat_0() {
2121 let mut st: stat = unsafe { std:: mem:: zeroed :: < stat > ( ) } ;
2222 assert ! ( ( ( ( ( libc:: stat( path as * const i8 , ( & mut st as * mut stat) ) ) == ( 0 ) ) as i32 ) != 0 ) ) ;
2323 assert ! ( ( ( ( ( st. st_size) == ( 5_i64 ) ) as i32 ) != 0 ) ) ;
24+ assert ! ( ( ( ( ( st. st_mtime) > ( 0_i64 ) ) as i32 ) != 0 ) ) ;
25+ assert ! ( ( ( ( ( st. st_mtime_nsec) > ( 0_i64 ) ) as i32 ) != 0 ) ) ;
2426 libc:: unlink ( path as * const i8 ) ;
2527}
2628pub unsafe fn test_fstat_1 ( ) {
@@ -39,6 +41,8 @@ pub unsafe fn test_fstat_1() {
3941 let mut st: stat = unsafe { std:: mem:: zeroed :: < stat > ( ) } ;
4042 assert ! ( ( ( ( ( libc:: fstat( fd, ( & mut st as * mut stat) ) ) == ( 0 ) ) as i32 ) != 0 ) ) ;
4143 assert ! ( ( ( ( ( st. st_size) == ( 11_i64 ) ) as i32 ) != 0 ) ) ;
44+ assert ! ( ( ( ( ( st. st_mtime) > ( 0_i64 ) ) as i32 ) != 0 ) ) ;
45+ assert ! ( ( ( ( ( st. st_mtime_nsec) > ( 0_i64 ) ) as i32 ) != 0 ) ) ;
4246 assert ! ( ( ( ( ( libc:: fclose( fp) ) == ( 0 ) ) as i32 ) != 0 ) ) ;
4347 libc:: unlink ( path as * const i8 ) ;
4448}
Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ static void test_stat(void) {
1414 struct stat st ;
1515 assert (stat (path , & st ) == 0 );
1616 assert (st .st_size == 5 );
17+ assert (st .st_mtime > 0 );
18+ assert (st .st_mtim .tv_nsec > 0 );
1719 unlink (path );
1820}
1921
@@ -27,6 +29,8 @@ static void test_fstat(void) {
2729 struct stat st ;
2830 assert (fstat (fd , & st ) == 0 );
2931 assert (st .st_size == 11 );
32+ assert (st .st_mtime > 0 );
33+ assert (st .st_mtim .tv_nsec > 0 );
3034 assert (fclose (fp ) == 0 );
3135 unlink (path );
3236}
You can’t perform that action at this time.
0 commit comments