@@ -395,25 +395,21 @@ fn test_fstat() {
395395
396396 assert_eq ! ( stat. st_size, 5 ) ;
397397 assert_eq ! ( stat. st_mode & libc:: S_IFMT , libc:: S_IFREG ) ;
398- assert_eq ! ( stat. st_nlink, 0 ) ;
399- assert_eq ! ( stat. st_blksize, 0 ) ;
400- assert_eq ! ( stat. st_blocks, 0 ) ;
401- assert_eq ! ( stat. st_ino, 0 ) ;
402- assert ! ( stat. st_dev > 0 ) ;
403- // we can't predict uid/gid, but they should be accessible.
404- let _ = stat. st_uid ;
405- let _ = stat. st_gid ;
406- // for a regular file, rdev is 0.
407- assert_eq ! ( stat. st_rdev, 0 ) ;
408- // times should be non-zero (epoch is in the past).
409- assert ! ( stat. st_atime >= 0 ) ;
410- assert ! ( stat. st_mtime >= 0 ) ;
411- assert ! ( stat. st_ctime >= 0 ) ;
412-
413- // we cannot guarantee nanosecond precision, but the fields should be accessible
414- let _ = stat. st_atime_nsec ;
415- let _ = stat. st_mtime_nsec ;
416- let _ = stat. st_ctime_nsec ;
398+
399+ let _st_nlink = stat. st_nlink ;
400+ let _st_blksize = stat. st_blksize ;
401+ let _st_blocks = stat. st_blocks ;
402+ let _st_ino = stat. st_ino ;
403+ let _st_dev = stat. st_dev ;
404+ let _st_uid = stat. st_uid ;
405+ let _st_gid = stat. st_gid ;
406+ let _st_rdev = stat. st_rdev ;
407+ let _st_atime = stat. st_atime ;
408+ let _st_mtime = stat. st_mtime ;
409+ let _st_ctime = stat. st_ctime ;
410+ let _st_atime_nsec = stat. st_atime_nsec ;
411+ let _st_mtime_nsec = stat. st_mtime_nsec ;
412+ let _st_ctime_nsec = stat. st_ctime_nsec ;
417413
418414 remove_file ( & path) . unwrap ( ) ;
419415}
0 commit comments