source: rtems/testsuites/ada/sptests/spname01/sptest.adb @ a01e169

5
Last change on this file since a01e169 was a01e169, checked in by Sebastian Huber <sebastian.huber@…>, on 12/01/17 at 10:26:10

ada/spname01: Fix several issues

  • Property mode set to 100644
File size: 1.6 KB
Line 
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.org/license/LICENSE.
19--
20
21with RTEMS;
22with RTEMS.OBJECT;
23with TEST_SUPPORT;
24with TEXT_IO;
25with System; use System;  -- for Null Pointer comparison
26
27package body SPTEST is
28
29   task body AdaTask is
30      Status     : RTEMS.Status_Codes;
31      Pointer    : RTEMS.Address;
32      StringName : String(1 .. 120) := (1 .. 120 => '*' );
33      NewName    : constant String  := "Josiah";
34   begin
35
36      TEXT_IO.NEW_LINE( 2 );
37      TEST_SUPPORT.ADA_TEST_BEGIN;
38
39      RTEMS.Object.Get_Name( RTEMS.Self, StringName, Pointer );
40      if Pointer = RTEMS.Null_Address then
41         TEXT_IO.PUT_LINE( "Object_Get_Name_Failed" );
42      else
43         TEXT_IO.PUT_LINE( "My name is (" & StringName & ")" );
44      end if;
45
46      TEXT_IO.PUT_LINE( "Setting name to (Josiah)" );
47      RTEMS.Object.Set_Name( RTEMS.Self, NewName, Status );
48      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "Object_Set_Name" );
49
50      RTEMS.Object.Get_Name( RTEMS.Self, StringName, Pointer );
51      if Pointer = RTEMS.Null_Address then
52         TEXT_IO.PUT_LINE( "Object_Get_Name_Failed" );
53      else
54         TEXT_IO.PUT_LINE( "My name is (" & StringName & ")" );
55      end if;
56
57      TEST_SUPPORT.ADA_TEST_END;
58
59      RTEMS.SHUTDOWN_EXECUTIVE( 0 );
60
61   end AdaTask;
62
63end SPTEST;
Note: See TracBrowser for help on using the repository browser.