From d0beb9bac4d9f73d07e17be4da2de89facd26042 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Mon, 18 Nov 2013 10:54:46 -0600 Subject: [PATCH] Misc tests: Fix scn files and adjust output --- .../fstests/fsdosfswrite01/fsdosfswrite01.scn | 2 + testsuites/psxtests/psxaio01/psxaio01.scn | 31 +++++++++++++ testsuites/psxtests/psxaio02/init.c | 44 +++++++++---------- testsuites/psxtests/psxaio02/psxaio02.scn | 22 ++++++++++ testsuites/psxtests/psxspin01/psxspin01.scn | 31 +++++++++++++ 5 files changed, 107 insertions(+), 23 deletions(-) diff --git a/testsuites/fstests/fsdosfswrite01/fsdosfswrite01.scn b/testsuites/fstests/fsdosfswrite01/fsdosfswrite01.scn index e69de29bb2..184249be94 100644 --- a/testsuites/fstests/fsdosfswrite01/fsdosfswrite01.scn +++ b/testsuites/fstests/fsdosfswrite01/fsdosfswrite01.scn @@ -0,0 +1,2 @@ +*** TEST FSDOSFSWRITE 1 *** +*** END OF TEST FSDOSFSWRITE 1 *** diff --git a/testsuites/psxtests/psxaio01/psxaio01.scn b/testsuites/psxtests/psxaio01/psxaio01.scn index e69de29bb2..87ea2dbdbb 100644 --- a/testsuites/psxtests/psxaio01/psxaio01.scn +++ b/testsuites/psxtests/psxaio01/psxaio01.scn @@ -0,0 +1,31 @@ +*** POSIX SPINLOCK TEST 01 *** +pthread_spin_init( NULL, PTHREAD_PROCESS_PRIVATE ) -- EINVAL +pthread_spin_init( NULL, PTHREAD_PROCESS_SHARED ) -- EINVAL +pthread_spin_init( &spinlock, 0x1234 ) -- EINVAL +pthread_spin_init( &spinlock, PTHREAD_PROCESS_SHARED ) -- EINVAL +pthread_spin_init( &Spinlock, PTHREAD_PROCESS_PRIVATE ) -- OK +pthread_spin_init( &spinlock, PTHREAD_PROCESS_PRIVATE ) -- EAGAIN +pthread_spin_init( &spinlock, PTHREAD_PROCESS_PRIVATE ) -- EAGAIN +pthread_spin_lock( NULL ) -- EINVAL +pthread_spin_trylock( NULL ) -- EINVAL +pthread_spin_unlock( NULL ) -- EINVAL +pthread_spin_destroy( NULL ) -- EINVAL +pthread_spin_lock( &spinlock ) -- EINVAL +pthread_spin_trylock( &spinlock ) -- EINVAL +pthread_spin_unlock( &spinlock ) -- EINVAL +pthread_spin_destroy( &spinlock ) -- EINVAL +pthread_spin_unlock( &Spinlock ) -- already unlocked OK +pthread_spin_lock( &Spinlock ) -- OK +pthread_spin_lock( &Spinlock ) -- EDEADLK +pthread_spin_trylock( &Spinlock ) -- EDEADLK +pthread_spin_unlock( &Spinlock ) -- OK +pthread_spin_trylock( &Spinlock ) -- OK +pthread_spin_unlock( &Spinlock ) -- OK +pthread_spin_lock( &Spinlock ) from Thread -- OK +sleep to allow main thread to run +pthread_spin_lock( &Spinlock ) -- OK +pthread_spin_unlock( &Spinlock ) from Thread -- OK +pthread_spin_destroy( &Spinlock ) -- EBUSY +pthread_spin_unlock( &Spinlock ) -- OK +pthread_spin_destroy( &Spinlock ) -- OK +*** END OF POSIX SPINLOCK TEST 01 *** diff --git a/testsuites/psxtests/psxaio02/init.c b/testsuites/psxtests/psxaio02/init.c index 614f60a7e4..2c26d127c6 100644 --- a/testsuites/psxtests/psxaio02/init.c +++ b/testsuites/psxtests/psxaio02/init.c @@ -75,7 +75,7 @@ POSIX_Init (void *argument) puts ("\n\n*** POSIX AIO TEST 02 ***"); - puts (" Init: Open files "); + puts ("Init: Open files"); for (i=0; iaio_fildes != fildes "); + puts ("Init: [NONE] aio_cancel aiocbp->aio_fildes != fildes"); status = aio_cancel (fd[4],aiocbp[4]); rtems_test_assert (status == -1 ); - puts (" Init: [NONE] aio_cancel FD on [IQ], aiocb not on chain "); + puts ("Init: [NONE] aio_cancel FD on [IQ], aiocb not on chain"); aiocbp[10] = create_aiocb (fd[9]); status = aio_cancel (fd[9], aiocbp[10]); rtems_test_assert (status == -1); - puts (" Init: [IQ] aio_cancel 6th file only one request "); + puts ("Init: [IQ] aio_cancel 6th file only one request"); status = aio_cancel (fd[5], aiocbp[6]); rtems_test_assert (status == AIO_CANCELED); - puts (" Init: [WQ] aio_cancel 1st file only one request "); + puts ("Init: [WQ] aio_cancel 1st file only one request"); status = aio_cancel (fd[0], aiocbp[9]); rtems_test_assert (status == AIO_CANCELED); - puts (" Init: [NONE] aio_cancel empty [IQ] "); + puts ("Init: [NONE] aio_cancel empty [IQ]"); status = aio_cancel (fd[5], aiocbp[6]); rtems_test_assert (status == AIO_ALLDONE); - puts ("\n\n*** POSIX AIO TEST 02 ***"); - - puts ("*** END OF POSIX AIO TEST 01 ***"); + puts ("*** END OF POSIX AIO TEST 02 ***"); for (i = 0; i < MAX; i++) { diff --git a/testsuites/psxtests/psxaio02/psxaio02.scn b/testsuites/psxtests/psxaio02/psxaio02.scn index e69de29bb2..8c474c4701 100644 --- a/testsuites/psxtests/psxaio02/psxaio02.scn +++ b/testsuites/psxtests/psxaio02/psxaio02.scn @@ -0,0 +1,22 @@ +*** POSIX AIO TEST 02 *** +Init: Open files +Init: [WQ] aio_write on 1st file +Init: [WQ] aio_write on 2nd file +Init: [WQ] aio_read on 2nd file add by priority +Init: [WQ] aio_write on 3rd file +Init: [WQ] aio_write on 4th file +Init: [WQ] aio_write on 5th file -- [WQ] full +Init: [IQ] aio_write on 6th file +Init: [IQ] aio_write on 7th file +Init: [IQ] aio_read on 7th file add by priority +Init: [WQ] aio_sync on 1st file add by priority +Init: [NONE] aio_cancel aiocbp=NULL and invalid fildes +Init: [NONE] aio_cancel aiocbp=NULL valid fildes not in queue +Init: [WQ] aio_cancel aiocbp=NULL fildes=fd[1] +Init: [IQ] aio_cancel aiocbp=NULL fildes=fd[6] +Init: [NONE] aio_cancel aiocbp->aio_fildes != fildes +Init: [NONE] aio_cancel FD on [IQ], aiocb not on chain +Init: [IQ] aio_cancel 6th file only one request +Init: [WQ] aio_cancel 1st file only one request +Init: [NONE] aio_cancel empty [IQ] +*** END OF POSIX AIO TEST 02 *** diff --git a/testsuites/psxtests/psxspin01/psxspin01.scn b/testsuites/psxtests/psxspin01/psxspin01.scn index e69de29bb2..87ea2dbdbb 100644 --- a/testsuites/psxtests/psxspin01/psxspin01.scn +++ b/testsuites/psxtests/psxspin01/psxspin01.scn @@ -0,0 +1,31 @@ +*** POSIX SPINLOCK TEST 01 *** +pthread_spin_init( NULL, PTHREAD_PROCESS_PRIVATE ) -- EINVAL +pthread_spin_init( NULL, PTHREAD_PROCESS_SHARED ) -- EINVAL +pthread_spin_init( &spinlock, 0x1234 ) -- EINVAL +pthread_spin_init( &spinlock, PTHREAD_PROCESS_SHARED ) -- EINVAL +pthread_spin_init( &Spinlock, PTHREAD_PROCESS_PRIVATE ) -- OK +pthread_spin_init( &spinlock, PTHREAD_PROCESS_PRIVATE ) -- EAGAIN +pthread_spin_init( &spinlock, PTHREAD_PROCESS_PRIVATE ) -- EAGAIN +pthread_spin_lock( NULL ) -- EINVAL +pthread_spin_trylock( NULL ) -- EINVAL +pthread_spin_unlock( NULL ) -- EINVAL +pthread_spin_destroy( NULL ) -- EINVAL +pthread_spin_lock( &spinlock ) -- EINVAL +pthread_spin_trylock( &spinlock ) -- EINVAL +pthread_spin_unlock( &spinlock ) -- EINVAL +pthread_spin_destroy( &spinlock ) -- EINVAL +pthread_spin_unlock( &Spinlock ) -- already unlocked OK +pthread_spin_lock( &Spinlock ) -- OK +pthread_spin_lock( &Spinlock ) -- EDEADLK +pthread_spin_trylock( &Spinlock ) -- EDEADLK +pthread_spin_unlock( &Spinlock ) -- OK +pthread_spin_trylock( &Spinlock ) -- OK +pthread_spin_unlock( &Spinlock ) -- OK +pthread_spin_lock( &Spinlock ) from Thread -- OK +sleep to allow main thread to run +pthread_spin_lock( &Spinlock ) -- OK +pthread_spin_unlock( &Spinlock ) from Thread -- OK +pthread_spin_destroy( &Spinlock ) -- EBUSY +pthread_spin_unlock( &Spinlock ) -- OK +pthread_spin_destroy( &Spinlock ) -- OK +*** END OF POSIX SPINLOCK TEST 01 ***