source: rtems/testsuites/libtests/rtems++/Init.cc @ c499856

4.115
Last change on this file since c499856 was c499856, checked in by Chris Johns <chrisj@…>, on Mar 20, 2014 at 9:10:47 PM

Change all references of rtems.com to rtems.org.

  • Property mode set to 100644
File size: 1.7 KB
RevLine 
[0074691]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 *
[08311cc3]14 *  COPYRIGHT (c) 1989-1999.
[0074691]15 *  On-Line Applications Research Corporation (OAR).
16 *
[98e4ebf]17 *  The license and distribution terms for this file may be
18 *  found in the file LICENSE in this distribution or at
[c499856]19 *  http://www.rtems.org/license/LICENSE.
[0074691]20 */
21
[e93cc2d]22#ifdef HAVE_CONFIG_H
23#include "config.h"
24#endif
25
[5a8e7503]26#define CONFIGURE_INIT
[0074691]27#include "System.h"
28
[f8b2eb03]29const char rtems_test_name[] = "RTEMS++";
30
[2d60095]31// make global so it lasts past the Init task's stack's life time
32Task1 task_1;
33
[0074691]34rtems_task Init(rtems_task_argument )
35{
[f8b2eb03]36  TEST_BEGIN();
[0074691]37
38  printf( "INIT - Task.create() - " );
39  task_1.create("TA1 ", 0, RTEMS_MINIMUM_STACK_SIZE);
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.create() - " );
47  task_1.create("TA1 ", 10, RTEMS_MINIMUM_STACK_SIZE * 6);
48  printf("%s\n", task_1.last_status_string());
49
50  printf( "INIT - Task.restart() - " );
51  task_1.restart(0);
52  printf("%s\n", task_1.last_status_string());
53
54  printf( "INIT - Task.start(0xDEADDEAD) - " );
55  task_1.start(0xDEADDEAD);
56  printf("%s\n", task_1.last_status_string());
57
[2d60095]58  printf("INIT - Destroy it's self\n");
[0074691]59
60  // needs to be in C, no C++ object owns the Init task
61  rtems_status_code status  = rtems_task_delete( RTEMS_SELF );
62  directive_failed( status, "rtems_task_delete of RTEMS_SELF" );
63}
64
65
66
Note: See TracBrowser for help on using the repository browser.