source: rtems/testsuites/sptests/sp57/init.c @ c0d7e23

4.115
Last change on this file since c0d7e23 was c0d7e23, checked in by Joel Sherrill <joel.sherrill@…>, on 05/05/11 at 16:45:57

2011-05-05 Joel Sherrill <joel.sherrill@…>

  • sp09/screen12.c, sp09/sp09.scn, sp21/Makefile.am, sp35/priinv.c, sp39/init.c, sp50/init.c, sp57/init.c, sp72/init.c, sp73/init.c, spintrcritical01/init.c, spprivenv01/init.c, spsimplesched01/init.c, spsimplesched02/init.c: Remove warnings.
  • Property mode set to 100644
File size: 2.0 KB
Line 
1/*  Restart a task which is delaying
2 *
3 *  COPYRIGHT (c) 1989-2011.
4 *  On-Line Applications Research Corporation (OAR).
5 *
6 *  The license and distribution terms for this file may be
7 *  found in the file LICENSE in this distribution or at
8 *  http://www.rtems.com/license/LICENSE.
9 *
10 *  $Id$
11 */
12
13#ifdef HAVE_CONFIG_H
14#include "config.h"
15#endif
16
17#include <tmacros.h>
18
19rtems_task Delay_task(
20  rtems_task_argument ignored
21)
22{
23  rtems_status_code    status;
24
25  puts( "Delay - rtems_task_wake_after - OK" );
26  status = rtems_task_wake_after( RTEMS_MILLISECONDS_TO_TICKS(2000) );
27  directive_failed( status, "wake after" );
28
29  puts( "ERROR - delay task woke up!!" );
30  rtems_test_exit(0);
31}
32
33rtems_task Init(
34  rtems_task_argument ignored
35)
36{
37  rtems_status_code    status;
38  rtems_id             task_id;
39
40  puts( "\n\n*** TEST 57 ***" );
41
42  puts( "Init - rtems_task_create - delay task - OK" );
43  status = rtems_task_create(
44     rtems_build_name( 'T', 'A', '1', ' ' ),
45     1,
46     RTEMS_MINIMUM_STACK_SIZE,
47     RTEMS_DEFAULT_OPTIONS,
48     RTEMS_DEFAULT_ATTRIBUTES,
49     &task_id
50  );
51  directive_failed( status, "rtems_task_create" );
52
53  puts( "Init - rtems_task_start - delay task - OK" );
54  status = rtems_task_start( task_id, Delay_task, 0 );
55  directive_failed( status, "rtems_task_start" );
56
57  puts( "Init - rtems_task_wake_after - let delay task block - OK" );
58  status = rtems_task_wake_after( RTEMS_MILLISECONDS_TO_TICKS(1000) );
59  directive_failed( status, "rtems_task_wake_after" );
60
61  puts( "Init - rtems_task_restart - delay task - OK" );
62  status = rtems_task_restart( task_id, 0 );
63  directive_failed( status, "rtems_task_restart" );
64
65  puts( "*** END OF TEST 57 ***" );
66  rtems_test_exit(0);
67}
68
69/* configuration information */
70
71#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
72#define CONFIGURE_APPLICATION_NEEDS_CLOCK_DRIVER
73
74#define CONFIGURE_MAXIMUM_TASKS             2
75#define CONFIGURE_RTEMS_INIT_TASKS_TABLE
76
77#define CONFIGURE_INIT
78#include <rtems/confdefs.h>
79
80/* global variables */
Note: See TracBrowser for help on using the repository browser.