source: rtems/c/src/tests/libtests/rtems++/Init.cc @ 17177e2c

4.104.114.84.95
Last change on this file since 17177e2c was 08311cc3, checked in by Joel Sherrill <joel.sherrill@…>, on 11/17/99 at 17:51:34

Updated copyright notice.

  • Property mode set to 100644
File size: 1.6 KB
Line 
1/*  Init
2 *
3 *  This routine is the initialization task for this test program.
4 *
5 *  Input parameters:
6 *    argument - task argument
7 *
8 *  Output parameters:  NONE
9 *
10 *  COPYRIGHT (c) 1997
11 *  Objective Design Systems Ltd Pty (ODS)
12 *  All rights reserved (R) Objective Design Systems Ltd Pty
13 *
14 *  COPYRIGHT (c) 1989-1999.
15 *  On-Line Applications Research Corporation (OAR).
16 *
17 *  The license and distribution terms for this file may be
18 *  found in the file LICENSE in this distribution or at
19 *  http://www.OARcorp.com/rtems/license.html.
20 *
21 *  $Id$
22 */
23
24#define TEST_INIT
25#include "System.h"
26
27// make global so it lasts past the Init task's stack's life time
28Task1 task_1;
29
30rtems_task Init(rtems_task_argument )
31{
32  puts( "\n\n*** RTEMS++ TEST ***" );
33
34  printf( "INIT - Task.create() - " );
35  task_1.create("TA1 ", 0, RTEMS_MINIMUM_STACK_SIZE);
36  printf("%s\n", task_1.last_status_string());
37
38  printf( "INIT - Task.create() - " );
39  task_1.create("TA1 ", 10, RTEMS_MINIMUM_STACK_SIZE * 6);
40  printf("%s\n", task_1.last_status_string());
41
42  printf( "INIT - Task.create() - " );
43  task_1.create("TA1 ", 10, RTEMS_MINIMUM_STACK_SIZE * 6);
44  printf("%s\n", task_1.last_status_string());
45
46  printf( "INIT - Task.restart() - " );
47  task_1.restart(0);
48  printf("%s\n", task_1.last_status_string());
49
50  printf( "INIT - Task.start(0xDEADDEAD) - " );
51  task_1.start(0xDEADDEAD);
52  printf("%s\n", task_1.last_status_string());
53
54  printf("INIT - Destroy it's self\n");
55
56  // needs to be in C, no C++ object owns the Init task
57  rtems_status_code status  = rtems_task_delete( RTEMS_SELF );
58  directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
59}
60
61
62
Note: See TracBrowser for help on using the repository browser.