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

4.115
Last change on this file since f68401e was f8b2eb03, checked in by Sebastian Huber <sebastian.huber@…>, on 03/17/14 at 07:10:40

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

  • Property mode set to 100644
File size: 1.7 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.rtems.com/license/LICENSE.
20 */
21
22#ifdef HAVE_CONFIG_H
23#include "config.h"
24#endif
25
26#define CONFIGURE_INIT
27#include "System.h"
28
29const char rtems_test_name[] = "RTEMS++";
30
31// make global so it lasts past the Init task's stack's life time
32Task1 task_1;
33
34rtems_task Init(rtems_task_argument )
35{
36  TEST_BEGIN();
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
58  printf("INIT - Destroy it's self\n");
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.