source: rtems/testsuites/libtests/rtems++/Init.cc @ 0074691a

4.104.114.84.95
Last change on this file since 0074691a was 0074691a, checked in by Joel Sherrill <joel.sherrill@…>, on 07/31/97 at 22:13:29

Merged very large and much appreciated patch from Chris Johns
<cjohns@…>. This patch includes the ods68302 bsp,
the RTEMS++ class library, and the rtems++ test.

  • Property mode set to 100644
File size: 1.8 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-1997.
15 *  On-Line Applications Research Corporation (OAR).
16 *  Copyright assigned to U.S. Government, 1994.
17 *
18 *  The license and distribution terms for this file may in
19 *  the file LICENSE in this distribution or at
20 *  http://www.OARcorp.com/rtems/license.html.
21 *
22 *  $Id$
23 */
24
25#define TEST_INIT
26#include "System.h"
27
28rtems_task Init(rtems_task_argument )
29{
30  puts( "\n\n*** RTEMS++ TEST ***" );
31
32  rtemsEvent end_me("INIT");
33  Task1 task_1;
34 
35  task_1.set_end_event(end_me);
36 
37  printf( "INIT - Task.create() - " );
38  task_1.create("TA1 ", 0, RTEMS_MINIMUM_STACK_SIZE);
39  printf("%s\n", task_1.last_status_string());
40
41  printf( "INIT - Task.create() - " );
42  task_1.create("TA1 ", 10, RTEMS_MINIMUM_STACK_SIZE * 6);
43  printf("%s\n", task_1.last_status_string());
44
45  printf( "INIT - Task.create() - " );
46  task_1.create("TA1 ", 10, RTEMS_MINIMUM_STACK_SIZE * 6);
47  printf("%s\n", task_1.last_status_string());
48
49  printf( "INIT - Task.restart() - " );
50  task_1.restart(0);
51  printf("%s\n", task_1.last_status_string());
52
53  printf( "INIT - Task.start(0xDEADDEAD) - " );
54  task_1.start(0xDEADDEAD);
55  printf("%s\n", task_1.last_status_string());
56
57  // block waiting for any event
58  rtems_event_set out;
59
60  // wait for task1 to tell me to finish
61  end_me.receive(RTEMS_SIGNAL_0, out);
62
63  task_1.destroy();
64 
65  printf("*** END OF RTEMS++ TEST ***");
66
67  // needs to be in C, no C++ object owns the Init task
68  rtems_status_code status  = rtems_task_delete( RTEMS_SELF );
69  directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
70}
71
72
73
Note: See TracBrowser for help on using the repository browser.