Changeset bb14405d in rtems


Ignore:
Timestamp:
Dec 4, 2009, 2:08:51 PM (9 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, master
Children:
4583cac
Parents:
0cd3878
Message:

2009-12-04 Sebastian Huber <Sebastian.Huber@…>

  • sp31/sp31.scn, sp31/task1.c, spintrcritical17/init.c: New test cases. Updated copyright notice.
Location:
testsuites/sptests
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • testsuites/sptests/ChangeLog

    r0cd3878 rbb14405d  
     12009-12-04      Sebastian Huber <Sebastian.Huber@embedded-brains.de>
     2
     3        * sp31/sp31.scn, sp31/task1.c, spintrcritical17/init.c: New test
     4        cases. Updated copyright notice.
     5
    162009-12-02      Ralf Corsépius <ralf.corsepius@rtems.org>
    27
  • testsuites/sptests/sp31/sp31.scn

    r0cd3878 rbb14405d  
    4848TA1 - rtems_clock_get_tod - 09:00:11   12/31/1988
    4949TA1 - rtems_timer_cancel - timer 1
     50TA1 - rtems_timer_server_fire_when - timer 1 in 3 seconds
     51TA1 - rtems_timer_server_fire_when - timer 2 in 3 seconds
     52TA1 - rtems_task_wake_after - 1 second
     53TA1 - rtems_timer_server_fire_when - timer 2 in 3 seconds
     54TA1 - rtems_timer_cancel - timer 1
     55TA1 - rtems_timer_cancel - timer 2
     56TA1 - rtems_timer_server_fire_when - timer 1 in 1 seconds
     57TA1 - rtems_timer_server_fire_after - timer 2 in 1 tick
     58TA1 - rtems_task_wake_after - 1 tick
     59TA1 - rtems_timer_cancel - timer 1
    5060TA1 - rtems_task_wake_after - YIELD (only task at priority)
    5161TA1 - timer_deleting - timer 1
    52 *** END OF TEST 31 *** 
     62*** END OF TEST 31 ***
  • testsuites/sptests/sp31/task1.c

    r0cd3878 rbb14405d  
    1111 *  COPYRIGHT (c) 1989-2009.
    1212 *  On-Line Applications Research Corporation (OAR).
     13 *
     14 *  Copyright (c) 2009 embedded brains GmbH.
    1315 *
    1416 *  The license and distribution terms for this file may be
     
    3436{
    3537  TSR_fired = 1;
     38}
     39
     40rtems_timer_service_routine Do_nothing(
     41  rtems_id  ignored_id,
     42  void     *ignored_address
     43)
     44{
     45  /* Do nothing */
    3646}
    3747
     
    272282  directive_failed( status, "rtems_timer_cancel" );
    273283
     284/* TOD timer insert with non empty TOD timer chain */
     285
     286  status = rtems_clock_get_tod( &time );
     287  directive_failed( status, "rtems_clock_get_tod" );
     288
     289  time.second += 3;
     290
     291  puts( "TA1 - rtems_timer_server_fire_when - timer 1 in 3 seconds" );
     292  status = rtems_timer_server_fire_when( tmid, &time, Do_nothing, NULL );
     293  directive_failed( status, "rtems_timer_server_fire_when" );
     294
     295  puts( "TA1 - rtems_timer_server_fire_when - timer 2 in 3 seconds" );
     296  status = rtems_timer_server_fire_when( tmid2, &time, Do_nothing, NULL );
     297  directive_failed( status, "rtems_timer_server_fire_when" );
     298
     299  puts( "TA1 - rtems_task_wake_after - 1 second" );
     300  status = rtems_task_wake_after( 1 * rtems_clock_get_ticks_per_second() );
     301  directive_failed( status, "rtems_task_wake_after" );
     302
     303  puts( "TA1 - rtems_timer_server_fire_when - timer 2 in 3 seconds" );
     304  status = rtems_timer_server_fire_when( tmid2, &time, Do_nothing, NULL );
     305  directive_failed( status, "rtems_timer_server_fire_when" );
     306
     307  puts( "TA1 - rtems_timer_cancel - timer 1" );
     308  status = rtems_timer_cancel( tmid );
     309  directive_failed( status, "rtems_timer_cancel" );
     310
     311  puts( "TA1 - rtems_timer_cancel - timer 2" );
     312  status = rtems_timer_cancel( tmid2 );
     313  directive_failed( status, "rtems_timer_cancel" );
     314
     315/* TOD chain processing with time wrap */
     316
     317  time.second = 30;
     318
     319  status = rtems_clock_set( &time );
     320  directive_failed( status, "rtems_clock_set" );
     321
     322  time.second = 31;
     323
     324  puts( "TA1 - rtems_timer_server_fire_when - timer 1 in 1 seconds" );
     325  status = rtems_timer_server_fire_when( tmid, &time, Do_nothing, NULL );
     326  directive_failed( status, "rtems_timer_server_fire_when" );
     327
     328  time.second = 29;
     329
     330  status = rtems_clock_set( &time );
     331  directive_failed( status, "rtems_clock_set" );
     332
     333  puts( "TA1 - rtems_timer_server_fire_after - timer 2 in 1 tick" );
     334  status = rtems_timer_server_fire_after( tmid2, 1, Do_nothing, NULL );
     335  directive_failed( status, "rtems_timer_server_fire_after" );
     336
     337  puts( "TA1 - rtems_task_wake_after - 1 tick" );
     338  status = rtems_task_wake_after( 1 );
     339  directive_failed( status, "rtems_task_wake_after" );
     340
     341  puts( "TA1 - rtems_timer_cancel - timer 1" );
     342  status = rtems_timer_cancel( tmid );
     343  directive_failed( status, "rtems_timer_cancel" );
     344
    274345/* delete */
    275346  puts( "TA1 - rtems_task_wake_after - YIELD (only task at priority)" );
  • testsuites/sptests/spintrcritical17/init.c

    r0cd3878 rbb14405d  
    11/*
    2  *  COPYRIGHT (c) 1989-2009.
    3  *  On-Line Applications Research Corporation (OAR).
     2 * Copyright (c) 2009
     3 * embedded brains GmbH
     4 * Obere Lagerstr. 30
     5 * D-82178 Puchheim
     6 * Germany
     7 * <rtems@embedded-brains.de>
    48 *
    5  *  The license and distribution terms for this file may be
    6  *  found in the file LICENSE in this distribution or at
    7  *  http://www.rtems.com/license/LICENSE.
     9 * The license and distribution terms for this file may be
     10 * found in the file LICENSE in this distribution or at
     11 * http://www.rtems.com/license/LICENSE.
    812 *
    9  *  $Id$
     13 * $Id$
    1014 */
    1115
     
    1317#include <intrcritical.h>
    1418
    15 static rtems_id timer_0;
    16 static rtems_id timer_1;
    17 static rtems_id timer_2;
     19#define TIMER_COUNT 4
    1820
    19 volatile bool case_hit;
     21#define TIMER_TRIGGER 0
     22#define TIMER_RESET 1
     23#define TIMER_NEVER_INTERVAL 2
     24#define TIMER_NEVER_TOD 3
     25
     26static rtems_id timer [TIMER_COUNT];
     27
     28static rtems_time_of_day tod;
     29
     30static volatile bool case_hit;
    2031
    2132static void never_callback(rtems_id timer, void *arg)
     
    2435}
    2536
    26 static void reset_callback(rtems_id timer, void *arg)
     37static void reset_tod_timer(void)
    2738{
    2839  rtems_status_code sc = RTEMS_SUCCESSFUL;
    2940
    30   sc = rtems_timer_reset(timer_0);
     41  sc = rtems_timer_server_fire_when(
     42    timer [TIMER_NEVER_TOD],
     43    &tod,
     44    never_callback,
     45    NULL
     46  );
     47  directive_failed_with_level(sc, "rtems_timer_server_fire_after", -1);
     48}
     49
     50static void reset_callback(rtems_id timer_id, void *arg)
     51{
     52  rtems_status_code sc = RTEMS_SUCCESSFUL;
     53
     54  sc = rtems_timer_reset(timer [TIMER_RESET]);
    3155  directive_failed_with_level(sc, "rtems_timer_reset", -1);
    3256
    33   sc = rtems_timer_reset(timer_1);
     57  sc = rtems_timer_reset(timer [TIMER_NEVER_INTERVAL]);
    3458  directive_failed_with_level(sc, "rtems_timer_reset", -1);
     59
     60  reset_tod_timer();
    3561
    3662  if (!case_hit) {
     
    3965}
    4066
    41 static void trigger_callback(rtems_id timer, void *arg)
     67static void trigger_callback(rtems_id timer_id, void *arg)
    4268{
    4369  rtems_status_code sc = RTEMS_SUCCESSFUL;
     
    5379  }
    5480
    55   sc = rtems_timer_reset(timer_2);
     81  sc = rtems_timer_reset(timer [TIMER_TRIGGER]);
    5682  directive_failed(sc, "rtems_timer_reset");
    5783}
     
    6086{
    6187  rtems_status_code sc = RTEMS_SUCCESSFUL;
     88  size_t i = 0;
    6289
    6390  puts("\n\n*** TEST INTERRUPT CRITICAL SECTION 17 ***");
    6491
    65   sc = rtems_timer_create(
    66     rtems_build_name('T', 'I', 'M', '0'),
    67     &timer_0
    68   );
    69   directive_failed(sc, "rtems_timer_create");
     92  build_time(&tod, 4, 12, 2009, 9, 34, 11, 0);
     93  sc = rtems_clock_set(&tod);
     94  directive_failed(sc, "rtems_clock_set");
    7095
    71   sc = rtems_timer_create(
    72     rtems_build_name('T', 'I', 'M', '1'),
    73     &timer_1
    74   );
    75   directive_failed(sc, "rtems_timer_create");
     96  ++tod.year;
    7697
    77   sc = rtems_timer_create(
    78     rtems_build_name('T', 'I', 'M', '2'),
    79     &timer_2
    80   );
    81   directive_failed(sc, "rtems_timer_create");
     98  for (i = 0; i < TIMER_COUNT; ++i) {
     99    sc = rtems_timer_create(
     100      rtems_build_name('T', 'I', 'M', '0' + i),
     101      &timer [i]
     102    );
     103    directive_failed(sc, "rtems_timer_create");
     104  }
    82105
    83106  sc = rtems_timer_initiate_server(
     
    89112
    90113  sc = rtems_timer_server_fire_after(
    91     timer_0,
     114    timer [TIMER_NEVER_INTERVAL],
    92115    2,
    93116    never_callback,
     
    96119  directive_failed(sc, "rtems_timer_server_fire_after");
    97120
     121  reset_tod_timer();
     122
    98123  sc = rtems_timer_fire_after(
    99     timer_1,
     124    timer [TIMER_RESET],
    100125    1,
    101126    reset_callback,
     
    105130
    106131  sc = rtems_timer_server_fire_after(
    107     timer_2,
     132    timer [TIMER_TRIGGER],
    108133    1,
    109134    trigger_callback,
     
    123148
    124149#define CONFIGURE_MAXIMUM_TASKS 2
    125 #define CONFIGURE_MAXIMUM_TIMERS 3
     150#define CONFIGURE_MAXIMUM_TIMERS 4
    126151
    127152#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
Note: See TracChangeset for help on using the changeset viewer.