1 | -- |
---|
2 | -- SPTEST / BODY |
---|
3 | -- |
---|
4 | -- DESCRIPTION: |
---|
5 | -- |
---|
6 | -- This package is the implementation of the Ada Task Name test of the RTEMS |
---|
7 | -- Ada Single Processor Test Suite. |
---|
8 | -- |
---|
9 | -- DEPENDENCIES: |
---|
10 | -- |
---|
11 | -- |
---|
12 | -- |
---|
13 | -- COPYRIGHT (c) 1989-2009. |
---|
14 | -- On-Line Applications Research Corporation (OAR). |
---|
15 | -- |
---|
16 | -- The license and distribution terms for this file may in |
---|
17 | -- the file LICENSE in this distribution or at |
---|
18 | -- http://www.rtems.com/license/LICENSE. |
---|
19 | -- |
---|
20 | |
---|
21 | with RTEMS; |
---|
22 | with TEST_SUPPORT; |
---|
23 | with TEXT_IO; |
---|
24 | with System; use System; -- for Null Pointer comparison |
---|
25 | |
---|
26 | package body SPTEST is |
---|
27 | |
---|
28 | task body AdaTask is |
---|
29 | Status : RTEMS.Status_Codes; |
---|
30 | Pointer : RTEMS.Address; |
---|
31 | StringName : String(1 .. 120) := (1 .. 120 => '*' ); |
---|
32 | NewName : constant String := "Josiah"; |
---|
33 | begin |
---|
34 | |
---|
35 | TEXT_IO.NEW_LINE( 2 ); |
---|
36 | TEXT_IO.PUT_LINE( "*** Ada Task Name TEST ***" ); |
---|
37 | |
---|
38 | RTEMS.Object_Get_Name( RTEMS.Self, StringName, Pointer ); |
---|
39 | if Pointer = RTEMS.Null_Address then |
---|
40 | TEXT_IO.PUT_LINE( "Object_Get_Name_Failed" ); |
---|
41 | else |
---|
42 | TEXT_IO.PUT_LINE( "My name is (" & StringName & ")" ); |
---|
43 | end if; |
---|
44 | |
---|
45 | TEXT_IO.PUT_LINE( "Setting name to (Josiah)" ); |
---|
46 | RTEMS.Object_Set_Name( RTEMS.Self, NewName, Status ); |
---|
47 | TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "Object_Set_Name" ); |
---|
48 | |
---|
49 | RTEMS.Object_Get_Name( RTEMS.Self, StringName, Pointer ); |
---|
50 | if Pointer = RTEMS.Null_Address then |
---|
51 | TEXT_IO.PUT_LINE( "Object_Get_Name_Failed" ); |
---|
52 | else |
---|
53 | TEXT_IO.PUT_LINE( "My name is (" & StringName & ")" ); |
---|
54 | end if; |
---|
55 | |
---|
56 | TEXT_IO.PUT_LINE( "*** END OF Ada Task Name TEST ***" ); |
---|
57 | |
---|
58 | RTEMS.SHUTDOWN_EXECUTIVE( 0 ); |
---|
59 | |
---|
60 | end AdaTask; |
---|
61 | |
---|
62 | end SPTEST; |
---|