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

4.104.114.84.95
Last change on this file since 35e4691 was 35e4691, checked in by Joel Sherrill <joel.sherrill@…>, on 09/04/03 at 18:50:41

2003-09-04 Joel Sherrill <joel@…>

  • mptests/mp01/config.h, mptests/mp01/mp01.adb, mptests/mp01/mptest.adb, mptests/mp01/mptest.ads, mptests/mp02/mptest.adb, mptests/mp02/mptest.ads, mptests/mp03/mptest.adb, mptests/mp03/mptest.ads, mptests/mp04/mptest.adb, mptests/mp04/mptest.ads, mptests/mp05/mptest.adb, mptests/mp05/mptest.ads, mptests/mp06/mptest.adb, mptests/mp06/mptest.ads, mptests/mp07/mptest.adb, mptests/mp07/mptest.ads, mptests/mp08/mptest.adb, mptests/mp08/mptest.ads, mptests/mp09/mptest.adb, mptests/mp09/mptest.ads, mptests/mp10/mptest.adb, mptests/mp10/mptest.ads, mptests/mp11/mptest.adb, mptests/mp11/mptest.ads, mptests/mp12/mptest.adb, mptests/mp12/mptest.ads, mptests/mp13/mptest.adb, mptests/mp13/mptest.ads, mptests/mp14/mptest.adb, mptests/mp14/mptest.ads, samples/base_mp/config.h, samples/base_mp/mptest.adb, samples/base_mp/mptest.ads, samples/base_sp/base_sp.adb, samples/base_sp/config.h, samples/base_sp/sptest.adb, samples/base_sp/sptest.ads, samples/hello/config.h, samples/hello/hello.adb, samples/hello/sptest.adb, samples/hello/sptest.ads, samples/ticker/config.h, samples/ticker/sptest.adb, samples/ticker/sptest.ads, samples/ticker/ticker.adb, sptests/sp01/config.h, sptests/sp01/sp01.adb, sptests/sp01/sptest.adb, sptests/sp01/sptest.ads, sptests/sp02/config.h, sptests/sp02/sp02.adb, sptests/sp02/sptest.adb, sptests/sp02/sptest.ads, sptests/sp03/config.h, sptests/sp03/sp03.adb, sptests/sp03/sptest.adb, sptests/sp03/sptest.ads, sptests/sp04/config.h, sptests/sp04/sp04.adb, sptests/sp04/sptest.adb, sptests/sp04/sptest.ads, sptests/sp05/config.h, sptests/sp05/sp05.adb, sptests/sp05/sptest.adb, sptests/sp05/sptest.ads, sptests/sp06/config.h, sptests/sp06/sp06.adb, sptests/sp06/sptest.adb, sptests/sp06/sptest.ads, sptests/sp07/config.h, sptests/sp07/sp07.adb, sptests/sp07/sptest.adb, sptests/sp07/sptest.ads, sptests/sp08/config.h, sptests/sp08/sp08.adb, sptests/sp08/sptest.adb, sptests/sp08/sptest.ads, sptests/sp09/config.h, sptests/sp09/sp09.adb, sptests/sp09/sptest.adb, sptests/sp09/sptest.ads, sptests/sp11/config.h, sptests/sp11/sp11.adb, sptests/sp11/sptest.adb, sptests/sp11/sptest.ads, sptests/sp12/config.h, sptests/sp12/sp12.adb, sptests/sp12/sptest.adb, sptests/sp12/sptest.ads, sptests/sp13/config.h, sptests/sp13/sp13.adb, sptests/sp13/sptest.adb, sptests/sp13/sptest.ads, sptests/sp14/config.h, sptests/sp14/sp14.adb, sptests/sp14/sptest.adb, sptests/sp14/sptest.ads, sptests/sp15/config.h, sptests/sp15/sp15.adb, sptests/sp15/sptest.adb, sptests/sp15/sptest.ads, sptests/sp16/config.h, sptests/sp16/sp16.adb, sptests/sp16/sptest.adb, sptests/sp16/sptest.ads, sptests/sp17/config.h, sptests/sp17/sp17.adb, sptests/sp17/sptest.adb, sptests/sp17/sptest.ads, sptests/sp19/config.h, sptests/sp19/sp19.adb, sptests/sp19/sptest.ads, sptests/sp20/config.h, sptests/sp20/sp20.adb, sptests/sp20/sptest.adb, sptests/sp20/sptest.ads, sptests/sp21/config.h, sptests/sp21/sp21.adb, sptests/sp21/sptest.adb, sptests/sp21/sptest.ads, sptests/sp22/config.h, sptests/sp22/sp22.adb, sptests/sp22/sptest.adb, sptests/sp22/sptest.ads, sptests/sp23/config.h, sptests/sp23/sp23.adb, sptests/sp23/sptest.adb, sptests/sp23/sptest.ads, sptests/sp24/config.h, sptests/sp24/sp24.adb, sptests/sp24/sptest.adb, sptests/sp24/sptest.ads, sptests/sp25/config.h, sptests/sp25/sp25.adb, sptests/sp25/sptest.adb, sptests/sp25/sptest.ads, sptests/spsize/spsize.adb, sptests/spsize/sptest.adb, sptests/spsize/sptest.ads, support/address_io.adb, support/address_io.ads, support/float_io.ads, support/fp.inc, support/integer.inc, support/rtems_calling_overhead.ads, support/status_io.ads, support/test_support.adb, support/test_support.ads, support/time_test_support.adb, support/time_test_support.ads, support/timer_driver.adb, support/timer_driver.ads, support/unsigned32_io.ads, tmtests/tm01/config.h, tmtests/tm01/tm01.adb, tmtests/tm01/tmtest.adb, tmtests/tm01/tmtest.ads, tmtests/tm02/config.h, tmtests/tm02/tm02.adb, tmtests/tm02/tmtest.adb, tmtests/tm02/tmtest.ads, tmtests/tm03/config.h, tmtests/tm03/tm03.adb, tmtests/tm03/tmtest.adb, tmtests/tm03/tmtest.ads, tmtests/tm04/config.h, tmtests/tm04/tm04.adb, tmtests/tm04/tmtest.adb, tmtests/tm04/tmtest.ads, tmtests/tm05/config.h, tmtests/tm05/tm05.adb, tmtests/tm05/tmtest.adb, tmtests/tm05/tmtest.ads, tmtests/tm06/config.h, tmtests/tm06/tm06.adb, tmtests/tm06/tmtest.adb, tmtests/tm06/tmtest.ads, tmtests/tm07/config.h, tmtests/tm07/tm07.adb, tmtests/tm07/tmtest.adb, tmtests/tm07/tmtest.ads, tmtests/tm08/config.h, tmtests/tm08/tm08.adb, tmtests/tm08/tmtest.adb, tmtests/tm08/tmtest.ads, tmtests/tm09/config.h, tmtests/tm09/tm09.adb, tmtests/tm09/tmtest.adb, tmtests/tm09/tmtest.ads, tmtests/tm10/config.h, tmtests/tm10/tm10.adb, tmtests/tm10/tmtest.adb, tmtests/tm10/tmtest.ads, tmtests/tm11/config.h, tmtests/tm11/tm11.adb, tmtests/tm11/tmtest.adb, tmtests/tm11/tmtest.ads, tmtests/tm12/config.h, tmtests/tm12/tm12.adb, tmtests/tm12/tmtest.adb, tmtests/tm12/tmtest.ads, tmtests/tm13/config.h, tmtests/tm13/tm13.adb, tmtests/tm13/tmtest.adb, tmtests/tm13/tmtest.ads, tmtests/tm14/config.h, tmtests/tm14/tm14.adb, tmtests/tm14/tmtest.adb, tmtests/tm14/tmtest.ads, tmtests/tm15/config.h, tmtests/tm15/tm15.adb, tmtests/tm15/tmtest.adb, tmtests/tm15/tmtest.ads, tmtests/tm16/config.h, tmtests/tm16/tm16.adb, tmtests/tm16/tmtest.adb, tmtests/tm16/tmtest.ads, tmtests/tm17/config.h, tmtests/tm17/tm17.adb, tmtests/tm17/tmtest.adb, tmtests/tm17/tmtest.ads, tmtests/tm18/config.h, tmtests/tm18/tm18.adb, tmtests/tm18/tmtest.adb, tmtests/tm18/tmtest.ads, tmtests/tm19/config.h, tmtests/tm19/tm19.adb, tmtests/tm19/tmtest.adb, tmtests/tm19/tmtest.ads, tmtests/tm20/config.h, tmtests/tm20/tm20.adb, tmtests/tm20/tmtest.adb, tmtests/tm20/tmtest.ads, tmtests/tm21/config.h, tmtests/tm21/tm21.adb, tmtests/tm21/tmtest.adb, tmtests/tm21/tmtest.ads, tmtests/tm22/config.h, tmtests/tm22/tm22.adb, tmtests/tm22/tmtest.adb, tmtests/tm22/tmtest.ads, tmtests/tm23/config.h, tmtests/tm23/tm23.adb, tmtests/tm23/tmtest.adb, tmtests/tm23/tmtest.ads, tmtests/tm24/config.h, tmtests/tm24/tm24.adb, tmtests/tm24/tmtest.adb, tmtests/tm24/tmtest.ads, tmtests/tm25/config.h, tmtests/tm25/tm25.adb, tmtests/tm25/tmtest.adb, tmtests/tm25/tmtest.ads, tmtests/tm28/config.h, tmtests/tm28/tm28.adb, tmtests/tm28/tmtest.adb, tmtests/tm28/tmtest.ads, tmtests/tm29/config.h, tmtests/tm29/tm29.adb, tmtests/tm29/tmtest.adb, tmtests/tm29/tmtest.ads, tmtests/tmck/config.h, tmtests/tmck/tmck.adb, tmtests/tmck/tmtest.adb, tmtests/tmck/tmtest.ads, tmtests/tmoverhd/config.h, tmtests/tmoverhd/dummy_rtems.adb, tmtests/tmoverhd/dummy_rtems.ads, tmtests/tmoverhd/tmoverhd.adb, tmtests/tmoverhd/tmtest.adb, tmtests/tmoverhd/tmtest.ads: URL for license changed.
  • Property mode set to 100644
File size: 5.8 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--
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--  $Id$
21--
22
23with INTERFACES; use INTERFACES;
24with RTEMS;
25with TEST_SUPPORT;
26with TEXT_IO;
27
28package body SPTEST is
29
30--PAGE
31--
32--  INIT
33--
34
35   procedure INIT (
36      ARGUMENT : in     RTEMS.TASK_ARGUMENT
37   ) is
38      STATUS : RTEMS.STATUS_CODES;
39   begin
40
41      TEXT_IO.NEW_LINE( 2 );
42      TEXT_IO.PUT_LINE( "*** TEST 21 ***" );
43
44      SPTEST.TASK_NAME( 1 ) := RTEMS.BUILD_NAME(  'T', 'A', '1', ' ' );
45
46      RTEMS.TASK_CREATE(
47         SPTEST.TASK_NAME( 1 ),
48         1,
49         2048,
50         RTEMS.DEFAULT_MODES,
51         RTEMS.DEFAULT_ATTRIBUTES,
52         SPTEST.TASK_ID( 1 ),
53         STATUS
54      );
55      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_CREATE OF TA1" );
56
57      RTEMS.TASK_START(
58         SPTEST.TASK_ID( 1 ),
59         SPTEST.TASK_1'ACCESS,
60         0,
61         STATUS
62      );
63      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_START OF TA1" );
64
65      RTEMS.TASK_DELETE( RTEMS.SELF, STATUS );
66      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "TASK_DELETE OF SELF" );
67
68   end INIT;
69
70--PAGE
71--
72--  TASK_1
73--
74
75   procedure TASK_1 (
76      ARGUMENT : in     RTEMS.TASK_ARGUMENT
77   ) is
78      STATUS       : RTEMS.STATUS_CODES;
79   begin
80
81      TEXT_IO.PUT_LINE( "----- TESTING THE NULL DRIVER CHECKS -----" );
82
83      RTEMS.IO_INITIALIZE(
84         SPTEST.NO_DRIVER_MAJOR,
85         0,
86         RTEMS.NULL_ADDRESS,
87         STATUS
88      );
89      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "IO_INITIALIZE" );
90      TEXT_IO.PUT_LINE(
91         "TA1 - io_initialize - NULL DRIVER SUCCESSFUL"
92      );
93   
94      RTEMS.IO_OPEN(
95         SPTEST.NO_DRIVER_MAJOR,
96         0,
97         RTEMS.NULL_ADDRESS,
98         STATUS
99      );
100      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "IO_OPEN" );
101      TEXT_IO.PUT_LINE(
102         "TA1 - io_open       - NULL DRIVER SUCCESSFUL"
103      );
104   
105      RTEMS.IO_CLOSE(
106         SPTEST.NO_DRIVER_MAJOR,
107         0,
108         RTEMS.NULL_ADDRESS,
109         STATUS
110      );
111      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "IO_CLOSE" );
112      TEXT_IO.PUT_LINE(
113         "TA1 - io_close      - NULL DRIVER SUCCESSFUL"
114      );
115   
116      RTEMS.IO_READ(
117         SPTEST.NO_DRIVER_MAJOR,
118         0,
119         RTEMS.NULL_ADDRESS,
120         STATUS
121      );
122      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "IO_READ" );
123      TEXT_IO.PUT_LINE(
124         "TA1 - io_read       - NULL DRIVER SUCCESSFUL"
125      );
126   
127      RTEMS.IO_WRITE(
128         SPTEST.NO_DRIVER_MAJOR,
129         0,
130         RTEMS.NULL_ADDRESS,
131         STATUS
132      );
133      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "IO_WRITE" );
134      TEXT_IO.PUT_LINE(
135         "TA1 - io_write      - NULL DRIVER SUCCESSFUL"
136      );
137   
138      RTEMS.IO_CONTROL(
139         SPTEST.NO_DRIVER_MAJOR,
140         0,
141         RTEMS.NULL_ADDRESS,
142         STATUS
143      );
144      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "IO_CONTROL" );
145      TEXT_IO.PUT_LINE(
146         "TA1 - io_control    - NULL DRIVER SUCCESSFUL"
147      );
148   
149      TEXT_IO.PUT_LINE( "----- TESTING THE I/O MANAGER DIRECTIVES -----" );
150
151      RTEMS.IO_INITIALIZE(
152         SPTEST.STUB_DRIVER_MAJOR,
153         0,
154         RTEMS.NULL_ADDRESS,
155         STATUS
156      );
157      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "IO_INITIALIZE" );
158      TEXT_IO.PUT_LINE(
159         "TA1 - io_initialize - STUB DRIVER SUCCESSFUL"
160      );
161   
162      RTEMS.IO_OPEN(
163         SPTEST.STUB_DRIVER_MAJOR,
164         0,
165         RTEMS.NULL_ADDRESS,
166         STATUS
167      );
168      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "IO_OPEN" );
169      TEXT_IO.PUT_LINE(
170         "TA1 - io_open       - STUB DRIVER SUCCESSFUL"
171      );
172   
173      RTEMS.IO_CLOSE(
174         SPTEST.STUB_DRIVER_MAJOR,
175         0,
176         RTEMS.NULL_ADDRESS,
177         STATUS
178      );
179      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "IO_CLOSE" );
180      TEXT_IO.PUT_LINE(
181         "TA1 - io_close      - STUB DRIVER SUCCESSFUL"
182      );
183   
184      RTEMS.IO_READ(
185         SPTEST.STUB_DRIVER_MAJOR,
186         0,
187         RTEMS.NULL_ADDRESS,
188         STATUS
189      );
190      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "IO_READ" );
191      TEXT_IO.PUT_LINE(
192         "TA1 - io_read       - STUB DRIVER SUCCESSFUL"
193      );
194   
195      RTEMS.IO_WRITE(
196         SPTEST.STUB_DRIVER_MAJOR,
197         0,
198         RTEMS.NULL_ADDRESS,
199         STATUS
200      );
201      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "IO_WRITE" );
202      TEXT_IO.PUT_LINE(
203         "TA1 - io_write      - STUB DRIVER SUCCESSFUL"
204      );
205   
206      RTEMS.IO_CONTROL(
207         SPTEST.STUB_DRIVER_MAJOR,
208         0,
209         RTEMS.NULL_ADDRESS,
210         STATUS
211      );
212      TEST_SUPPORT.DIRECTIVE_FAILED( STATUS, "IO_CONTROL" );
213      TEXT_IO.PUT_LINE(
214         "TA1 - io_control    - STUB DRIVER SUCCESSFUL"
215      );
216
217      TEXT_IO.PUT_LINE( "----- RETURNING INVALID MAJOR NUMBER -----" );
218
219      RTEMS.IO_INITIALIZE(
220         SPTEST.INVALID_DRIVER_MAJOR,
221         0,
222         RTEMS.NULL_ADDRESS,
223         STATUS
224      );
225      TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
226         STATUS,
227         RTEMS.INVALID_NUMBER,
228         "IO_INITIALIZE"
229      );
230      TEXT_IO.PUT_LINE(
231         "TA1 - io_initialize - INVALID_NUMBER"
232      );
233   
234      RTEMS.IO_OPEN(
235         SPTEST.INVALID_DRIVER_MAJOR,
236         0,
237         RTEMS.NULL_ADDRESS,
238         STATUS
239      );
240      TEST_SUPPORT.FATAL_DIRECTIVE_STATUS(
241         STATUS,
242         RTEMS.INVALID_NUMBER,
243         "IO_OPEN"
244      );
245      TEXT_IO.PUT_LINE(
246         "TA1 - io_open       - INVALID_NUMBER"
247      );
248   
249      TEXT_IO.PUT_LINE( "*** END OF TEST 21 ***" );
250      RTEMS.SHUTDOWN_EXECUTIVE( 0 );
251   
252   end TASK_1;
253
254end SPTEST;
Note: See TracBrowser for help on using the repository browser.