source: rtems/testsuites/sptests/sp54/init.c @ 6c0301d

4.115
Last change on this file since 6c0301d was 6c0301d, checked in by Sebastian Huber <sebastian.huber@…>, on 03/25/14 at 07:06:21

tests/sptests: Use <rtems/test.h>

  • Property mode set to 100644
File size: 2.5 KB
Line 
1/**
2 *  @@file
3 *
4 *  Odd Id Cases where API configured but No Threads
5 *    + Possibly Valid Id passed to directive
6 */
7
8/*
9 *  COPYRIGHT (c) 1989-2012.
10 *  On-Line Applications Research Corporation (OAR).
11 *
12 *  The license and distribution terms for this file may be
13 *  found in the file LICENSE in this distribution or at
14 *  http://www.rtems.org/license/LICENSE.
15 */
16
17#ifdef HAVE_CONFIG_H
18#include "config.h"
19#endif
20
21#include <tmacros.h>
22
23const char rtems_test_name[] = "SP 54";
24
25/* forward declarations to avoid warnings */
26rtems_task Init(rtems_task_argument argument);
27
28rtems_task Init(
29  rtems_task_argument ignored
30)
31{
32  rtems_status_code    status;
33  rtems_task_priority  pri;
34  rtems_id             id;
35
36  /*
37   *  It is possible that since this thread prints and there is no idle
38   *  task, that the system could fail miserably. :(
39   */
40  TEST_BEGIN();
41
42  puts( "Init - use valid id of API class with no objects" );
43  status = rtems_task_set_priority(
44    rtems_build_id(0x2,0x1,0x01,0x0001) /* 0xa010001 */,
45    RTEMS_CURRENT_PRIORITY,
46    &pri
47  );
48  fatal_directive_status( status, RTEMS_INVALID_ID, "rtems_task_set_priority" );
49
50  puts( "Init - lookup name within API class with no objects" );
51  status = rtems_task_ident(
52    rtems_build_id( 0, 0, 0x12, 0x3456) /* 0x123456 */,
53    RTEMS_SEARCH_ALL_NODES,
54    &id
55  );
56  fatal_directive_status( status, RTEMS_INVALID_NAME, "rtems_task_ident" );
57
58  TEST_END();
59  rtems_test_exit(0);
60}
61
62/* configuration information */
63
64#define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
65#define CONFIGURE_APPLICATION_DOES_NOT_NEED_CLOCK_DRIVER
66
67/*
68 *  In this application, the initialization task performs the system
69 *  initialization and then transforms itself into the idle task.
70 */
71#define CONFIGURE_IDLE_TASK_BODY Init
72#define CONFIGURE_IDLE_TASK_INITIALIZES_APPLICATION
73
74/*
75 *  Another odd case to hit.  Since we use the Init task is Idle task
76 *  configuration, we can dummy up the initialization task configuration
77 *  to have a non-NULL pointer and 0 tasks.
78 */
79
80#define CONFIGURE_HAS_OWN_INIT_TASK_TABLE 1
81
82rtems_initialization_tasks_table Initialization_tasks[1] =
83  { { 0, }};
84
85#define CONFIGURE_INIT_TASK_TABLE      Initialization_tasks
86#define CONFIGURE_INIT_TASK_TABLE_SIZE 0
87#define CONFIGURE_INIT_TASK_STACK_SIZE 0
88
89/*
90 *  Ensure we test the case where memory is zero.  Not
91 *  all BSPs will set this to TRUE by default.
92 */
93#define CONFIGURE_ZERO_WORKSPACE_AUTOMATICALLY TRUE
94
95#define CONFIGURE_INIT
96#include <rtems/confdefs.h>
97
98/* global variables */
Note: See TracBrowser for help on using the repository browser.