From 3ca942abf8e9dd1166bb6f2c2634a9216a02a5f4 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Mon, 4 Feb 2008 17:18:01 +0000 Subject: 2008-02-04 Joel Sherrill * configure.ac, sptests/Makefile.am: Exercise passing as object Id of SELF. * sptests/spname01/.cvsignore, sptests/spname01/Makefile.am, sptests/spname01/ada_spname01.scn, sptests/spname01/spname01.adb, sptests/spname01/sptest.adb, sptests/spname01/sptest.ads: New files. --- c/src/ada-tests/ChangeLog | 8 +++ c/src/ada-tests/configure.ac | 1 + c/src/ada-tests/sptests/Makefile.am | 1 + c/src/ada-tests/sptests/spname01/.cvsignore | 2 + c/src/ada-tests/sptests/spname01/Makefile.am | 21 ++++++++ c/src/ada-tests/sptests/spname01/ada_spname01.scn | 3 ++ c/src/ada-tests/sptests/spname01/spname01.adb | 36 +++++++++++++ c/src/ada-tests/sptests/spname01/sptest.adb | 66 +++++++++++++++++++++++ c/src/ada-tests/sptests/spname01/sptest.ads | 30 +++++++++++ 9 files changed, 168 insertions(+) create mode 100644 c/src/ada-tests/sptests/spname01/.cvsignore create mode 100644 c/src/ada-tests/sptests/spname01/Makefile.am create mode 100644 c/src/ada-tests/sptests/spname01/ada_spname01.scn create mode 100644 c/src/ada-tests/sptests/spname01/spname01.adb create mode 100644 c/src/ada-tests/sptests/spname01/sptest.adb create mode 100644 c/src/ada-tests/sptests/spname01/sptest.ads (limited to 'c/src/ada-tests') diff --git a/c/src/ada-tests/ChangeLog b/c/src/ada-tests/ChangeLog index 7ffbd4e8e8..d7c8df8f6c 100644 --- a/c/src/ada-tests/ChangeLog +++ b/c/src/ada-tests/ChangeLog @@ -1,3 +1,11 @@ +2008-02-04 Joel Sherrill + + * configure.ac, sptests/Makefile.am: Exercise passing as object Id of + SELF. + * sptests/spname01/.cvsignore, sptests/spname01/Makefile.am, + sptests/spname01/ada_spname01.scn, sptests/spname01/spname01.adb, + sptests/spname01/sptest.adb, sptests/spname01/sptest.ads: New files. + 2008-02-01 Joel Sherrill * mptests/mp01/node1/Makefile.am, mptests/mp01/node2/Makefile.am, diff --git a/c/src/ada-tests/configure.ac b/c/src/ada-tests/configure.ac index d27d0a17d5..cda63569bf 100644 --- a/c/src/ada-tests/configure.ac +++ b/c/src/ada-tests/configure.ac @@ -78,6 +78,7 @@ sptests/sp22/Makefile sptests/sp23/Makefile sptests/sp24/Makefile sptests/sp25/Makefile +sptests/spname01/Makefile ]) AC_CONFIG_FILES([ diff --git a/c/src/ada-tests/sptests/Makefile.am b/c/src/ada-tests/sptests/Makefile.am index 669044baee..17131ec98e 100644 --- a/c/src/ada-tests/sptests/Makefile.am +++ b/c/src/ada-tests/sptests/Makefile.am @@ -23,6 +23,7 @@ SUBDIRS += sp22 SUBDIRS += sp23 SUBDIRS += sp24 SUBDIRS += sp25 +SUBDIRS += spname01 include $(top_srcdir)/../../../testsuites/automake/subdirs.am include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/sptests/spname01/.cvsignore b/c/src/ada-tests/sptests/spname01/.cvsignore new file mode 100644 index 0000000000..282522db03 --- /dev/null +++ b/c/src/ada-tests/sptests/spname01/.cvsignore @@ -0,0 +1,2 @@ +Makefile +Makefile.in diff --git a/c/src/ada-tests/sptests/spname01/Makefile.am b/c/src/ada-tests/sptests/spname01/Makefile.am new file mode 100644 index 0000000000..3ffe4a1450 --- /dev/null +++ b/c/src/ada-tests/sptests/spname01/Makefile.am @@ -0,0 +1,21 @@ +## $Id$ + +include $(RTEMS_ROOT)/make/custom/@RTEMS_BSP@.cfg +include $(top_srcdir)/../../../testsuites/automake/compile.am + +include $(top_srcdir)/ada.am + +ada_spname01.exe: spname01.adb init.$(OBJEXT) + $(GNATCOMPILE) -margs -a $< -o $@ + +init.$(OBJEXT): ../../support/init.c + $(COMPILE.c) -I$(srcdir) -c $< + +noinst_PROGRAMS = ada_spname01.exe + +ada_spname01_exe_SOURCES = spname01.adb config.h sptest.adb sptest.ads + +scndir = $(rtems_ada_testsdir) +dist_scn_DATA = ada_spname01.scn + +include $(top_srcdir)/../../../testsuites/automake/local.am diff --git a/c/src/ada-tests/sptests/spname01/ada_spname01.scn b/c/src/ada-tests/sptests/spname01/ada_spname01.scn new file mode 100644 index 0000000000..825cd14437 --- /dev/null +++ b/c/src/ada-tests/sptests/spname01/ada_spname01.scn @@ -0,0 +1,3 @@ +*** Ada Task Name TEST *** +TBD +*** END OF Ada Task Name TEST *** diff --git a/c/src/ada-tests/sptests/spname01/spname01.adb b/c/src/ada-tests/sptests/spname01/spname01.adb new file mode 100644 index 0000000000..eb35eefc0a --- /dev/null +++ b/c/src/ada-tests/sptests/spname01/spname01.adb @@ -0,0 +1,36 @@ +-- +-- MAIN / BODY +-- +-- DESCRIPTION: +-- +-- This is the entry point for Test Hello of the Sample Test Suite. +-- +-- DEPENDENCIES: +-- +-- +-- +-- COPYRIGHT (c) 1989-2008. +-- On-Line Applications Research Corporation (OAR). +-- +-- The license and distribution terms for this file may in +-- the file LICENSE in this distribution or at +-- http://www.rtems.com/license/LICENSE. +-- +-- $Id$ +-- + +with RTEMS; +with SPTEST; +with TEST_SUPPORT; + +procedure SPNAME01 is + INIT_ID : RTEMS.ID; + STATUS : RTEMS.STATUS_CODES; +begin + + loop + delay 120.0; + end loop; + +end SPNAME01; + diff --git a/c/src/ada-tests/sptests/spname01/sptest.adb b/c/src/ada-tests/sptests/spname01/sptest.adb new file mode 100644 index 0000000000..221c3dbd1b --- /dev/null +++ b/c/src/ada-tests/sptests/spname01/sptest.adb @@ -0,0 +1,66 @@ +-- +-- SPTEST / BODY +-- +-- DESCRIPTION: +-- +-- This package is the implementation of the Ada Task Name test of the RTEMS +-- Ada Single Processor Test Suite. +-- +-- DEPENDENCIES: +-- +-- +-- +-- COPYRIGHT (c) 1989-2008. +-- On-Line Applications Research Corporation (OAR). +-- +-- The license and distribution terms for this file may in +-- the file LICENSE in this distribution or at +-- http://www.rtems.com/license/LICENSE. +-- +-- $Id$ +-- + +with INTERFACES; use INTERFACES; +with RTEMS; +with TEST_SUPPORT; +with TEXT_IO; +with Ada.Strings.Unbounded; +with System; use System; -- for Null Pointer comparison + +package body SPTEST is + + task body AdaTask is + Status : RTEMS.Status_Codes; + Pointer : RTEMS.Address; + StringName : String(1 .. 120) := (1 .. 120 => '*' ); + NewName : constant String := "Josiah"; + begin + + TEXT_IO.NEW_LINE( 2 ); + TEXT_IO.PUT_LINE( "*** Ada Task Name TEST ***" ); + + RTEMS.Object_Get_Name( RTEMS.Self, StringName, Pointer ); + if Pointer = RTEMS.Null_Address then + TEXT_IO.PUT_LINE( "Object_Get_Name_Failed" ); + else + TEXT_IO.PUT_LINE( "My name is (" & StringName & ")" ); + end if; + + TEXT_IO.PUT_LINE( "Setting name to (Josiah)" ); + RTEMS.Object_Set_Name( RTEMS.Self, NewName, Status ); + TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "Object_Set_Name" ); + + RTEMS.Object_Get_Name( RTEMS.Self, StringName, Pointer ); + if Pointer = RTEMS.Null_Address then + TEXT_IO.PUT_LINE( "Object_Get_Name_Failed" ); + else + TEXT_IO.PUT_LINE( "My name is (" & StringName & ")" ); + end if; + + TEXT_IO.PUT_LINE( "*** END OF Ada Task Name TEST ***" ); + + RTEMS.SHUTDOWN_EXECUTIVE( 0 ); + + end AdaTask; + +end SPTEST; diff --git a/c/src/ada-tests/sptests/spname01/sptest.ads b/c/src/ada-tests/sptests/spname01/sptest.ads new file mode 100644 index 0000000000..3e63a754c2 --- /dev/null +++ b/c/src/ada-tests/sptests/spname01/sptest.ads @@ -0,0 +1,30 @@ +-- +-- SPTEST / SPECIFICATION +-- +-- DESCRIPTION: +-- +-- This package is the specification for the Hello World Test of the RTEMS +-- Sample Test Suite. +-- +-- DEPENDENCIES: +-- +-- +-- +-- COPYRIGHT (c) 1989-2008. +-- On-Line Applications Research Corporation (OAR). +-- +-- The license and distribution terms for this file may in +-- the file LICENSE in this distribution or at +-- http://www.rtems.com/license/LICENSE. +-- +-- $Id$ +-- + +with RTEMS; + +package SPTEST is + + task AdaTask; + + +end SPTEST; -- cgit v1.2.3