diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-12-28 16:43:10 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2009-12-28 16:43:10 +0000 |
commit | 161f54b4d60ebff1d40359ac781be3dbe95a3404 (patch) | |
tree | bb161cb53e83b31f055022edad656c990ceab5cc /testsuites | |
parent | 2009-12-28 Aanjhan Ranganathan <aanjhan@gmail.com> (diff) | |
download | rtems-161f54b4d60ebff1d40359ac781be3dbe95a3404.tar.bz2 |
2009-12-28 Shrikant Gaikwad <n3oo3n@gmail.com>
* psx13/test.c, psx13/psx13.scn Added new routine PipeTestNull()
to cover the trivial NULL case for pipe function.
Diffstat (limited to 'testsuites')
-rw-r--r-- | testsuites/psxtests/ChangeLog | 5 | ||||
-rw-r--r-- | testsuites/psxtests/Makefile.am | 6 | ||||
-rw-r--r-- | testsuites/psxtests/psx13/psx13.scn | 1 | ||||
-rw-r--r-- | testsuites/psxtests/psx13/test.c | 21 | ||||
-rw-r--r-- | testsuites/psxtests/psxrdwrv/test.c | 15 |
5 files changed, 35 insertions, 13 deletions
diff --git a/testsuites/psxtests/ChangeLog b/testsuites/psxtests/ChangeLog index f693603afb..8591c72671 100644 --- a/testsuites/psxtests/ChangeLog +++ b/testsuites/psxtests/ChangeLog @@ -1,3 +1,8 @@ +2009-12-28 Shrikant Gaikwad <n3oo3n@gmail.com> + + * psx13/test.c, psx13/psx13.scn Added new routine PipeTestNull() + to cover the trivial NULL case for pipe function. + 2009-12-08 Joel Sherrill <joel.sherrill@oarcorp.com> * psxrwlock01/test.c, psxspin01/test.c, psxspin02/test.c: Fix spacing diff --git a/testsuites/psxtests/Makefile.am b/testsuites/psxtests/Makefile.am index ad6f657c7d..fd7450e2d9 100644 --- a/testsuites/psxtests/Makefile.am +++ b/testsuites/psxtests/Makefile.am @@ -25,11 +25,9 @@ SUBDIRS += psxfile01 psxreaddir psxstat psxmount psx13 psxchroot01 \ ## Until sys/uio.h is moved to libcsupport, we have to have networking ## enabled to support readv and writev. Hopefully this is a temporary ## situation. -if HAS_NETWORKING -if HAS_POSIX +## if NEWLIB SUBDIRS += psxrdwrv -endif -endif +## endif DIST_SUBDIRS = $(SUBDIRS) psxfatal_support EXTRA_DIST = psxfatal_support/init.c psxfatal_support/system.h diff --git a/testsuites/psxtests/psx13/psx13.scn b/testsuites/psxtests/psx13/psx13.scn index 4a012eceaa..0b738368ab 100644 --- a/testsuites/psxtests/psx13/psx13.scn +++ b/testsuites/psxtests/psx13/psx13.scn @@ -8,6 +8,7 @@ Testing fdatasync()...... Success. Testing umask().......... Success. Testing utime().......... Success. Testing pipe()........... Success. +Testing pipe() with NULL........... Failed!!! Testing fsync().......... Success. Testing pathconf()....... Success. Testing fpathconf()...... Success. diff --git a/testsuites/psxtests/psx13/test.c b/testsuites/psxtests/psx13/test.c index e64d029ed5..3a4b9fe809 100644 --- a/testsuites/psxtests/psx13/test.c +++ b/testsuites/psxtests/psx13/test.c @@ -45,6 +45,7 @@ int FDataSyncTest(void); int UMaskTest(void); int UTimeTest(void); int PipeTest(void); +int PipeTestNull(void); int PathConfTest(void); int FPathConfTest(void); int FSyncTest(void); @@ -457,6 +458,20 @@ int PipeTest (void) return(retval); } +int PipeTestNull (void) +{ + int error = 0, retval = FALSE; + + error = pipe(NULL); + + if ((error == -1) && (errno == ENOSYS)) + retval = TRUE; + else + retval = FALSE; + + return(retval); +} + /* --------------------------------------------------------------- * PathConfTest function * @@ -654,6 +669,12 @@ int main( else printf ("Failed!!!\n"); + printf ("Testing pipe() with NULL........... "); + if (PipeTestNull() == TRUE) + printf ("Success.\n"); + else + printf ("Failed!!!\n"); + printf ("Testing fsync().......... "); if (FSyncTest() == TRUE) printf ("Success.\n"); diff --git a/testsuites/psxtests/psxrdwrv/test.c b/testsuites/psxtests/psxrdwrv/test.c index ae47ea1674..6b0e105c86 100644 --- a/testsuites/psxtests/psxrdwrv/test.c +++ b/testsuites/psxtests/psxrdwrv/test.c @@ -1,13 +1,10 @@ /* - * Psx13 - * * This test exercises the following routines: * - * readv - implemented - * writev - implemented - * + * + readv + * + writev * - * COPYRIGHT (c) 1989-2007. + * COPYRIGHT (c) 1989-2009. * On-Line Applications Research Corporation (OAR). * * The license and distribution terms for this file may be @@ -204,7 +201,7 @@ int doErrorTest(void) /* * Open the file for the rest of the tests */ - fp = fopen(TESTFILE, "wt"); + fp = fopen(TESTFILE, "w+"); if ( fp == NULL ) { printf( "fopen for error 2: %d=%s\n", errno, strerror(errno)); return FALSE; @@ -327,7 +324,7 @@ int doErrorTest(void) puts("writev iov_len total overflows -- EINVAL"); rc = writev(fd, vec, 3); if ( (rc != -1) || (errno != EINVAL) ) { - printf( "writev error 7: %d=%s\n", errno, strerror(errno) ); + printf( "writev error 7: rc=%d %d=%s\n", rc, errno, strerror(errno) ); fclose(fp); return FALSE; } @@ -340,7 +337,7 @@ int doErrorTest(void) puts("readv iov_len total overflows -- EINVAL"); rc = readv(fd, vec, 2); if ( (rc != -1) || (errno != EINVAL) ) { - printf( "readv error 7: %d=%s\n", errno, strerror(errno) ); + printf( "read error 7: rc=%d %d=%s\n", rc, errno, strerror(errno) ); fclose(fp); return FALSE; } |