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

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

ada: Add standard test begin/end message

  • 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 TEST_SUPPORT;
23with TEXT_IO;
24with System; use System;  -- for Null Pointer comparison
25
26package 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      TEST_SUPPORT.ADA_TEST_BEGIN;
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      TEST_SUPPORT.ADA_TEST_END;
57
58      RTEMS.SHUTDOWN_EXECUTIVE( 0 );
59
60   end AdaTask;
61
62end SPTEST;
Note: See TracBrowser for help on using the repository browser.