source: rtems/testsuites/sptests/sp54/init.c @ c5d412c

4.104.115
Last change on this file since c5d412c was c5d412c, checked in by Joel Sherrill <joel.sherrill@…>, on Jul 3, 2009 at 3:56:01 PM

2009-07-03 Joel Sherrill <joel.sherrill@…>

  • sp54/init.c, sp54/sp54.doc: Fix typos and comments.
  • Property mode set to 100644
File size: 2.1 KB
Line 
1/*  Odd Id Cases where API configured but No Threads
2 *    + Possibly Valid Id passed to directive
3 *
4 *  COPYRIGHT (c) 1989-2009.
5 *  On-Line Applications Research Corporation (OAR).
6 *
7 *  The license and distribution terms for this file may be
8 *  found in the file LICENSE in this distribution or at
9 *  http://www.rtems.com/license/LICENSE.
10 *
11 *  $Id$
12 */
13
14#include <tmacros.h>
15
16rtems_task Init(
17  rtems_task_argument ignored
18)
19{
20  rtems_status_code    status;
21  rtems_task_priority  pri;
22  rtems_id             id;
23
24  /*
25   *  It is possible that since this thread prints and there is no idle
26   *  task, that the system could fail miserably. :(
27   */
28  puts( "\n\n*** TEST 54 ***" );
29
30  puts( "Init - use valid id of API class with no objects" );
31  status = rtems_task_set_priority( 0xa010001, RTEMS_CURRENT_PRIORITY, &pri );
32  fatal_directive_status(
33    status,
34    RTEMS_INVALID_ID,
35    "rtems_task_set_priority"
36  );
37
38  puts( "Init - lookup name within API class with no objects" );
39  status = rtems_task_ident( 0x123456, RTEMS_SEARCH_ALL_NODES, &id );
40  fatal_directive_status(
41    status,
42    RTEMS_INVALID_NAME,
43    "rtems_task_ident"
44  );
45
46  puts( "*** END OF TEST 54 ***" );
47  rtems_test_exit(0);
48}
49
50/* configuration information */
51
52#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
53#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
54
55/*
56 *  In this application, the initialization task performs the system
57 *  initialization and then transforms itself into the idle task.
58 */
59#define CONFIGURE_IDLE_TASK_BODY Init
60#define CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION
61
62/*
63 *  Another odd case to hit.  Since we use the Init task is Idle task
64 *  configuration, we can dummy up the initialization task configuration
65 *  to have a non-NULL pointer and 0 tasks.
66 */
67
68#define CONFIGURE_HAS_OWN_INIT_TASK_TABLE 1
69
70rtems_initialization_tasks_table Initialization_tasks[1] =
71{ { 0, }};
72
73#define CONFIGURE_INIT_TASK_TABLE      Initialization_tasks
74#define CONFIGURE_INIT_TASK_TABLE_SIZE 0
75#define CONFIGURE_INIT_TASK_STACK_SIZE 0
76
77#define CONFIGURE_INIT
78#include <rtems/confdefs.h>
79
80/* global variables */
Note: See TracBrowser for help on using the repository browser.