Ignore:
Timestamp:
Nov 17, 2000, 7:06:40 PM (20 years ago)
Author:
Jennifer Averett <Jennifer.Averett@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
2e3ce06
Parents:
13e47e2e
Message:

2000-11-17 Jennifer Averret <jennifer@…>

  • psxmount/test.c, psxmount/psxmount.scn: Improve output to report expected error condition in one case.
  • psxreaddir/test.c, psxreaddir.scn: Added test cases to exercise readdir() of root of mounted filesystem. Also corrected the screen file for some mistakes noticed in this effort.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • testsuites/psxtests/psxreaddir/test.c

    r13e47e2e r1e566bbb  
    2929#include <unistd.h>
    3030#include <errno.h>
     31#include <imfs.h>
     32#include <assert.h>
    3133
    3234DIR *directory;
     
    6365
    6466  }
     67}
     68
     69void complete_printdir( char *path )
     70{
     71  DIR *the_dir;
     72  int status;
     73
     74  the_dir = opendir( path );
     75  assert( the_dir );
     76  printdir( the_dir );
     77  status = closedir( the_dir );
    6578}
    6679
     
    167180}
    168181
     182int test_across_mount()
     183{
     184  rtems_filesystem_mount_table_entry_t *mt_entry;
     185  int                                  status;
     186
     187  /*
     188   * Verify Readdir works correctly over mount points.
     189   */
     190
     191  printf("Validate readdir across mount point\n");
     192  assert( mkdir( "/imfs", 0777 ) == 0 );
     193  assert( mkdir( "/imfs/should_be_hidden", 0777 ) == 0 );
     194  complete_printdir("/imfs" );
     195  printf("Attempting to mount IMFS file system at /imfs \n");
     196  status = mount(
     197     &mt_entry,
     198     &IMFS_ops,
     199     RTEMS_FILESYSTEM_READ_WRITE,
     200     NULL,
     201     "/imfs" );
     202  assert( status == 0 );
     203  if( mt_entry == NULL ){
     204     printf(" NULL mount table entry was returned\n");
     205  }
     206  printf( "create /imfs/testdir and /imfs/testdir/testsubdir\n");
     207
     208  status = mkdir( "/imfs/testdir", 0777 );
     209  assert( status == 0 );
     210  status = mkdir( "/imfs/testdir/testsubdir", 0777 );
     211  assert( status == 0 );
     212 
     213  complete_printdir("/imfs" );
     214  complete_printdir("/imfs/" );
     215  complete_printdir("/imfs/." );
     216  complete_printdir("/imfs/testdir" );
     217  complete_printdir("/imfs/testdir/.." );
     218}
     219
    169220#if defined(__rtems__)
    170221int test_main(void)
     
    443494  }
    444495
    445 
     496  test_across_mount();
    446497  printf( "\n\n*** END OF READDIR TEST ***\n" );
    447498  exit(0);
Note: See TracChangeset for help on using the changeset viewer.