File: test_exceptions.adb

package info (click to toggle)
gch 19990519-6
  • links: PTS
  • area: main
  • in suites: potato
  • size: 500 kB
  • ctags: 19
  • sloc: ada: 1,780; perl: 1,330
file content (31 lines) | stat: -rw-r--r-- 798 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
with Ada.Exceptions;
with Ada.IO_Exceptions;
with Ada.Text_IO;
with Asis.Exceptions;
procedure Test_Exceptions is
My_Exception : exception;
My_Bad_Exception : exception renames Storage_Error;
My_Second_Bad_Exception : exception renames Ada.IO_Exceptions.Data_Error;
begin

   raise Storage_Error;
   raise My_Exception;
   raise Ada.IO_Exceptions.Data_Error;
   raise My_Exception;
   raise My_Bad_Exception;
   raise My_Exception;
   raise My_Second_Bad_Exception;
   raise My_Exception;
   raise Asis.Exceptions.ASIS_Inappropriate_Context;
   raise Ada.Text_IO.Layout_Error;
   Ada.Exceptions.Raise_Exception (Storage_Error'Identity, "");

exception
   when
         My_Exception |
         Ada.IO_Exceptions.Data_Error
         => null;
--   when others
--         => null;

end Test_Exceptions;