-- CXA4024.A
|
-- CXA4024.A
|
--
|
--
|
-- Grant of Unlimited Rights
|
-- Grant of Unlimited Rights
|
--
|
--
|
-- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
|
-- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
|
-- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
|
-- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
|
-- unlimited rights in the software and documentation contained herein.
|
-- unlimited rights in the software and documentation contained herein.
|
-- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
|
-- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
|
-- this public release, the Government intends to confer upon all
|
-- this public release, the Government intends to confer upon all
|
-- recipients unlimited rights equal to those held by the Government.
|
-- recipients unlimited rights equal to those held by the Government.
|
-- These rights include rights to use, duplicate, release or disclose the
|
-- These rights include rights to use, duplicate, release or disclose the
|
-- released technical data and computer software in whole or in part, in
|
-- released technical data and computer software in whole or in part, in
|
-- any manner and for any purpose whatsoever, and to have or permit others
|
-- any manner and for any purpose whatsoever, and to have or permit others
|
-- to do so.
|
-- to do so.
|
--
|
--
|
-- DISCLAIMER
|
-- DISCLAIMER
|
--
|
--
|
-- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
|
-- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
|
-- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
|
-- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
|
-- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
|
-- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
|
-- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
|
-- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
|
-- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
|
-- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
|
-- PARTICULAR PURPOSE OF SAID MATERIAL.
|
-- PARTICULAR PURPOSE OF SAID MATERIAL.
|
--*
|
--*
|
--
|
--
|
-- OBJECTIVE:
|
-- OBJECTIVE:
|
-- Check that the function "-", To_Ranges, To_Domain, and To_Range are
|
-- Check that the function "-", To_Ranges, To_Domain, and To_Range are
|
-- available in the package Ada.Strings.Maps, and that they produce
|
-- available in the package Ada.Strings.Maps, and that they produce
|
-- correct results based on the Character_Set/Character_Mapping input
|
-- correct results based on the Character_Set/Character_Mapping input
|
-- provided.
|
-- provided.
|
--
|
--
|
-- TEST DESCRIPTION:
|
-- TEST DESCRIPTION:
|
-- This test examines the operation of four functions from within the
|
-- This test examines the operation of four functions from within the
|
-- Ada.Strings.Maps package. A variety of Character_Sequence,
|
-- Ada.Strings.Maps package. A variety of Character_Sequence,
|
-- Character_Set, and Character_Mapping objects are created and
|
-- Character_Set, and Character_Mapping objects are created and
|
-- initialized for use with these functions. In each subtest of
|
-- initialized for use with these functions. In each subtest of
|
-- function operation, specific inputs are provided to the functions as
|
-- function operation, specific inputs are provided to the functions as
|
-- input parameters, and the results are evaluated against expected
|
-- input parameters, and the results are evaluated against expected
|
-- values. Wherever appropriate, additional characteristics of the
|
-- values. Wherever appropriate, additional characteristics of the
|
-- function results are verified against the prescribed result
|
-- function results are verified against the prescribed result
|
-- characteristics.
|
-- characteristics.
|
--
|
--
|
--
|
--
|
-- CHANGE HISTORY:
|
-- CHANGE HISTORY:
|
-- 03 Feb 95 SAIC Initial prerelease version
|
-- 03 Feb 95 SAIC Initial prerelease version
|
-- 10 Mar 95 SAIC Incorporated reviewer comments.
|
-- 10 Mar 95 SAIC Incorporated reviewer comments.
|
-- 15 Apr 96 SAIC Incorporated reviewer comments for ACVC 2.1.
|
-- 15 Apr 96 SAIC Incorporated reviewer comments for ACVC 2.1.
|
-- 05 Oct 96 SAIC Incorporated reviewer comments for ACVC 2.1.
|
-- 05 Oct 96 SAIC Incorporated reviewer comments for ACVC 2.1.
|
--
|
--
|
--!
|
--!
|
|
|
with Ada.Strings.Maps;
|
with Ada.Strings.Maps;
|
with Ada.Strings.Maps.Constants;
|
with Ada.Strings.Maps.Constants;
|
with Ada.Characters.Latin_1;
|
with Ada.Characters.Latin_1;
|
with Report;
|
with Report;
|
|
|
procedure CXA4024 is
|
procedure CXA4024 is
|
|
|
begin
|
begin
|
|
|
Report.Test ("CXA4024", "Check that the function ""-"", To_Ranges, " &
|
Report.Test ("CXA4024", "Check that the function ""-"", To_Ranges, " &
|
"To_Domain, and To_Range are available in " &
|
"To_Domain, and To_Range are available in " &
|
"the package Ada.Strings.Maps, and that " &
|
"the package Ada.Strings.Maps, and that " &
|
"they produce correct results");
|
"they produce correct results");
|
|
|
Test_Block:
|
Test_Block:
|
declare
|
declare
|
|
|
use Ada.Strings, Ada.Strings.Maps;
|
use Ada.Strings, Ada.Strings.Maps;
|
use type Maps.Character_Set; -- To allow logical set operator
|
use type Maps.Character_Set; -- To allow logical set operator
|
-- infix notation.
|
-- infix notation.
|
package ACL1 renames Ada.Characters.Latin_1;
|
package ACL1 renames Ada.Characters.Latin_1;
|
|
|
MidPoint_Letter : constant := 13;
|
MidPoint_Letter : constant := 13;
|
Last_Letter : constant := 26;
|
Last_Letter : constant := 26;
|
|
|
Vowels : constant Maps.Character_Sequence := "aeiou";
|
Vowels : constant Maps.Character_Sequence := "aeiou";
|
Quasi_Vowel : constant Character := 'y';
|
Quasi_Vowel : constant Character := 'y';
|
|
|
Alphabet : Maps.Character_Sequence (1..Last_Letter);
|
Alphabet : Maps.Character_Sequence (1..Last_Letter);
|
Half_Alphabet : Maps.Character_Sequence (1..MidPoint_Letter);
|
Half_Alphabet : Maps.Character_Sequence (1..MidPoint_Letter);
|
|
|
Alphabet_Set,
|
Alphabet_Set,
|
Consonant_Set,
|
Consonant_Set,
|
Vowel_Set,
|
Vowel_Set,
|
First_Half_Set,
|
First_Half_Set,
|
Second_Half_Set : Maps.Character_Set;
|
Second_Half_Set : Maps.Character_Set;
|
|
|
|
|
begin
|
begin
|
|
|
-- Load the alphabet strings for use in creating sets.
|
-- Load the alphabet strings for use in creating sets.
|
for i in 0..12 loop
|
for i in 0..12 loop
|
Half_Alphabet(i+1) := Character'Val(Character'Pos('a') + i);
|
Half_Alphabet(i+1) := Character'Val(Character'Pos('a') + i);
|
end loop;
|
end loop;
|
|
|
for i in 0..25 loop
|
for i in 0..25 loop
|
Alphabet(i+1) := Character'Val(Character'Pos('a') + i);
|
Alphabet(i+1) := Character'Val(Character'Pos('a') + i);
|
end loop;
|
end loop;
|
|
|
-- Initialize a series of Character_Set objects.
|
-- Initialize a series of Character_Set objects.
|
|
|
Alphabet_Set := Maps.To_Set(Alphabet);
|
Alphabet_Set := Maps.To_Set(Alphabet);
|
Vowel_Set := Maps.To_Set(Vowels);
|
Vowel_Set := Maps.To_Set(Vowels);
|
Consonant_Set := Vowel_Set XOR Alphabet_Set;
|
Consonant_Set := Vowel_Set XOR Alphabet_Set;
|
First_Half_Set := Maps.To_Set(Half_Alphabet);
|
First_Half_Set := Maps.To_Set(Half_Alphabet);
|
Second_Half_Set := Alphabet_Set XOR First_Half_Set;
|
Second_Half_Set := Alphabet_Set XOR First_Half_Set;
|
|
|
|
|
|
|
-- Evaluation of Set operator "-".
|
-- Evaluation of Set operator "-".
|
|
|
if Consonant_Set /= "-"(Alphabet_Set, Vowel_Set) or
|
if Consonant_Set /= "-"(Alphabet_Set, Vowel_Set) or
|
Vowel_Set /= (Alphabet_Set - Consonant_Set) or
|
Vowel_Set /= (Alphabet_Set - Consonant_Set) or
|
Alphabet_Set /= Alphabet_Set - Maps.Null_Set or
|
Alphabet_Set /= Alphabet_Set - Maps.Null_Set or
|
First_Half_Set /= "-"(Alphabet_Set, Second_Half_Set) or
|
First_Half_Set /= "-"(Alphabet_Set, Second_Half_Set) or
|
(Alphabet_Set - Vowel_Set) /= "AND"(Alphabet_Set, "NOT"(Vowel_Set))
|
(Alphabet_Set - Vowel_Set) /= "AND"(Alphabet_Set, "NOT"(Vowel_Set))
|
then
|
then
|
Report.Failed("Incorrect result from ""-"" operator for sets");
|
Report.Failed("Incorrect result from ""-"" operator for sets");
|
end if;
|
end if;
|
|
|
|
|
|
|
-- Evaluation of Function "To_Ranges".
|
-- Evaluation of Function "To_Ranges".
|
|
|
declare
|
declare
|
|
|
use type Maps.Character_Range;
|
use type Maps.Character_Range;
|
use type Maps.Character_Ranges;
|
use type Maps.Character_Ranges;
|
|
|
Set_A_to_C : Maps.Character_Set := Maps.To_Set("ABC");
|
Set_A_to_C : Maps.Character_Set := Maps.To_Set("ABC");
|
Set_J : Maps.Character_Set := Maps.To_Set("J");
|
Set_J : Maps.Character_Set := Maps.To_Set("J");
|
Set_M_to_P : Maps.Character_Set := Maps.To_Set("MNOP");
|
Set_M_to_P : Maps.Character_Set := Maps.To_Set("MNOP");
|
Set_X_to_Z : Maps.Character_Set := Maps.To_Set("XYZ");
|
Set_X_to_Z : Maps.Character_Set := Maps.To_Set("XYZ");
|
Set_Of_Five : Maps.Character_Set := Set_A_to_C OR -- Union of the
|
Set_Of_Five : Maps.Character_Set := Set_A_to_C OR -- Union of the
|
Set_M_to_P OR -- five sets.
|
Set_M_to_P OR -- five sets.
|
Set_X_to_Z OR
|
Set_X_to_Z OR
|
Set_J OR
|
Set_J OR
|
Maps.Null_Set;
|
Maps.Null_Set;
|
|
|
TC_Range_A_to_C : Maps.Character_Range := (Low => 'A', High => 'C');
|
TC_Range_A_to_C : Maps.Character_Range := (Low => 'A', High => 'C');
|
TC_Range_J : Maps.Character_Range := ('J', 'J');
|
TC_Range_J : Maps.Character_Range := ('J', 'J');
|
TC_Range_M_to_P : Maps.Character_Range := ('M', 'P');
|
TC_Range_M_to_P : Maps.Character_Range := ('M', 'P');
|
TC_Range_X_to_Z : Maps.Character_Range := (Low => 'X', High => 'Z');
|
TC_Range_X_to_Z : Maps.Character_Range := (Low => 'X', High => 'Z');
|
|
|
TC_Ranges : Maps.Character_Ranges (1..4) :=
|
TC_Ranges : Maps.Character_Ranges (1..4) :=
|
(1 => TC_Range_A_to_C,
|
(1 => TC_Range_A_to_C,
|
2 => TC_Range_J,
|
2 => TC_Range_J,
|
3 => TC_Range_M_to_P,
|
3 => TC_Range_M_to_P,
|
4 => TC_Range_X_to_Z);
|
4 => TC_Range_X_to_Z);
|
|
|
begin
|
begin
|
|
|
-- Based on input of a set containing four separate "spans" of
|
-- Based on input of a set containing four separate "spans" of
|
-- character sequences, Function To_Ranges is required to produce
|
-- character sequences, Function To_Ranges is required to produce
|
-- the shortest array of contiguous ranges of Character values in
|
-- the shortest array of contiguous ranges of Character values in
|
-- the input set, in increasing order of Low.
|
-- the input set, in increasing order of Low.
|
|
|
declare
|
declare
|
|
|
-- This Character_Ranges constant should consist of array
|
-- This Character_Ranges constant should consist of array
|
-- components, each component being a Character_Range from Low
|
-- components, each component being a Character_Range from Low
|
-- to High containing the appropriate characters.
|
-- to High containing the appropriate characters.
|
|
|
Ranges_Result : constant Maps.Character_Ranges :=
|
Ranges_Result : constant Maps.Character_Ranges :=
|
Maps.To_Ranges(Set => Set_Of_Five);
|
Maps.To_Ranges(Set => Set_Of_Five);
|
begin
|
begin
|
|
|
-- Check the structure and components of the Character_Ranges
|
-- Check the structure and components of the Character_Ranges
|
-- constant.
|
-- constant.
|
|
|
if Ranges_Result(1) /= TC_Range_A_to_C or
|
if Ranges_Result(1) /= TC_Range_A_to_C or
|
Ranges_Result(1).Low /= TC_Ranges(1).Low or
|
Ranges_Result(1).Low /= TC_Ranges(1).Low or
|
Ranges_Result(2) /= TC_Range_J or
|
Ranges_Result(2) /= TC_Range_J or
|
Ranges_Result(2).High /= TC_Ranges(2).High or
|
Ranges_Result(2).High /= TC_Ranges(2).High or
|
Ranges_Result(3) /= TC_Range_M_to_P or
|
Ranges_Result(3) /= TC_Range_M_to_P or
|
Ranges_Result(3).Low /= TC_Ranges(3).Low or
|
Ranges_Result(3).Low /= TC_Ranges(3).Low or
|
Ranges_Result(3).High /= TC_Ranges(3).High or
|
Ranges_Result(3).High /= TC_Ranges(3).High or
|
Ranges_Result(4) /= TC_Range_X_To_Z or
|
Ranges_Result(4) /= TC_Range_X_To_Z or
|
Ranges_Result(4).Low /= TC_Ranges(4).Low or
|
Ranges_Result(4).Low /= TC_Ranges(4).Low or
|
Ranges_Result(4).High /= TC_Ranges(4).High
|
Ranges_Result(4).High /= TC_Ranges(4).High
|
then
|
then
|
Report.Failed ("Incorrect structure or components in " &
|
Report.Failed ("Incorrect structure or components in " &
|
"Character_Ranges constant");
|
"Character_Ranges constant");
|
end if;
|
end if;
|
|
|
exception
|
exception
|
when others =>
|
when others =>
|
Report.Failed("Exception raised using the Function To_Ranges " &
|
Report.Failed("Exception raised using the Function To_Ranges " &
|
"to initialize a Character_Ranges constant");
|
"to initialize a Character_Ranges constant");
|
end;
|
end;
|
end;
|
end;
|
|
|
|
|
|
|
-- Evaluation of Functions To_Domain and To_Range.
|
-- Evaluation of Functions To_Domain and To_Range.
|
|
|
declare
|
declare
|
|
|
Null_Sequence : constant Maps.Character_Sequence := "";
|
Null_Sequence : constant Maps.Character_Sequence := "";
|
|
|
TC_Upper_Case_Sequence : constant Maps.Character_Sequence :=
|
TC_Upper_Case_Sequence : constant Maps.Character_Sequence :=
|
"ZYXWVUTSRQPONMABCDEFGHIJKL";
|
"ZYXWVUTSRQPONMABCDEFGHIJKL";
|
TC_Lower_Case_Sequence : constant Maps.Character_Sequence :=
|
TC_Lower_Case_Sequence : constant Maps.Character_Sequence :=
|
"zyxwvutsrqponmabcdefghijkl";
|
"zyxwvutsrqponmabcdefghijkl";
|
TC_Unordered_Sequence : Maps.Character_Sequence(1..6) :=
|
TC_Unordered_Sequence : Maps.Character_Sequence(1..6) :=
|
"BxACzy";
|
"BxACzy";
|
|
|
TC_Upper_to_Lower_Map : Maps.Character_Mapping :=
|
TC_Upper_to_Lower_Map : Maps.Character_Mapping :=
|
Maps.To_Mapping(TC_Upper_Case_Sequence,
|
Maps.To_Mapping(TC_Upper_Case_Sequence,
|
TC_Lower_Case_Sequence);
|
TC_Lower_Case_Sequence);
|
|
|
TC_Lower_to_Upper_Map : Maps.Character_Mapping :=
|
TC_Lower_to_Upper_Map : Maps.Character_Mapping :=
|
Maps.To_Mapping(TC_Lower_Case_Sequence,
|
Maps.To_Mapping(TC_Lower_Case_Sequence,
|
TC_Upper_Case_Sequence);
|
TC_Upper_Case_Sequence);
|
|
|
TC_Unordered_Map : Maps.Character_Mapping :=
|
TC_Unordered_Map : Maps.Character_Mapping :=
|
Maps.To_Mapping(TC_Unordered_Sequence,
|
Maps.To_Mapping(TC_Unordered_Sequence,
|
"ikglja");
|
"ikglja");
|
begin
|
begin
|
|
|
declare
|
declare
|
|
|
TC_Domain_1 : constant Maps.Character_Sequence :=
|
TC_Domain_1 : constant Maps.Character_Sequence :=
|
Maps.To_Domain(TC_Upper_to_Lower_Map);
|
Maps.To_Domain(TC_Upper_to_Lower_Map);
|
|
|
TC_Domain_2 : constant Maps.Character_Sequence :=
|
TC_Domain_2 : constant Maps.Character_Sequence :=
|
Maps.To_Domain(TC_Lower_to_Upper_Map);
|
Maps.To_Domain(TC_Lower_to_Upper_Map);
|
|
|
TC_Domain_3 : Maps.Character_Sequence(1..6);
|
TC_Domain_3 : Maps.Character_Sequence(1..6);
|
|
|
TC_Range_1 : constant Maps.Character_Sequence :=
|
TC_Range_1 : constant Maps.Character_Sequence :=
|
Maps.To_Range(TC_Upper_to_Lower_Map);
|
Maps.To_Range(TC_Upper_to_Lower_Map);
|
|
|
TC_Range_2 : constant Maps.Character_Sequence :=
|
TC_Range_2 : constant Maps.Character_Sequence :=
|
Maps.To_Range(TC_Lower_to_Upper_Map);
|
Maps.To_Range(TC_Lower_to_Upper_Map);
|
|
|
TC_Range_3 : Maps.Character_Sequence(1..6);
|
TC_Range_3 : Maps.Character_Sequence(1..6);
|
|
|
begin
|
begin
|
|
|
-- Function To_Domain returns the shortest Character_Sequence
|
-- Function To_Domain returns the shortest Character_Sequence
|
-- value such that each character not in the result maps to
|
-- value such that each character not in the result maps to
|
-- itself, and all characters in the result are in ascending
|
-- itself, and all characters in the result are in ascending
|
-- order.
|
-- order.
|
|
|
TC_Domain_3 := Maps.To_Domain(TC_Unordered_Map);
|
TC_Domain_3 := Maps.To_Domain(TC_Unordered_Map);
|
|
|
-- Check contents of result of To_Domain, must be in ascending
|
-- Check contents of result of To_Domain, must be in ascending
|
-- order.
|
-- order.
|
|
|
if TC_Domain_1 /= "ABCDEFGHIJKLMNOPQRSTUVWXYZ" then
|
if TC_Domain_1 /= "ABCDEFGHIJKLMNOPQRSTUVWXYZ" then
|
Report.Failed("Incorrect result from To_Domain with " &
|
Report.Failed("Incorrect result from To_Domain with " &
|
"TC_Upper_to_Lower_Map as input");
|
"TC_Upper_to_Lower_Map as input");
|
end if;
|
end if;
|
|
|
if TC_Domain_2 /= "abcdefghijklmnopqrstuvwxyz" then
|
if TC_Domain_2 /= "abcdefghijklmnopqrstuvwxyz" then
|
Report.Failed("Incorrect result from To_Domain with " &
|
Report.Failed("Incorrect result from To_Domain with " &
|
"TC_Lower_to_Upper_Map as input");
|
"TC_Lower_to_Upper_Map as input");
|
end if;
|
end if;
|
|
|
if TC_Domain_3 /= "ABCxyz" then
|
if TC_Domain_3 /= "ABCxyz" then
|
Report.Failed("Incorrect result from To_Domain with " &
|
Report.Failed("Incorrect result from To_Domain with " &
|
"an unordered mapping as input");
|
"an unordered mapping as input");
|
end if;
|
end if;
|
|
|
|
|
-- The lower bound on the returned Character_Sequence value
|
-- The lower bound on the returned Character_Sequence value
|
-- from To_Domain must be 1.
|
-- from To_Domain must be 1.
|
|
|
if TC_Domain_1'First /= 1 or
|
if TC_Domain_1'First /= 1 or
|
TC_Domain_2'First /= 1 or
|
TC_Domain_2'First /= 1 or
|
TC_Domain_3'First /= 1
|
TC_Domain_3'First /= 1
|
then
|
then
|
Report.Failed("Incorrect lower bound returned from To_Domain");
|
Report.Failed("Incorrect lower bound returned from To_Domain");
|
end if;
|
end if;
|
|
|
|
|
-- Check contents of result of To_Range.
|
-- Check contents of result of To_Range.
|
|
|
TC_Range_3 := Maps.To_Range(TC_Unordered_Map);
|
TC_Range_3 := Maps.To_Range(TC_Unordered_Map);
|
|
|
if TC_Range_1 /= "abcdefghijklmnopqrstuvwxyz" then
|
if TC_Range_1 /= "abcdefghijklmnopqrstuvwxyz" then
|
Report.Failed("Incorrect result from To_Range with " &
|
Report.Failed("Incorrect result from To_Range with " &
|
"TC_Upper_to_Lower_Map as input");
|
"TC_Upper_to_Lower_Map as input");
|
end if;
|
end if;
|
|
|
if TC_Range_2 /= "ABCDEFGHIJKLMNOPQRSTUVWXYZ" then
|
if TC_Range_2 /= "ABCDEFGHIJKLMNOPQRSTUVWXYZ" then
|
Report.Failed("Incorrect result from To_Range with " &
|
Report.Failed("Incorrect result from To_Range with " &
|
"TC_Lower_to_Upper_Map as input");
|
"TC_Lower_to_Upper_Map as input");
|
end if;
|
end if;
|
|
|
if TC_Range_3 /= "gilkaj" then
|
if TC_Range_3 /= "gilkaj" then
|
Report.Failed("Incorrect result from To_Range with " &
|
Report.Failed("Incorrect result from To_Range with " &
|
"an unordered mapping as input");
|
"an unordered mapping as input");
|
end if;
|
end if;
|
|
|
|
|
-- The lower bound on the returned Character_Sequence value
|
-- The lower bound on the returned Character_Sequence value
|
-- must be 1.
|
-- must be 1.
|
|
|
if TC_Range_1'First /= 1 or
|
if TC_Range_1'First /= 1 or
|
TC_Range_2'First /= 1 or
|
TC_Range_2'First /= 1 or
|
TC_Range_3'First /= 1
|
TC_Range_3'First /= 1
|
then
|
then
|
Report.Failed("Incorrect lower bound returned from To_Range");
|
Report.Failed("Incorrect lower bound returned from To_Range");
|
end if;
|
end if;
|
|
|
|
|
-- The upper bound on the returned Character_Sequence value
|
-- The upper bound on the returned Character_Sequence value
|
-- must be Map'Length.
|
-- must be Map'Length.
|
|
|
if TC_Range_1'Last /= TC_Lower_Case_Sequence'Length or
|
if TC_Range_1'Last /= TC_Lower_Case_Sequence'Length or
|
TC_Range_2'Last /= TC_Upper_Case_Sequence'Length or
|
TC_Range_2'Last /= TC_Upper_Case_Sequence'Length or
|
TC_Range_3'Last /= TC_Unordered_Sequence'Length
|
TC_Range_3'Last /= TC_Unordered_Sequence'Length
|
then
|
then
|
Report.Failed("Incorrect upper bound returned from To_Range");
|
Report.Failed("Incorrect upper bound returned from To_Range");
|
end if;
|
end if;
|
|
|
end;
|
end;
|
|
|
-- Both function To_Domain and To_Range return the null string
|
-- Both function To_Domain and To_Range return the null string
|
-- when provided the Identity character map as an input parameter.
|
-- when provided the Identity character map as an input parameter.
|
|
|
if Maps.To_Domain(Maps.Identity) /= Null_Sequence then
|
if Maps.To_Domain(Maps.Identity) /= Null_Sequence then
|
Report.Failed("Function To_Domain did not return the null " &
|
Report.Failed("Function To_Domain did not return the null " &
|
"string when provided the Identity map as " &
|
"string when provided the Identity map as " &
|
"input");
|
"input");
|
end if;
|
end if;
|
|
|
if Maps.To_Range(Maps.Identity) /= Null_Sequence then
|
if Maps.To_Range(Maps.Identity) /= Null_Sequence then
|
Report.Failed("Function To_Range did not return the null " &
|
Report.Failed("Function To_Range did not return the null " &
|
"string when provided the Identity map as " &
|
"string when provided the Identity map as " &
|
"input");
|
"input");
|
end if;
|
end if;
|
|
|
exception
|
exception
|
when others =>
|
when others =>
|
Report.Failed("Exception raised during the evaluation of " &
|
Report.Failed("Exception raised during the evaluation of " &
|
"Function To_Domain and To_Range");
|
"Function To_Domain and To_Range");
|
end;
|
end;
|
|
|
exception
|
exception
|
when others => Report.Failed ("Exception raised in Test_Block");
|
when others => Report.Failed ("Exception raised in Test_Block");
|
end Test_Block;
|
end Test_Block;
|
|
|
|
|
Report.Result;
|
Report.Result;
|
|
|
end CXA4024;
|
end CXA4024;
|
|
|