source: rtems/c/src/ada-tests/sptests/sp21/sptest.adb @ a846105

4.104.114.84.95
Last change on this file since a846105 was a846105, checked in by Ralf Corsepius <ralf.corsepius@…>, on 08/27/02 at 06:57:46

2002-08-27 Ralf Corsepius <corsepiu@…>

  • sptests/sp09/sptest.adb: Add Result to SCREEN_13. Remove Status from TASK_1.
  • sptests/sp21/sptest.adb: Add Result to TASK_1.
  • tmtests/tm20/tmtest.adb: Remove various RETURN_VALUEs.
  • ada.am: Remove ADACOMPILE, ADAC. Add AM_LDFLAGS, LDFLAGS.
  • configure.ac: Check for m4. Abort if HAS_GNAT = no.
  • Property mode set to 100644
File size: 5.9 KB
Line 
1--
2--  SPTEST / BODY
3--
4--  DESCRIPTION:
5--
6--  This package is the implementation of Test 21 of the RTEMS
7--  Single Processor Test Suite.
8--
9--  DEPENDENCIES:
10--
11-- 
12--
13--  COPYRIGHT (c) 1989-1997.
14--  On-Line Applications Research Corporation (OAR).
15--  Copyright assigned to U.S. Government, 1994.
16--
17--  The license and distribution terms for this file may in
18--  the file LICENSE in this distribution or at
19--  http://www.OARcorp.com/rtems/license.html.
20--
21--  $Id$
22--
23
24with INTERFACES; use INTERFACES;
25with RTEMS;
26with TEST_SUPPORT;
27with TEXT_IO;
28
29package body SPTEST is
30
31--PAGE
32--
33--  INIT
34--
35
36   procedure INIT (
37      ARGUMENT : in     RTEMS.TASK_ARGUMENT
38   ) is
39      STATUS : RTEMS.STATUS_CODES;
40   begin
41
42      TEXT_IO.NEW_LINE( 2 );
43      TEXT_IO.PUT_LINE( "*** TEST 21 ***" );
44
45      SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME(  'T', 'A', '1', ' ' );
46
47      RTEMS.TASK_CREATE(
48         SPTEST.TASK_NAME( 1 ),
49         1,
50         2048,
51         RTEMS.DEFAULT_MODES,
52         RTEMS.DEFAULT_ATTRIBUTES,
53         SPTEST.TASK_ID( 1 ),
54         STATUS
55      );
56      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" );
57
58      RTEMS.TASK_START(
59         SPTEST.TASK_ID( 1 ),
60         SPTEST.TASK_1'ACCESS,
61         0,
62         STATUS
63      );
64      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" );
65
66      RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
67      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
68
69   end INIT;
70
71--PAGE
72--
73--  TASK_1
74--
75
76   procedure TASK_1 (
77      ARGUMENT : in     RTEMS.TASK_ARGUMENT
78   ) is
79      RESULT       : RTEMS.Unsigned32;
80      STATUS       : RTEMS.STATUS_CODES;
81   begin
82
83      TEXT_IO.PUT_LINE( "----- TESTING THE NULL DRIVER CHECKS -----" );
84
85      RTEMS.IO_INITIALIZE(
86         SPTEST.NO_DRIVER_MAJOR,
87         0,
88         RTEMS.NULL_ADDRESS,
89         RESULT,
90         STATUS
91      );
92      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "IO_INITIALIZE" );
93      TEXT_IO.PUT_LINE(
94         "TA1 - io_initialize - NULL DRIVER SUCCESSFUL"
95      );
96   
97      RTEMS.IO_OPEN(
98         SPTEST.NO_DRIVER_MAJOR,
99         0,
100         RTEMS.NULL_ADDRESS,
101         STATUS
102      );
103      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "IO_OPEN" );
104      TEXT_IO.PUT_LINE(
105         "TA1 - io_open       - NULL DRIVER SUCCESSFUL"
106      );
107   
108      RTEMS.IO_CLOSE(
109         SPTEST.NO_DRIVER_MAJOR,
110         0,
111         RTEMS.NULL_ADDRESS,
112         STATUS
113      );
114      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "IO_CLOSE" );
115      TEXT_IO.PUT_LINE(
116         "TA1 - io_close      - NULL DRIVER SUCCESSFUL"
117      );
118   
119      RTEMS.IO_READ(
120         SPTEST.NO_DRIVER_MAJOR,
121         0,
122         RTEMS.NULL_ADDRESS,
123         STATUS
124      );
125      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "IO_READ" );
126      TEXT_IO.PUT_LINE(
127         "TA1 - io_read       - NULL DRIVER SUCCESSFUL"
128      );
129   
130      RTEMS.IO_WRITE(
131         SPTEST.NO_DRIVER_MAJOR,
132         0,
133         RTEMS.NULL_ADDRESS,
134         STATUS
135      );
136      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "IO_WRITE" );
137      TEXT_IO.PUT_LINE(
138         "TA1 - io_write      - NULL DRIVER SUCCESSFUL"
139      );
140   
141      RTEMS.IO_CONTROL(
142         SPTEST.NO_DRIVER_MAJOR,
143         0,
144         RTEMS.NULL_ADDRESS,
145         STATUS
146      );
147      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "IO_CONTROL" );
148      TEXT_IO.PUT_LINE(
149         "TA1 - io_control    - NULL DRIVER SUCCESSFUL"
150      );
151   
152      TEXT_IO.PUT_LINE( "----- TESTING THE I/O MANAGER DIRECTIVES -----" );
153
154      RTEMS.IO_INITIALIZE(
155         SPTEST.STUB_DRIVER_MAJOR,
156         0,
157         RTEMS.NULL_ADDRESS,
158         RESULT,
159         STATUS
160      );
161      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "IO_INITIALIZE" );
162      TEXT_IO.PUT_LINE(
163         "TA1 - io_initialize - STUB DRIVER SUCCESSFUL"
164      );
165   
166      RTEMS.IO_OPEN(
167         SPTEST.STUB_DRIVER_MAJOR,
168         0,
169         RTEMS.NULL_ADDRESS,
170         STATUS
171      );
172      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "IO_OPEN" );
173      TEXT_IO.PUT_LINE(
174         "TA1 - io_open       - STUB DRIVER SUCCESSFUL"
175      );
176   
177      RTEMS.IO_CLOSE(
178         SPTEST.STUB_DRIVER_MAJOR,
179         0,
180         RTEMS.NULL_ADDRESS,
181         STATUS
182      );
183      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "IO_CLOSE" );
184      TEXT_IO.PUT_LINE(
185         "TA1 - io_close      - STUB DRIVER SUCCESSFUL"
186      );
187   
188      RTEMS.IO_READ(
189         SPTEST.STUB_DRIVER_MAJOR,
190         0,
191         RTEMS.NULL_ADDRESS,
192         STATUS
193      );
194      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "IO_READ" );
195      TEXT_IO.PUT_LINE(
196         "TA1 - io_read       - STUB DRIVER SUCCESSFUL"
197      );
198   
199      RTEMS.IO_WRITE(
200         SPTEST.STUB_DRIVER_MAJOR,
201         0,
202         RTEMS.NULL_ADDRESS,
203         STATUS
204      );
205      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "IO_WRITE" );
206      TEXT_IO.PUT_LINE(
207         "TA1 - io_write      - STUB DRIVER SUCCESSFUL"
208      );
209   
210      RTEMS.IO_CONTROL(
211         SPTEST.STUB_DRIVER_MAJOR,
212         0,
213         RTEMS.NULL_ADDRESS,
214         STATUS
215      );
216      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "IO_CONTROL" );
217      TEXT_IO.PUT_LINE(
218         "TA1 - io_control    - STUB DRIVER SUCCESSFUL"
219      );
220
221      TEXT_IO.PUT_LINE( "----- RETURNING INVALID MAJOR NUMBER -----" );
222
223      RTEMS.IO_INITIALIZE(
224         SPTEST.INVALID_DRIVER_MAJOR,
225         0,
226         RTEMS.NULL_ADDRESS,
227         RESULT,
228         STATUS
229      );
230      TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
231         STATUS,
232         RTEMS.INVALID_NUMBER,
233         "IO_INITIALIZE"
234      );
235      TEXT_IO.PUT_LINE(
236         "TA1 - io_initialize - INVALID_NUMBER"
237      );
238   
239      RTEMS.IO_OPEN(
240         SPTEST.INVALID_DRIVER_MAJOR,
241         0,
242         RTEMS.NULL_ADDRESS,
243         STATUS
244      );
245      TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
246         STATUS,
247         RTEMS.INVALID_NUMBER,
248         "IO_OPEN"
249      );
250      TEXT_IO.PUT_LINE(
251         "TA1 - io_open       - INVALID_NUMBER"
252      );
253   
254      TEXT_IO.PUT_LINE( "*** END OF TEST 21 ***" );
255      RTEMS.SHUTDOWN_EXECUTIVE( 0 );
256   
257   end TASK_1;
258
259end SPTEST;
Note: See TracBrowser for help on using the repository browser.