Changeset 0268adb3 in rtems


Ignore:
Timestamp:
Nov 22, 2012, 1:09:03 PM (7 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
86d80f0
Parents:
fe0f24e
git-author:
Sebastian Huber <sebastian.huber@…> (11/22/12 13:09:03)
git-committer:
Sebastian Huber <sebastian.huber@…> (11/22/12 15:35:05)
Message:

fstests/fsfseeko01: Add test cases

File:
1 edited

Legend:

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

    rfe0f24e r0268adb3  
    3333    : (sizeof(off_t) == sizeof(int32_t) ? INT32_MAX : 1);
    3434  off_t actual_off;
     35  const long long_off = LONG_MAX;
     36  long actual_long_off;
    3537
    3638  errno = 0;
    3739  file = fopen("file", "w+");
    38   perror("fopen");
    3940  rtems_test_assert(file != NULL);
     41  rtems_test_assert(errno == 0);
     42
     43  errno = 0;
     44  rv = fseek(file, long_off, SEEK_SET);
     45  rtems_test_assert(rv == 0);
     46  rtems_test_assert(errno == 0);
     47
     48  errno = 0;
     49  actual_long_off = ftell(file);
     50  rtems_test_assert(actual_long_off == long_off);
     51  rtems_test_assert(errno == 0);
     52
     53  errno = 0;
     54  actual_off = ftello(file);
     55  rtems_test_assert(actual_off == long_off);
     56  rtems_test_assert(errno == 0);
    4057
    4158  errno = 0;
    4259  rv = fseeko(file, off, SEEK_SET);
    43   perror("fseeko");
    4460  rtems_test_assert(rv == 0);
     61  rtems_test_assert(errno == 0);
     62
     63  errno = 0;
     64  actual_long_off = ftell(file);
     65  rtems_test_assert(actual_long_off == -1L);
     66  rtems_test_assert(errno == EOVERFLOW);
    4567
    4668  errno = 0;
    4769  actual_off = ftello(file);
    48   perror("ftello");
    4970  rtems_test_assert(actual_off == off);
     71  rtems_test_assert(errno == 0);
    5072
    5173  errno = 0;
    5274  rv = fclose(file);
    53   perror("fclose");
    5475  rtems_test_assert(rv == 0);
     76  rtems_test_assert(errno == 0);
    5577}
    5678
Note: See TracChangeset for help on using the changeset viewer.