[rtems commit] Misc tests: Fix scn files and adjust output
Joel Sherrill
joel at rtems.org
Mon Nov 18 16:48:30 UTC 2013
Module: rtems
Branch: master
Commit: d0beb9bac4d9f73d07e17be4da2de89facd26042
Changeset: http://git.rtems.org/rtems/commit/?id=d0beb9bac4d9f73d07e17be4da2de89facd26042
Author: Joel Sherrill <joel.sherrill at oarcorp.com>
Date: Mon Nov 18 10:54:46 2013 -0600
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 e69de29..184249b 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 e69de29..87ea2db 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 614f60a..2c26d12 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; i<MAX; i++)
{
@@ -84,96 +84,94 @@ POSIX_Init (void *argument)
rtems_test_assert ( fd[i] != -1);
}
- puts (" Init: [WQ] aio_write on 1st file ");
+ puts ("Init: [WQ] aio_write on 1st file");
aiocbp[0] = create_aiocb (fd[0]);
status = aio_write (aiocbp[0]);
rtems_test_assert (status != -1);
- puts (" Init: [WQ] aio_write on 2nd file ");
+ puts ("Init: [WQ] aio_write on 2nd file");
aiocbp[1] = create_aiocb (fd[1]);
status = aio_write (aiocbp[1]);
rtems_test_assert (status != -1);
- puts (" Init: [WQ] aio_read on 2nd file add by priority ");
+ puts ("Init: [WQ] aio_read on 2nd file add by priority");
aiocbp[2] = create_aiocb (fd[1]);
status = aio_read (aiocbp[2]);
rtems_test_assert (status != -1);
- puts (" Init: [WQ] aio_write on 3rd file ");
+ puts ("Init: [WQ] aio_write on 3rd file");
aiocbp[3] = create_aiocb (fd[2]);
status = aio_write (aiocbp[3]);
rtems_test_assert (status != -1);
- puts (" Init: [WQ] aio_write on 4th file ");
+ puts ("Init: [WQ] aio_write on 4th file");
aiocbp[4] = create_aiocb (fd[3]);
status = aio_write (aiocbp[4]);
rtems_test_assert (status != -1);
- puts (" Init: [WQ] aio_write on 5th file -- [WQ] full ");
+ puts ("Init: [WQ] aio_write on 5th file -- [WQ] full");
aiocbp[5] = create_aiocb (fd[4]);
status = aio_write (aiocbp[5]);
rtems_test_assert (status != -1);
- puts (" Init: [IQ] aio_write on 6th file ");
+ puts ("Init: [IQ] aio_write on 6th file");
aiocbp[6] = create_aiocb (fd[5]);
status = aio_write (aiocbp[6]);
rtems_test_assert (status != -1);
- puts (" Init: [IQ] aio_write on 7th file ");
+ puts ("Init: [IQ] aio_write on 7th file");
aiocbp[7] = create_aiocb (fd[6]);
status = aio_write (aiocbp[7]);
rtems_test_assert (status != -1);
- puts (" Init: [IQ] aio_read on 7th file add by priority ");
+ puts ("Init: [IQ] aio_read on 7th file add by priority");
aiocbp[8] = create_aiocb (fd[6]);
status = aio_read (aiocbp[8]);
rtems_test_assert (status != -1);
- puts (" Init: [WQ] aio_sync on 1st file add by priority ");
+ puts ("Init: [WQ] aio_sync on 1st file add by priority");
aiocbp[9] = create_aiocb (fd[0]);
status = aio_fsync (O_SYNC, aiocbp[9]);
rtems_test_assert (status != -1);
- puts (" Init: [NONE] aio_cancel aiocbp=NULL and invalid fildes ");
+ puts ("Init: [NONE] aio_cancel aiocbp=NULL and invalid fildes");
status = aio_cancel (WRONG_FD, NULL);
rtems_test_assert (status == -1);
- puts (" Init: [NONE] aio_cancel aiocbp=NULL valid fildes not in queue ");
+ puts ("Init: [NONE] aio_cancel aiocbp=NULL valid fildes not in queue");
status = aio_cancel (fd[7], NULL);
rtems_test_assert (status == AIO_ALLDONE);
- puts (" Init: [WQ] aio_cancel aiocbp=NULL fildes=fd[1] ");
+ puts ("Init: [WQ] aio_cancel aiocbp=NULL fildes=fd[1]");
status = aio_cancel (fd[1], NULL);
rtems_test_assert (status == AIO_CANCELED);
- puts (" Init: [IQ] aio_cancel aiocbp=NULL fildes=fd[6] ");
+ puts ("Init: [IQ] aio_cancel aiocbp=NULL fildes=fd[6]");
status = aio_cancel (fd[6], NULL);
rtems_test_assert (status == AIO_CANCELED);
- puts (" Init: [NONE] aio_cancel aiocbp->aio_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 e69de29..8c474c4 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 e69de29..87ea2db 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 ***
More information about the vc
mailing list