Changeset 73f9c2c in rtems for testsuites/smptests


Ignore:
Timestamp:
Nov 23, 2016, 12:38:25 PM (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
f6edd880
Parents:
bee0323
git-author:
Sebastian Huber <sebastian.huber@…> (11/23/16 12:38:25)
git-committer:
Sebastian Huber <sebastian.huber@…> (11/23/16 12:44:22)
Message:

smptests/smpfatal03: Use timer to provoke error

Avoid use of internal _Thread_Dispatch_disable() function.

Update #2825.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • testsuites/smptests/smpfatal03/init.c

    rbee0323 r73f9c2c  
    2222const char rtems_test_name[] = "SMPFATAL 3";
    2323
    24 static void task(rtems_task_argument arg)
     24static void bad( rtems_id timer_id, void *arg )
     25{
     26  rtems_id *sem_id;
     27
     28  sem_id = arg;
     29
     30  rtems_semaphore_obtain( *sem_id, RTEMS_WAIT, RTEMS_NO_TIMEOUT );
     31  rtems_test_assert( 0 );
     32}
     33
     34static void Init( rtems_task_argument arg )
    2535{
    2636  rtems_status_code sc;
    27   rtems_id *sem_id;
    28 
    29   sem_id = (rtems_id *) arg;
    30 
    31   sc = rtems_semaphore_obtain(*sem_id, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
    32   rtems_test_assert(sc == RTEMS_SUCCESSFUL);
    33 
    34   sc = rtems_task_wake_after(RTEMS_YIELD_PROCESSOR);
    35   rtems_test_assert(sc == RTEMS_SUCCESSFUL);
    36 
    37   rtems_test_assert(0);
    38 }
    39 
    40 static void Init(rtems_task_argument arg)
    41 {
    42   rtems_status_code sc;
    43   rtems_id task_id;
    44   rtems_id sem_id;
     37  rtems_id          timer_id;
     38  rtems_id          sem_id;
    4539
    4640  TEST_BEGIN();
     
    5448    &sem_id
    5549  );
    56   rtems_test_assert(sc == RTEMS_SUCCESSFUL);
     50  rtems_test_assert( sc == RTEMS_SUCCESSFUL );
    5751
    58   sc = rtems_task_create(
    59     rtems_build_name('T', 'A', 'S', 'K'),
    60     1,
    61     RTEMS_MINIMUM_STACK_SIZE,
    62     RTEMS_DEFAULT_MODES,
    63     RTEMS_DEFAULT_ATTRIBUTES,
    64     &task_id
     52  sc = rtems_timer_create(
     53    rtems_build_name( 'E', 'V', 'I', 'L' ),
     54    &timer_id
    6555  );
    66   rtems_test_assert(sc == RTEMS_SUCCESSFUL);
     56  rtems_test_assert( sc == RTEMS_SUCCESSFUL );
    6757
    68   sc = rtems_task_start(task_id, task, (rtems_task_argument) &sem_id);
    69   rtems_test_assert(sc == RTEMS_SUCCESSFUL);
     58  sc = rtems_semaphore_obtain( sem_id, RTEMS_WAIT, RTEMS_NO_TIMEOUT );
     59  rtems_test_assert( sc == RTEMS_SUCCESSFUL );
    7060
    71   sc = rtems_task_wake_after(RTEMS_YIELD_PROCESSOR);
    72   rtems_test_assert(sc == RTEMS_SUCCESSFUL);
     61  sc = rtems_timer_fire_after( timer_id, 1, bad, &sem_id );
     62  rtems_test_assert( sc == RTEMS_SUCCESSFUL );
    7363
    74   _Thread_Dispatch_disable();
    75   rtems_semaphore_obtain(sem_id, RTEMS_WAIT, RTEMS_NO_TIMEOUT);
    76   rtems_test_assert(0);
     64  rtems_task_wake_after( 2 );
     65  rtems_test_assert( 0 );
    7766}
    7867
     
    9281}
    9382
    94 #define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
     83#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
    9584#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
    9685
     
    9988  RTEMS_TEST_INITIAL_EXTENSION
    10089
    101 #define CONFIGURE_MAXIMUM_TASKS 2
     90#define CONFIGURE_MAXIMUM_TASKS 1
     91#define CONFIGURE_MAXIMUM_TIMERS 1
    10292#define CONFIGURE_MAXIMUM_MRSP_SEMAPHORES 1
    10393
Note: See TracChangeset for help on using the changeset viewer.