Changeset d6467102 in rtems


Ignore:
Timestamp:
Jun 15, 2016, 7:04:29 AM (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
917884c
Parents:
5d65d0dd
git-author:
Sebastian Huber <sebastian.huber@…> (06/15/16 07:04:29)
git-committer:
Sebastian Huber <sebastian.huber@…> (06/15/16 07:11:19)
Message:

psxtests/psx12: Use one file and simplify

Location:
testsuites/psxtests/psx12
Files:
2 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • testsuites/psxtests/psx12/Makefile.am

    r5d65d0dd rd6467102  
    11
    22rtems_tests_PROGRAMS = psx12
    3 psx12_SOURCES = init.c task.c system.h ../include/pmacros.h
     3psx12_SOURCES = init.c ../include/pmacros.h
    44
    55dist_rtems_tests_DATA = psx12.scn
  • testsuites/psxtests/psx12/init.c

    r5d65d0dd rd6467102  
    1313
    1414#include <sched.h>
     15#include <errno.h>
    1516
    16 #define CONFIGURE_INIT
    17 #include "system.h"
    18 #include <errno.h>
    19 #include "pritime.h"
     17#include <pmacros.h>
    2018
    2119const char rtems_test_name[] = "PSX 12";
    2220
    23 void print_schedparam(
    24   char               *prefix,
    25   struct sched_param *schedparam
    26 );
     21static void *sporadic_server( void *argument )
     22{
     23  puts( "Sporadic Server: exitting" );
    2724
    28 void print_schedparam(
    29   char               *prefix,
    30   struct sched_param *schedparam
    31 )
    32 {
    33   printf( "%ssched priority      = %d\n", prefix, schedparam->sched_priority );
    34 #if defined(_POSIX_SPORADIC_SERVER)
    35   printf( "%ssched_ss_low_priority     = %d\n",
    36      prefix, schedparam->sched_ss_low_priority );
    37   printf( "%ssched_ss_repl_period = (%" PRIdtime_t ", %ld)\n", prefix,
    38      schedparam->sched_ss_repl_period.tv_sec,
    39      schedparam->sched_ss_repl_period.tv_nsec );
    40   printf( "%ssched_ss_init_budget = (%" PRIdtime_t ", %ld)\n", prefix,
    41      schedparam->sched_ss_init_budget.tv_sec,
    42      schedparam->sched_ss_init_budget.tv_nsec );
    43 #else
    44   printf( "%s_POSIX_SPORADIC_SERVER is not defined\n", prefix );
    45 #endif
     25  return NULL;
    4626}
    4727
    48 void *POSIX_Init(
    49   void *argument
    50 )
     28static void *POSIX_Init( void *argument )
    5129{
    5230  int                 status;
    5331  pthread_attr_t      attr;
     32  pthread_t           thread;
    5433  struct sched_param  schedparam;
    5534
     
    6241  /* get id of this thread */
    6342
    64   Init_id = pthread_self();
    65   printf( "Init's ID is 0x%08" PRIxpthread_t "\n", Init_id );
     43  printf( "Init's ID is 0x%08" PRIxpthread_t "\n", pthread_self() );
    6644
    6745  /* invalid scheduling policy error */
     
    7654
    7755  puts( "Init: pthread_create - EINVAL (invalid scheduling policy)" );
    78   status = pthread_create( &Task_id, &attr, Task_1, NULL );
     56  status = pthread_create( &thread, &attr, sporadic_server, NULL );
    7957  rtems_test_assert( status == EINVAL );
    8058
     
    10482
    10583  puts( "Init: pthread_create - EINVAL (replenish < budget)" );
    106   status = pthread_create( &Task_id, &attr, Task_1, NULL );
     84  status = pthread_create( &thread, &attr, sporadic_server, NULL );
    10785  rtems_test_assert( status == EINVAL );
    10886
     
    12199
    122100  puts( "Init: pthread_create - EINVAL (invalid sched_ss_low_priority)" );
    123   status = pthread_create( &Task_id, &attr, Task_1, NULL );
     101  status = pthread_create( &thread, &attr, sporadic_server, NULL );
    124102  rtems_test_assert( status == EINVAL );
    125103
     
    138116
    139117  puts( "Init: pthread_create - SUCCESSFUL" );
    140   status = pthread_create( &Task_id, &attr, Task_1, NULL );
     118  status = pthread_create( &thread, &attr, sporadic_server, NULL );
    141119  rtems_test_assert( !status );
    142120
    143   status = pthread_join( Task_id, NULL );
    144   rtems_test_assert( status );
     121  status = pthread_join( thread, NULL );
     122  rtems_test_assert( !status );
    145123
    146124    /* switch to Task_1 */
     
    151129  return NULL; /* just so the compiler thinks we returned something */
    152130}
     131
     132#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
     133#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
     134
     135#define CONFIGURE_INITIAL_EXTENSIONS RTEMS_TEST_INITIAL_EXTENSION
     136
     137#define CONFIGURE_MAXIMUM_POSIX_THREADS 2
     138
     139#define CONFIGURE_POSIX_INIT_THREAD_TABLE
     140
     141#define CONFIGURE_INIT
     142
     143#include <rtems/confdefs.h>
  • testsuites/psxtests/psx12/psx12.scn

    r5d65d0dd rd6467102  
    1 *** POSIX TEST 12 ***
     1*** BEGIN OF TEST PSX 12 ***
    22Init's ID is 0x0b010001
    33Init: pthread_attr_init - SUCCESSFUL
     
    66Init: set scheduling parameter attributes for sporadic server
    77Init: pthread_create - EINVAL (replenish < budget)
    8 Init: pthread_create - EINVAL (invalid ss_low_priority)
     8Init: pthread_create - EINVAL (invalid sched_ss_low_priority)
    99Init: pthread_create - SUCCESSFUL
    10 Task_1: exitting
    11 *** END OF POSIX TEST 12 ***
     10Sporadic Server: exitting
     11*** END OF TEST PSX 12 ***
Note: See TracChangeset for help on using the changeset viewer.