2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / ada / acats / tests / cb / cb40a031.am
blob6f2f2aa99f102d03c6630a0e10d97d6d151f3bb8
1 -- CB40A031.AM
2 --
3 --                             Grant of Unlimited Rights
4 --
5 --     Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
6 --     F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained 
7 --     unlimited rights in the software and documentation contained herein.
8 --     Unlimited rights are defined in DFAR 252.227-7013(a)(19).  By making 
9 --     this public release, the Government intends to confer upon all 
10 --     recipients unlimited rights  equal to those held by the Government.  
11 --     These rights include rights to use, duplicate, release or disclose the 
12 --     released technical data and computer software in whole or in part, in 
13 --     any manner and for any purpose whatsoever, and to have or permit others 
14 --     to do so.
16 --                                    DISCLAIMER
18 --     ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
19 --     DISCLOSED ARE AS IS.  THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED 
20 --     WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
21 --     SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE 
22 --     OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
23 --     PARTICULAR PURPOSE OF SAID MATERIAL.
24 --*
26 -- OBJECTIVE:
27 --      Check that a predefined exception is correctly propagated from
28 --      a private child package through a visible child package to a client.
30 -- TEST DESCRIPTION:
31 --      Declare two child packages from a root package, one visible, one
32 --      private.  The visible child package contains a function, whose
33 --      body makes a call to a procedure contained in the private sibling
34 --      package.  A predefined exception occurring in the subprogram within the
35 --      private package is propagated through the visible sibling and ancestor
36 --      to the test program.
38 --      Exception Type Raised:
39 --          User Defined
40 --        * Predefined  
42 --      Hierarchical Structure Employed For This Test:  
43 --        * Parent Package
44 --        * Visible Child Package
45 --        * Private Child Package
46 --          Visible Child Subprogram
47 --          Private Child Subprogram
49 -- TEST FILES:
50 --      This test consists of the following files:
52 --         FB40A00.A
53 --         CB40A030.A
54 --      => CB40A031.AM
56 --       
57 -- CHANGE HISTORY:
58 --      06 Dec 94   SAIC    ACVC 2.0
59 --      02 Nov 96   SAIC    ACVC 2.1: Modified prologue.
61 --!
63 with Report;
64 with FB40A00.CB40A030_0; -- Explicit "with" of Text_Parser.Character_Counting
65                          -- Implicit "with" of Text_Parser
67 procedure CB40A031 is
69    String_Constant : constant String := 
70      "The San Diego Padres will win the World Series in 1999."; 
72    Number_Of_AlphaNumeric_Characters : Natural := 0;
74 begin
76    Process_Block:
77    begin
79       Report.Test ("CB40A031", "Check that a predefined exception " &
80                                "is correctly propagated across "    &
81                                "package boundaries");
83       Number_Of_AlphaNumeric_Characters := 
84         FB40A00.CB40A030_0.Count_AlphaNumerics (String_Constant);
86       Report.Failed ("Exception should have been handled");
88    exception
90       when Constraint_Error =>                       -- Correct exception 
91          if FB40A00.AlphaNumeric_Count /= 44 then    -- propagation.
92             Report.Failed ("Incorrect string processing");
93          end if;
95       when others =>
96          Report.Failed ("Exception handled in an others handler");
98    end Process_Block;
100    Report.Result;
102 end CB40A031;