summaryrefslogtreecommitdiffstats
path: root/testsuites/psxtests/psxreaddir/test.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-12-08 17:52:53 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-12-08 17:52:53 +0000
commit2317457e101509ca16a669d99719ae44b0c60599 (patch)
tree76c26f4c12c18c55f067f00e644a28dded70c79b /testsuites/psxtests/psxreaddir/test.c
parent2009-12-08 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-2317457e101509ca16a669d99719ae44b0c60599.tar.bz2
2009-12-08 Joel Sherrill <joel.sherrill@oarcorp.com>
* include/pmacros.h, psx01/task.c, psx02/init.c, psx02/task.c, psx03/init.c, psx03/task.c, psx04/init.c, psx04/task1.c, psx04/task2.c, psx04/task3.c, psx05/init.c, psx05/task.c, psx05/task2.c, psx05/task3.c, psx06/init.c, psx06/task.c, psx06/task2.c, psx07/init.c, psx08/init.c, psx08/task2.c, psx08/task3.c, psx09/init.c, psx10/init.c, psx10/task.c, psx10/task2.c, psx10/task3.c, psx11/init.c, psx11/task.c, psx12/init.c, psxalarm01/init.c, psxbarrier01/test.c, psxcancel01/init.c, psxchroot01/test.c, psxclock/init.c, psxfile01/test.c, psxfile01/test_cat.c, psxfile01/test_extend.c, psxfile01/test_write.c, psxitimer/init.c, psxkey01/task.c, psxkey02/init.c, psxkey03/init.c, psxmount/test.c, psxmsgq01/init.c, psxmsgq03/init.c, psxmsgq04/init.c, psxreaddir/test.c, psxrwlock01/test.c, psxsem01/init.c, psxsignal01/init.c, psxsignal01/task1.c, psxsignal02/init.c, psxsignal03/init.c, psxsignal05/init.c, psxspin01/test.c, psxspin02/test.c, psxstack01/init.c, psxstat/test.c, psxtime/test.c, psxualarm/init.c: Use rtems_test_assert() consistently instead of system assert(). rtems_test_assert() is designed to integrate into the RTEMS test suite infrastructure.
Diffstat (limited to 'testsuites/psxtests/psxreaddir/test.c')
-rw-r--r--testsuites/psxtests/psxreaddir/test.c59
1 files changed, 31 insertions, 28 deletions
diff --git a/testsuites/psxtests/psxreaddir/test.c b/testsuites/psxtests/psxreaddir/test.c
index 72e6128f9d..f139003ba6 100644
--- a/testsuites/psxtests/psxreaddir/test.c
+++ b/testsuites/psxtests/psxreaddir/test.c
@@ -15,7 +15,12 @@
* implementation of this appears to seek to the ((off/DIRENT_SIZE) + 1)
* record where DIRENT_SIZE seems to be 12 bytes.
*
+ * COPYRIGHT (c) 1989-2009.
+ * On-Line Applications Research Corporation (OAR).
*
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ * http://www.rtems.com/license/LICENSE.
*
* $Id$
*/
@@ -25,11 +30,9 @@
#include <fcntl.h>
#include <dirent.h>
#include <string.h>
-#include <assert.h>
#include <unistd.h>
#include <errno.h>
#include <rtems/imfs.h>
-#include <assert.h>
DIR *directory;
DIR *directory2;
@@ -71,7 +74,7 @@ void complete_printdir( char *path )
int status;
the_dir = opendir( path );
- assert( the_dir );
+ rtems_test_assert( the_dir );
printdir( the_dir );
status = closedir( the_dir );
}
@@ -188,8 +191,8 @@ void test_across_mount(void)
*/
printf("Validate readdir across mount point\n");
- assert( mkdir( "/imfs", 0777 ) == 0 );
- assert( mkdir( "/imfs/should_be_hidden", 0777 ) == 0 );
+ rtems_test_assert( mkdir( "/imfs", 0777 ) == 0 );
+ rtems_test_assert( mkdir( "/imfs/should_be_hidden", 0777 ) == 0 );
complete_printdir("/imfs" );
printf("Attempting to mount IMFS file system at /imfs \n");
status = mount(
@@ -198,16 +201,16 @@ void test_across_mount(void)
RTEMS_FILESYSTEM_READ_WRITE,
NULL,
"/imfs" );
- assert( status == 0 );
+ rtems_test_assert( status == 0 );
if( mt_entry == NULL ){
printf(" NULL mount table entry was returned\n");
}
printf( "create /imfs/testdir and /imfs/testdir/testsubdir\n");
status = mkdir( "/imfs/testdir", 0777 );
- assert( status == 0 );
+ rtems_test_assert( status == 0 );
status = mkdir( "/imfs/testdir/testsubdir", 0777 );
- assert( status == 0 );
+ rtems_test_assert( status == 0 );
complete_printdir("/imfs" );
complete_printdir("/imfs/" );
@@ -273,7 +276,7 @@ int main(
printf("open /b/myfile\n");
fd = open ("/b/my_file", O_CREAT, S_IRWXU);
- assert( fd != -1 );
+ rtems_test_assert( fd != -1 );
close (fd);
printf("scandir a file status: ");
@@ -287,20 +290,20 @@ int main(
printf("Open /b/new_file\n");
fd = open( "/b/new_file", O_CREAT, S_IRWXU );
- assert( fd != -1 );
+ rtems_test_assert( fd != -1 );
printf("fcntl F_SETFD should return 0\n");
status = fcntl( fd, F_SETFD, 1 );
- assert( status == 0 );
+ rtems_test_assert( status == 0 );
printf("fcntl F_SETFD should return 1\n");
status = fcntl( fd, F_GETFD, 1 );
- assert( status == 1 );
+ rtems_test_assert( status == 1 );
#if 0
printf("fcntl F_DUPFD should return 0\n");
status = fcntl( fd, F_DUPFD, 0 );
- assert ( status == 0 );
+ rtems_test_assert ( status == 0 );
#else
printf("fcntl F_DUPFD should return 0 -- skip until implemented\n");
#endif
@@ -308,41 +311,41 @@ int main(
printf("fcntl F_GETFL returns current flags\n");
status = fcntl( fd, F_GETFL, 1 );
printf("fcntl F_GETFL returned 0x%x\n", status );
- assert( status != -1 );
+ rtems_test_assert( status != -1 );
printf("fcntl F_SETFL to add O_APPEND and O_NONBLOCK\n");
status = fcntl( fd, F_SETFL, O_APPEND|O_NONBLOCK );
- assert ( status != -1 );
+ rtems_test_assert ( status != -1 );
printf("fcntl F_GETFL return current flags to see changes\n");
status = fcntl( fd, F_GETFL, 1 );
printf("fcntl F_GETFL returned 0x%x\n", status );
- assert( status != -1 );
+ rtems_test_assert( status != -1 );
printf("fcntl F_GETLK should return -1\n");
status = fcntl( fd, F_GETLK, 1 );
- assert ( status == -1 );
+ rtems_test_assert ( status == -1 );
printf("fcntl F_SETLK should return -1\n");
status = fcntl( fd, F_SETLK, 1 );
- assert ( status == -1 );
+ rtems_test_assert ( status == -1 );
printf("fcntl F_SETLKW should return -1\n");
status = fcntl( fd, F_SETLKW, 1 );
- assert ( status == -1 );
+ rtems_test_assert ( status == -1 );
printf("fcntl F_SETOWN should return -1\n");
status = fcntl( fd, F_SETOWN, 1 );
- assert ( status == -1 );
+ rtems_test_assert ( status == -1 );
printf("fcntl F_GETOWN should return -1\n");
status = fcntl( fd, F_GETOWN, 1 );
- assert ( status == -1 );
+ rtems_test_assert ( status == -1 );
printf("fcntl invalid argument should return -1\n");
status = fcntl( fd, 0xb, 1 );
printf("Status %d\n",status);
- assert( status == -1 );
+ rtems_test_assert( status == -1 );
printf("opendir and readdir /b/myfile\n");
directory_not = opendir ("/b/my_file");
@@ -354,7 +357,7 @@ int main(
printf("chdir to /b/myfile\n");
status = chdir ("/b/my_file");
- assert (status == -1);
+ rtems_test_assert (status == -1);
printf( "\nPerforming stat of directory /\n");
status = stat( "/", &s );
@@ -362,18 +365,18 @@ int main(
puts( "\nOpen and print directory /" );
directory = opendir("/");
- assert( directory );
+ rtems_test_assert( directory );
printdir(directory);
printf("\nmkdir /d/my_dir\n");
status = mkdir( "/d/my_dir", 0x1c0 );
printf("Open /d/my_dir\n");
directory_not = opendir( "/d/my_dir" );
- assert( directory_not );
+ rtems_test_assert( directory_not );
printf( "remove /d/my_dir.\n" );
status = rmdir( "/d/my_dir" );
- assert( status == 0 );
+ rtems_test_assert( status == 0 );
printf( "close /d/my_dir.\n" );
closedir( directory_not );
@@ -381,14 +384,14 @@ int main(
printf( "\nOpening directory /c\n" );
directory2 = opendir("/c");
- assert( directory2 );
+ rtems_test_assert( directory2 );
printdir(directory2);
status = closedir( directory2 );
printf( "\nOpening directory /c/y\n" );
directory3 = opendir("/c/y");
- assert( directory3 );
+ rtems_test_assert( directory3 );
printdir(directory3);
status = closedir( directory3 );