Changeset a26ea56d in rtems


Ignore:
Timestamp:
May 11, 2012, 11:19:14 AM (7 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
b16b0aa9
Parents:
be366508
git-author:
Sebastian Huber <sebastian.huber@…> (05/11/12 11:19:14)
git-committer:
Sebastian Huber <sebastian.huber@…> (05/11/12 11:58:44)
Message:

fstests/fsrdwr: Add truncate to zero test case

File:
1 edited

Legend:

Unmodified
Added
Removed
  • testsuites/fstests/fsrdwr/init.c

    rbe366508 ra26ea56d  
    519519}
    520520
     521static void
     522truncate_to_zero (void)
     523{
     524  int fd;
     525  ssize_t n;
     526  int status;
     527  off_t pos;
     528
     529  test_case_enter (__func__);
     530
     531  fd = creat ("file", mode);
     532  rtems_test_assert (fd >= 0);
     533
     534  n = write (fd, databuf, len);
     535  rtems_test_assert (n == (ssize_t) len);
     536
     537  pos = lseek (fd, 0, SEEK_END);
     538  rtems_test_assert (pos == len);
     539
     540  status = ftruncate (fd, 0);
     541  rtems_test_assert (status == 0);
     542
     543  pos = lseek (fd, 0, SEEK_END);
     544  rtems_test_assert (pos == 0);
     545
     546  status = close (fd);
     547  rtems_test_assert (status == 0);
     548
     549  test_case_leave ();
     550}
     551
    521552void
    522553test (void)
     
    525556  lseek_test ();
    526557  truncate_test03 ();
    527 }
     558  truncate_to_zero ();
     559}
Note: See TracChangeset for help on using the changeset viewer.