Changeset 28860ec0 in rtems


Ignore:
Timestamp:
Feb 8, 2012, 2:57:04 PM (8 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11, master
Children:
e303adf
Parents:
62d8a54
Message:

Fixed warnings and minor bugs

o Due to the usual integer propagation rules care must be taken in case

off_t is involved.

o Use the effective UID and GID consistently.

Location:
testsuites/fstests
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • testsuites/fstests/fserror/test.c

    r62d8a54 r28860ec0  
    2727#include "pmacros.h"
    2828
    29 void open_mkdir_error (void)
     29static void open_mkdir_error (void)
    3030{
    3131  int fd;
     
    108108}
    109109
    110 void rename_error (void)
     110static void rename_error (void)
    111111{
    112112
     
    193193}
    194194
    195 void truncate_error (void)
     195static void truncate_error (void)
    196196{
    197197
     
    232232
    233233
    234 void rmdir_unlink_error (void)
     234static void rmdir_unlink_error (void)
    235235{
    236236  int status;
     
    305305}
    306306
    307 void rdwr_error (void)
     307static void rdwr_error (void)
    308308{
    309309
  • testsuites/fstests/fslink/test.c

    r62d8a54 r28860ec0  
    3131 * Test if the successful call works as expect
    3232 */
    33 void link_test01 (void)
     33static void link_test01 (void)
    3434{
    3535  char *name0 = "t0";
  • testsuites/fstests/fspatheval/test.c

    r62d8a54 r28860ec0  
    2828#define BUF_SIZE 100
    2929
    30 void make_multiple_files (char **files,int is_directory)
     30static void make_multiple_files (char **files,int is_directory)
    3131{
    3232  int i;
     
    5555}
    5656
    57 void remove_multiple_files (char **files,int is_directory)
     57static void remove_multiple_files (char **files,int is_directory)
    5858{
    5959  int i;
     
    8484}
    8585
    86 void path_eval_test01 (void)
     86static void path_eval_test01 (void)
    8787{
    8888  char *valid_path[] = {
     
    151151
    152152}
    153 void path_eval_test02(void )
     153static void path_eval_test02(void )
    154154{
    155155
  • testsuites/fstests/fspermission/test.c

    r62d8a54 r28860ec0  
    3131 *  Test the umask
    3232 */
    33 void umask_test01(void )
     33static void umask_test01(void )
    3434{
    3535
     
    159159 * Check the file mode in file and directory
    160160 */
    161 void test_premission01(void )
     161static void test_premission01(void )
    162162{
    163163  mode_t tmp_mode;
     
    197197  rtems_test_assert(status==0);
    198198
    199   status=setgid(group_id);
    200   rtems_test_assert(status==0);
    201199  status=seteuid(user_id);
    202200  rtems_test_assert(status==0);
    203   status=seteuid(user_id);
     201  status=setegid(group_id);
    204202  rtems_test_assert(status==0);
    205203
     
    350348  rtems_test_assert(status==0);
    351349
    352   status=setgid(another_group_id);
     350  status=setegid(another_group_id);
    353351  rtems_test_assert(status==0);
    354352
     
    377375  status=seteuid(0);
    378376  rtems_test_assert(status==0);
    379   status=setgid(0);
     377  status=setegid(0);
    380378  rtems_test_assert(status==0);
    381379  free(data_buf);
     
    388386 * Test chown and chmod
    389387 */
    390 void  test_premission02(void )
     388static void  test_premission02(void )
    391389{
    392390  struct stat statbuf;
     
    460458  rtems_test_assert(status==0);
    461459}
    462 void root_test(void )
     460static void root_test(void )
    463461{
    464462  int fd;
     
    470468
    471469  fd=open("test",O_RDONLY);
    472   rtems_test_assert(fd!=-1);
     470  rtems_test_assert(fd==-1);
    473471}
    474472
  • testsuites/fstests/fsrdwr/init.c

    r62d8a54 r28860ec0  
    3333  "again.7Happy days are here again.";
    3434
    35 void
     35static void
    3636read_write_test (void)
    3737{
     
    185185}
    186186
    187 void
     187static void
    188188truncate_test03 (void)
    189189{
     
    283283}
    284284
    285 void
     285static void
    286286lseek_test (void)
    287287{
    288288  int fd;
    289289  int status;
    290   char *name01 = "test_name01";
     290  const char *name01 = "test_name01";
    291291  struct stat statbuf;
    292292
     
    296296  size_t len = strlen (databuf);
    297297  off_t pos;
    298   int total_written = 0;
     298  ssize_t total_written = 0;
    299299
    300300  char *readbuf;
     
    367367  rtems_test_assert (pos == total_written + 1);
    368368
    369 
    370   status = close (fd);
    371   rtems_test_assert (status == 0);
    372 
    373369  /*
    374370   * Check the file size
    375371   */
    376   status = stat (name01, &statbuf);
    377   rtems_test_assert (statbuf.st_size == total_written);
     372  status = fstat (fd, &statbuf);
     373  rtems_test_assert (status == 0);
     374  rtems_test_assert (statbuf.st_size == total_written + 1);
     375
     376  status = ftruncate (fd, total_written);
     377  rtems_test_assert (status == 0);
     378
     379  status = close (fd);
     380  rtems_test_assert (status == 0);
    378381
    379382  /*
     
    394397  rtems_test_assert (!strncmp (databuf, readbuf, len));
    395398
    396   pos = lseek (fd, -len, SEEK_CUR);
     399  pos = lseek (fd, -(off_t) len, SEEK_CUR);
    397400  rtems_test_assert (pos == 3 * len);
    398401  n = read (fd, readbuf, len);
     
    411414  rtems_test_assert (strncmp (databuf, readbuf, len) != 0);
    412415
    413   pos = lseek (fd, -len, SEEK_END);
     416  pos = lseek (fd, -(off_t) len, SEEK_END);
    414417  n = read (fd, readbuf, 2 * len);
    415418  rtems_test_assert (n == len);
     
    437440  rtems_test_assert (!strncmp (databuf, readbuf, len));
    438441
    439   pos = lseek (fd, -len, SEEK_CUR);
     442  pos = lseek (fd, -(off_t) len, SEEK_CUR);
    440443  rtems_test_assert (pos == 3 * len);
    441444  n = read (fd, readbuf, len);
     
    459462   * Use SEEK_END
    460463   */
    461   pos = lseek (fd, -len, SEEK_END);
     464  pos = lseek (fd, -(off_t) len, SEEK_END);
    462465  n = read (fd, readbuf, 2 * len);
    463466  rtems_test_assert (n == len);
     
    469472   * Write the zero to the end of file.
    470473   */
    471   pos = lseek (fd, -len, SEEK_END);
    472   rtems_test_assert (pos == total_written - len);
     474  pos = lseek (fd, -(off_t) len, SEEK_END);
     475  rtems_test_assert (pos == (off_t) total_written - (off_t) len);
    473476  n = write (fd, readbuf, len);
    474477  rtems_test_assert (n == len);
     
    476479   * Verify it
    477480   */
    478   pos = lseek (fd, total_written - len, SEEK_SET);
     481  pos = lseek (fd, (off_t) total_written - (off_t) len, SEEK_SET);
    479482  n = read (fd, readbuf, len);
    480483  rtems_test_assert (n == len);
     
    486489   * Write the zero to the beginning of file.
    487490   */
    488   pos = lseek (fd, -total_written, SEEK_END);
     491  pos = lseek (fd, -(off_t) total_written, SEEK_END);
    489492  rtems_test_assert (pos == 0);
    490493  n = write (fd, readbuf, len);
     
    528531  read_write_test ();
    529532  lseek_test ();
     533  truncate_test03 ();
    530534}
  • testsuites/fstests/fssymlink/test.c

    r62d8a54 r28860ec0  
    3333 */
    3434
    35 void symlink_test01(void )
     35static void symlink_test01(void )
    3636{
    3737  int   fd;
     
    129129 *  symlink loop error test
    130130 */
    131 void symlink_loop_error_test(void )
     131static void symlink_loop_error_test(void )
    132132{
    133133  char* file01="file01";
  • testsuites/fstests/fstime/test.c

    r62d8a54 r28860ec0  
    2929#include "pmacros.h"
    3030
    31 void time_test01 (void)
     31static void time_test01 (void)
    3232{
    3333  struct stat statbuf;
  • testsuites/fstests/imfs_support/fs_support.c

    r62d8a54 r28860ec0  
    1717
    1818#include "fstest.h"
     19#include "fstest_support.h"
    1920
    2021void
  • testsuites/fstests/mdosfs_support/fs_support.c

    r62d8a54 r28860ec0  
    2424#include "ramdisk_support.h"
    2525#include "fstest.h"
     26#include "fstest_support.h"
    2627
    2728#define BLOCK_SIZE 512
  • testsuites/fstests/mimfs_support/fs_support.c

    r62d8a54 r28860ec0  
    1919
    2020#include "fstest.h"
     21#include "fstest_support.h"
    2122
    2223void
  • testsuites/fstests/mrfs_support/fs_support.c

    r62d8a54 r28860ec0  
    2424
    2525#include "fstest.h"
     26#include "fstest_support.h"
    2627
    2728#define BLOCK_SIZE (512)
  • testsuites/fstests/support/fstest.h

    r62d8a54 r28860ec0  
    5151   } while (0)
    5252
     53void test(void);
    5354
    5455#define BASE_FOR_TEST "/mnt"
  • testsuites/fstests/support/fstest_support.c

    r62d8a54 r28860ec0  
    3535
    3636/* Break out of a chroot() environment in C */
    37 void break_out_of_chroot(void)
     37static void break_out_of_chroot(void)
    3838{
    3939
Note: See TracChangeset for help on using the changeset viewer.