summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-05-17 17:23:44 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-05-20 07:49:36 +0200
commit12a1228c593166069ac316f91865bdd9bb812ba1 (patch)
tree750ab10dc69c7dbdbe9a8af71e86da1973856ff1
parentarm/raspberrypi: add cmdline support for rpi bsp. (diff)
downloadrtems-12a1228c593166069ac316f91865bdd9bb812ba1.tar.bz2
psxclassic01: Assume correct pthread_detach()
Update #2714.
-rw-r--r--testsuites/psxtests/psxclassic01/init.c35
-rw-r--r--testsuites/psxtests/psxclassic01/psxclassic01.scn6
2 files changed, 31 insertions, 10 deletions
diff --git a/testsuites/psxtests/psxclassic01/init.c b/testsuites/psxtests/psxclassic01/init.c
index 3ffbd3cf92..924224c7b7 100644
--- a/testsuites/psxtests/psxclassic01/init.c
+++ b/testsuites/psxtests/psxclassic01/init.c
@@ -99,17 +99,14 @@ rtems_task test_task(rtems_task_argument arg)
}
}
puts( "test_task exiting thread" );
- pthread_exit( 0 );
+ pthread_exit( (void *) 123 );
}
-rtems_task Init(rtems_task_argument arg)
+
+static rtems_id create_task( void )
{
rtems_status_code sc;
rtems_id task_id;
- int status;
- void *retval;
-
- TEST_BEGIN();
sc = rtems_task_create(
rtems_build_name('T','E','S','T'),
@@ -124,6 +121,18 @@ rtems_task Init(rtems_task_argument arg)
sc = rtems_task_start( task_id, test_task, 0 );
rtems_test_assert( sc == RTEMS_SUCCESSFUL );
+ return task_id;
+}
+
+rtems_task Init( rtems_task_argument arg )
+{
+ rtems_id task_id;
+ int status;
+ void *retval;
+
+ TEST_BEGIN();
+
+ task_id = create_task();
puts( "Init - pthread_equal on Classic Ids" );
status = pthread_equal( task_id, task_id );
@@ -136,13 +145,23 @@ rtems_task Init(rtems_task_argument arg)
status = pthread_detach( task_id );
rtems_test_assert( status == 0 );
+ retval = (void *) 456;
status = pthread_join( task_id, &retval );
- if ( status != EINVAL ) printf( "JOIN %s\n", strerror( status ) );
- rtems_test_assert( status == EINVAL );
+ rtems_test_assert( status == ESRCH );
+ rtems_test_assert( retval == (void *) 456 );
+
+ status = pthread_kill( task_id, SIGUSR1 );
+ rtems_test_assert( status == ESRCH );
+
+ task_id = create_task();
status = pthread_kill( task_id, SIGUSR1 );
rtems_test_assert( status == 0 );
+ status = pthread_join( task_id, &retval );
+ rtems_test_assert( status == 0 );
+ rtems_test_assert( retval == (void *) 123 );
+
TEST_END();
exit(0);
}
diff --git a/testsuites/psxtests/psxclassic01/psxclassic01.scn b/testsuites/psxtests/psxclassic01/psxclassic01.scn
index 1d7c4ddae5..a78375049a 100644
--- a/testsuites/psxtests/psxclassic01/psxclassic01.scn
+++ b/testsuites/psxtests/psxclassic01/psxclassic01.scn
@@ -1,8 +1,10 @@
-*** START OF CLASSIC API TEST OF POSIX 01 ***
+*** BEGIN OF TEST PSXCLASSIC 1 ***
test_task starting...
test_task waiting for signal...
Init - pthread_equal on Classic Ids
Init - pthread_cancel on Classic Task
+test_task starting...
+test_task waiting for signal...
Signal_info: 25 si_signo= 0 si_code= 0 value= 0
test_task exiting thread
-*** END OF CLASSIC API TEST OF POSIX 01 ***
+*** END OF TEST PSXCLASSIC 1 ***