-- CXA4028.A
|
-- CXA4028.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 Ada.Strings.Bounded procedures Append, Head, Tail, and
|
-- Check that Ada.Strings.Bounded procedures Append, Head, Tail, and
|
-- Trim, and relational operator functions "=", ">", ">=", "<", "<="
|
-- Trim, and relational operator functions "=", ">", ">=", "<", "<="
|
-- with parameter combinations of type String and Bounded_String,
|
-- with parameter combinations of type String and Bounded_String,
|
-- produce correct results.
|
-- produce correct results.
|
--
|
--
|
-- TEST DESCRIPTION:
|
-- TEST DESCRIPTION:
|
-- This test examines the operation of several subprograms from within
|
-- This test examines the operation of several subprograms from within
|
-- the Ada.Strings.Bounded package. Four different instantiations of
|
-- the Ada.Strings.Bounded package. Four different instantiations of
|
-- Ada.Strings.Bounded.Generic_Bounded_Length provide packages defined
|
-- Ada.Strings.Bounded.Generic_Bounded_Length provide packages defined
|
-- to manipulate bounded strings of lengths 1, 20, 40, and 80.
|
-- to manipulate bounded strings of lengths 1, 20, 40, and 80.
|
-- Examples of the above mentioned procedures and relational operators
|
-- Examples of the above mentioned procedures and relational operators
|
-- from each of these instantiations are tested, with results compared
|
-- from each of these instantiations are tested, with results compared
|
-- against expected output.
|
-- against expected output.
|
--
|
--
|
-- Testing of the function versions of many of the subprograms tested
|
-- Testing of the function versions of many of the subprograms tested
|
-- here is performed in tests CXA4006-CXA4009.
|
-- here is performed in tests CXA4006-CXA4009.
|
--
|
--
|
--
|
--
|
-- CHANGE HISTORY:
|
-- CHANGE HISTORY:
|
-- 16 Feb 95 SAIC Initial prerelease version
|
-- 16 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.
|
--
|
--
|
--!
|
--!
|
|
|
with Ada.Exceptions;
|
with Ada.Exceptions;
|
with Ada.Strings.Bounded;
|
with Ada.Strings.Bounded;
|
with Report;
|
with Report;
|
|
|
procedure CXA4028 is
|
procedure CXA4028 is
|
|
|
begin
|
begin
|
|
|
Report.Test ("CXA4028", "Check that Ada.Strings.Bounded procedures " &
|
Report.Test ("CXA4028", "Check that Ada.Strings.Bounded procedures " &
|
"Append, Head, Tail, and Trim, and relational " &
|
"Append, Head, Tail, and Trim, and relational " &
|
"operator functions =, >, >=, <, <= with " &
|
"operator functions =, >, >=, <, <= with " &
|
"parameter combinations of type String and " &
|
"parameter combinations of type String and " &
|
"Bounded_String, produce correct results");
|
"Bounded_String, produce correct results");
|
|
|
Test_Block:
|
Test_Block:
|
declare
|
declare
|
|
|
use Ada.Exceptions;
|
use Ada.Exceptions;
|
use Ada.Strings;
|
use Ada.Strings;
|
|
|
-- Instantiations of Bounded String generic package.
|
-- Instantiations of Bounded String generic package.
|
|
|
package BS1 is new Ada.Strings.Bounded.Generic_Bounded_Length(1);
|
package BS1 is new Ada.Strings.Bounded.Generic_Bounded_Length(1);
|
package BS20 is new Ada.Strings.Bounded.Generic_Bounded_Length(20);
|
package BS20 is new Ada.Strings.Bounded.Generic_Bounded_Length(20);
|
package BS40 is new Ada.Strings.Bounded.Generic_Bounded_Length(40);
|
package BS40 is new Ada.Strings.Bounded.Generic_Bounded_Length(40);
|
package BS80 is new Ada.Strings.Bounded.Generic_Bounded_Length(80);
|
package BS80 is new Ada.Strings.Bounded.Generic_Bounded_Length(80);
|
|
|
use type BS1.Bounded_String, BS20.Bounded_String,
|
use type BS1.Bounded_String, BS20.Bounded_String,
|
BS40.Bounded_String, BS80.Bounded_String;
|
BS40.Bounded_String, BS80.Bounded_String;
|
|
|
String_1 : String(1..1) := "A";
|
String_1 : String(1..1) := "A";
|
String_20 : String(1..20) := "ABCDEFGHIJKLMNOPQRST";
|
String_20 : String(1..20) := "ABCDEFGHIJKLMNOPQRST";
|
String_40 : String(1..40) := "abcdefghijklmnopqrst" & String_20;
|
String_40 : String(1..40) := "abcdefghijklmnopqrst" & String_20;
|
String_80 : String(1..80) := String_40 & String_40;
|
String_80 : String(1..80) := String_40 & String_40;
|
|
|
BString_1 : BS1.Bounded_String := BS1.Null_Bounded_String;
|
BString_1 : BS1.Bounded_String := BS1.Null_Bounded_String;
|
BString_20 : BS20.Bounded_String := BS20.Null_Bounded_String;
|
BString_20 : BS20.Bounded_String := BS20.Null_Bounded_String;
|
BString_40 : BS40.Bounded_String := BS40.Null_Bounded_String;
|
BString_40 : BS40.Bounded_String := BS40.Null_Bounded_String;
|
BString_80 : BS80.Bounded_String := BS80.Null_Bounded_String;
|
BString_80 : BS80.Bounded_String := BS80.Null_Bounded_String;
|
|
|
begin
|
begin
|
|
|
-- Procedure Append.
|
-- Procedure Append.
|
|
|
declare
|
declare
|
use BS1, BS20;
|
use BS1, BS20;
|
begin
|
begin
|
Append(Source => BString_1, New_Item => To_Bounded_String("A"));
|
Append(Source => BString_1, New_Item => To_Bounded_String("A"));
|
Append(BString_1, "B", Ada.Strings.Left);
|
Append(BString_1, "B", Ada.Strings.Left);
|
Append(BString_1, 'C', Drop => Ada.Strings.Right); -- Drop appended
|
Append(BString_1, 'C', Drop => Ada.Strings.Right); -- Drop appended
|
-- character.
|
-- character.
|
if BString_1 /= To_Bounded_String("B") then
|
if BString_1 /= To_Bounded_String("B") then
|
Report.Failed("Incorrect results from BS1 versions of " &
|
Report.Failed("Incorrect results from BS1 versions of " &
|
"procedure Append");
|
"procedure Append");
|
end if;
|
end if;
|
|
|
Append(BString_20, 'T'); -- Character.
|
Append(BString_20, 'T'); -- Character.
|
Append(BString_20, "his string"); -- String.
|
Append(BString_20, "his string"); -- String.
|
Append(BString_20,
|
Append(BString_20,
|
To_Bounded_String(" is complete."), -- Bounded string.
|
To_Bounded_String(" is complete."), -- Bounded string.
|
Drop => Ada.Strings.Right); -- Drop 4 characters.
|
Drop => Ada.Strings.Right); -- Drop 4 characters.
|
|
|
if BString_20 /= To_Bounded_String("This string is compl") then
|
if BString_20 /= To_Bounded_String("This string is compl") then
|
Report.Failed("Incorrect results from BS20 versions of " &
|
Report.Failed("Incorrect results from BS20 versions of " &
|
"procedure Append");
|
"procedure Append");
|
end if;
|
end if;
|
end;
|
end;
|
|
|
|
|
-- Operator "=".
|
-- Operator "=".
|
|
|
BString_40 := BS40.To_Bounded_String(String_40);
|
BString_40 := BS40.To_Bounded_String(String_40);
|
BString_80 := BS80.To_Bounded_String(
|
BString_80 := BS80.To_Bounded_String(
|
BS40.To_String(BString_40) &
|
BS40.To_String(BString_40) &
|
BS40.To_String(BString_40));
|
BS40.To_String(BString_40));
|
|
|
if not (BString_40 = String_40 and -- (Bounded_String, String)
|
if not (BString_40 = String_40 and -- (Bounded_String, String)
|
BS80."="(String_80, BString_80)) -- (String, Bounded_String)
|
BS80."="(String_80, BString_80)) -- (String, Bounded_String)
|
then
|
then
|
Report.Failed("Incorrect results from function ""="" with " &
|
Report.Failed("Incorrect results from function ""="" with " &
|
"string - bounded string parameter combinations");
|
"string - bounded string parameter combinations");
|
end if;
|
end if;
|
|
|
|
|
-- Operator "<".
|
-- Operator "<".
|
|
|
BString_1 := BS1.To_Bounded_String("cat", -- string "c" only.
|
BString_1 := BS1.To_Bounded_String("cat", -- string "c" only.
|
Drop => Ada.Strings.Right);
|
Drop => Ada.Strings.Right);
|
BString_20 := BS20.To_Bounded_String("Santa Claus");
|
BString_20 := BS20.To_Bounded_String("Santa Claus");
|
|
|
if BString_1 < "C" or -- (Bounded_String, String)
|
if BString_1 < "C" or -- (Bounded_String, String)
|
BS1."<"(BString_1,"c") or -- (Bounded_String, String)
|
BS1."<"(BString_1,"c") or -- (Bounded_String, String)
|
"x" < BString_1 or -- (String, Bounded_String)
|
"x" < BString_1 or -- (String, Bounded_String)
|
BString_20 < "Santa " or -- (Bounded_String, String)
|
BString_20 < "Santa " or -- (Bounded_String, String)
|
"Santa and his Elves" < BString_20 -- (String, Bounded_String)
|
"Santa and his Elves" < BString_20 -- (String, Bounded_String)
|
then
|
then
|
Report.Failed("Incorrect results from function ""<"" with " &
|
Report.Failed("Incorrect results from function ""<"" with " &
|
"string - bounded string parameter combinations");
|
"string - bounded string parameter combinations");
|
end if;
|
end if;
|
|
|
|
|
-- Operator "<=".
|
-- Operator "<=".
|
|
|
BString_20 := BS20.To_Bounded_String("Sample string");
|
BString_20 := BS20.To_Bounded_String("Sample string");
|
|
|
if BString_20 <= "Sample strin" or -- (Bounded_String, String)
|
if BString_20 <= "Sample strin" or -- (Bounded_String, String)
|
"sample string" <= BString_20 or -- (String, Bounded_String)
|
"sample string" <= BString_20 or -- (String, Bounded_String)
|
not("Sample string" <= BString_20) -- (String, Bounded_String)
|
not("Sample string" <= BString_20) -- (String, Bounded_String)
|
then
|
then
|
Report.Failed("Incorrect results from function ""<="" with " &
|
Report.Failed("Incorrect results from function ""<="" with " &
|
"string - bounded string parameter combinations");
|
"string - bounded string parameter combinations");
|
end if;
|
end if;
|
|
|
|
|
-- Operator ">".
|
-- Operator ">".
|
|
|
BString_40 := BS40.To_Bounded_String("A MUCH LONGER SAMPLE STRING.");
|
BString_40 := BS40.To_Bounded_String("A MUCH LONGER SAMPLE STRING.");
|
|
|
if BString_40 > "A much longer sample string" or -- (Bnd_Str, Str)
|
if BString_40 > "A much longer sample string" or -- (Bnd_Str, Str)
|
String_20 > BS40.To_Bounded_String(String_40) or -- (Str, Bnd_Str)
|
String_20 > BS40.To_Bounded_String(String_40) or -- (Str, Bnd_Str)
|
BS40.To_Bounded_String("ABCDEFGH") > "abcdefgh" -- (Str, Bnd_Str)
|
BS40.To_Bounded_String("ABCDEFGH") > "abcdefgh" -- (Str, Bnd_Str)
|
then
|
then
|
Report.Failed("Incorrect results from function "">"" with " &
|
Report.Failed("Incorrect results from function "">"" with " &
|
"string - bounded string parameter combinations");
|
"string - bounded string parameter combinations");
|
end if;
|
end if;
|
|
|
|
|
-- Operator ">=".
|
-- Operator ">=".
|
|
|
BString_80 := BS80.To_Bounded_String(String_80);
|
BString_80 := BS80.To_Bounded_String(String_80);
|
|
|
if not (BString_80 >= String_80 and
|
if not (BString_80 >= String_80 and
|
BS80.To_Bounded_String("Programming") >= "PROGRAMMING" and
|
BS80.To_Bounded_String("Programming") >= "PROGRAMMING" and
|
"test" >= BS80.To_Bounded_String("tess"))
|
"test" >= BS80.To_Bounded_String("tess"))
|
then
|
then
|
Report.Failed("Incorrect results from function "">="" with " &
|
Report.Failed("Incorrect results from function "">="" with " &
|
"string - bounded string parameter combinations");
|
"string - bounded string parameter combinations");
|
end if;
|
end if;
|
|
|
|
|
-- Procedure Trim
|
-- Procedure Trim
|
|
|
BString_20 := BS20.To_Bounded_String(" Left Spaces ");
|
BString_20 := BS20.To_Bounded_String(" Left Spaces ");
|
BS20.Trim(Source => BString_20,
|
BS20.Trim(Source => BString_20,
|
Side => Ada.Strings.Left);
|
Side => Ada.Strings.Left);
|
|
|
if "Left Spaces " /= BString_20 then
|
if "Left Spaces " /= BString_20 then
|
Report.Failed("Incorrect results from Procedure Trim with " &
|
Report.Failed("Incorrect results from Procedure Trim with " &
|
"Side = Left");
|
"Side = Left");
|
end if;
|
end if;
|
|
|
BString_40 := BS40.To_Bounded_String(" Right Spaces ");
|
BString_40 := BS40.To_Bounded_String(" Right Spaces ");
|
BS40.Trim(BString_40, Side => Ada.Strings.Right);
|
BS40.Trim(BString_40, Side => Ada.Strings.Right);
|
|
|
if BString_40 /= " Right Spaces" then
|
if BString_40 /= " Right Spaces" then
|
Report.Failed("Incorrect results from Procedure Trim with " &
|
Report.Failed("Incorrect results from Procedure Trim with " &
|
"Side = Right");
|
"Side = Right");
|
end if;
|
end if;
|
|
|
BString_20 := BS20.To_Bounded_String(" Both Sides ");
|
BString_20 := BS20.To_Bounded_String(" Both Sides ");
|
BS20.Trim(BString_20, Ada.Strings.Both);
|
BS20.Trim(BString_20, Ada.Strings.Both);
|
|
|
if BString_20 /= BS20.To_Bounded_String("Both Sides") then
|
if BString_20 /= BS20.To_Bounded_String("Both Sides") then
|
Report.Failed("Incorrect results from Procedure Trim with " &
|
Report.Failed("Incorrect results from Procedure Trim with " &
|
"Side = Both");
|
"Side = Both");
|
end if;
|
end if;
|
|
|
BString_80 := BS80.To_Bounded_String("Centered Spaces");
|
BString_80 := BS80.To_Bounded_String("Centered Spaces");
|
BS80.Trim(BString_80, Ada.Strings.Both);
|
BS80.Trim(BString_80, Ada.Strings.Both);
|
|
|
if BString_80 /= BS80.To_Bounded_String("Centered Spaces") then
|
if BString_80 /= BS80.To_Bounded_String("Centered Spaces") then
|
Report.Failed("Incorrect results from Procedure Trim with " &
|
Report.Failed("Incorrect results from Procedure Trim with " &
|
"no blank spaces on the ends of the string");
|
"no blank spaces on the ends of the string");
|
end if;
|
end if;
|
|
|
|
|
-- Procedure Head
|
-- Procedure Head
|
|
|
BString_40 := BS40.To_Bounded_String("Test String");
|
BString_40 := BS40.To_Bounded_String("Test String");
|
BS40.Head(Source => BString_40,
|
BS40.Head(Source => BString_40,
|
Count => 4); -- Count < Source'Length
|
Count => 4); -- Count < Source'Length
|
|
|
if BString_40 /= BS40.To_Bounded_String("Test") then
|
if BString_40 /= BS40.To_Bounded_String("Test") then
|
Report.Failed("Incorrect results from Procedure Head with " &
|
Report.Failed("Incorrect results from Procedure Head with " &
|
"the Count parameter less than Source'Length");
|
"the Count parameter less than Source'Length");
|
end if;
|
end if;
|
|
|
BString_1 := BS1.To_Bounded_String("X");
|
BString_1 := BS1.To_Bounded_String("X");
|
BS1.Head(BString_1, BS1.Length(BString_1)); -- Count = Source'Length
|
BS1.Head(BString_1, BS1.Length(BString_1)); -- Count = Source'Length
|
|
|
if BString_1 /= "X" then
|
if BString_1 /= "X" then
|
Report.Failed("Incorrect results from Procedure Head with " &
|
Report.Failed("Incorrect results from Procedure Head with " &
|
"the Count parameter equal to Source'Length");
|
"the Count parameter equal to Source'Length");
|
end if;
|
end if;
|
|
|
BString_20 := BS20.To_Bounded_String("Sample string");
|
BString_20 := BS20.To_Bounded_String("Sample string");
|
BS20.Head(BString_20,
|
BS20.Head(BString_20,
|
Count => BS20.Max_Length, -- Count > Source'Length
|
Count => BS20.Max_Length, -- Count > Source'Length
|
Pad => '*');
|
Pad => '*');
|
|
|
if BString_20 /= BS20.To_Bounded_String("Sample string*******") then
|
if BString_20 /= BS20.To_Bounded_String("Sample string*******") then
|
Report.Failed("Incorrect results from Procedure Head with " &
|
Report.Failed("Incorrect results from Procedure Head with " &
|
"the Count parameter greater than Source'Length");
|
"the Count parameter greater than Source'Length");
|
end if;
|
end if;
|
|
|
BString_20 := BS20.To_Bounded_String("Twenty Characters 20");
|
BString_20 := BS20.To_Bounded_String("Twenty Characters 20");
|
BS20.Head(BString_20, 22, Pad => '*', Drop => Ada.Strings.Left);
|
BS20.Head(BString_20, 22, Pad => '*', Drop => Ada.Strings.Left);
|
|
|
if BString_20 /= "enty Characters 20**" then
|
if BString_20 /= "enty Characters 20**" then
|
Report.Failed("Incorrect results from Procedure Head with " &
|
Report.Failed("Incorrect results from Procedure Head with " &
|
"the Count parameter greater than Source'Length, " &
|
"the Count parameter greater than Source'Length, " &
|
"and the Drop parameter = Left");
|
"and the Drop parameter = Left");
|
end if;
|
end if;
|
|
|
BString_20 := BS20.To_Bounded_String("Short String");
|
BString_20 := BS20.To_Bounded_String("Short String");
|
BS20.Head(BString_20, 23, '-', Ada.Strings.Right);
|
BS20.Head(BString_20, 23, '-', Ada.Strings.Right);
|
|
|
if ("Short String--------") /= BString_20 then
|
if ("Short String--------") /= BString_20 then
|
Report.Failed("Incorrect results from Procedure Head with " &
|
Report.Failed("Incorrect results from Procedure Head with " &
|
"the Count parameter greater than Source'Length, " &
|
"the Count parameter greater than Source'Length, " &
|
"and the Drop parameter = Right");
|
"and the Drop parameter = Right");
|
end if;
|
end if;
|
|
|
|
|
-- Procedure Tail
|
-- Procedure Tail
|
|
|
BString_40 := BS40.To_Bounded_String("Test String");
|
BString_40 := BS40.To_Bounded_String("Test String");
|
BS40.Tail(Source => BString_40,
|
BS40.Tail(Source => BString_40,
|
Count => 6); -- Count < Source'Length
|
Count => 6); -- Count < Source'Length
|
|
|
if BString_40 /= BS40.To_Bounded_String("String") then
|
if BString_40 /= BS40.To_Bounded_String("String") then
|
Report.Failed("Incorrect results from Procedure Tail with " &
|
Report.Failed("Incorrect results from Procedure Tail with " &
|
"the Count parameter less than Source'Length");
|
"the Count parameter less than Source'Length");
|
end if;
|
end if;
|
|
|
BString_1 := BS1.To_Bounded_String("X");
|
BString_1 := BS1.To_Bounded_String("X");
|
BS1.Tail(BString_1, BS1.Length(BString_1)); -- Count = Source'Length
|
BS1.Tail(BString_1, BS1.Length(BString_1)); -- Count = Source'Length
|
|
|
if BString_1 /= "X" then
|
if BString_1 /= "X" then
|
Report.Failed("Incorrect results from Procedure Tail with " &
|
Report.Failed("Incorrect results from Procedure Tail with " &
|
"the Count parameter equal to Source'Length");
|
"the Count parameter equal to Source'Length");
|
end if;
|
end if;
|
|
|
BString_20 := BS20.To_Bounded_String("Sample string");
|
BString_20 := BS20.To_Bounded_String("Sample string");
|
BS20.Tail(BString_20,
|
BS20.Tail(BString_20,
|
Count => BS20.Max_Length, -- Count > Source'Length
|
Count => BS20.Max_Length, -- Count > Source'Length
|
Pad => '*');
|
Pad => '*');
|
|
|
if BString_20 /= BS20.To_Bounded_String("*******Sample string") then
|
if BString_20 /= BS20.To_Bounded_String("*******Sample string") then
|
Report.Failed("Incorrect results from Procedure Tail with " &
|
Report.Failed("Incorrect results from Procedure Tail with " &
|
"the Count parameter greater than Source'Length");
|
"the Count parameter greater than Source'Length");
|
end if;
|
end if;
|
|
|
BString_20 := BS20.To_Bounded_String("Twenty Characters"); -- Len = 17
|
BString_20 := BS20.To_Bounded_String("Twenty Characters"); -- Len = 17
|
BS20.Tail(BString_20, 22, Pad => '*', Drop => Ada.Strings.Left);
|
BS20.Tail(BString_20, 22, Pad => '*', Drop => Ada.Strings.Left);
|
|
|
if BString_20 /= "***Twenty Characters" then
|
if BString_20 /= "***Twenty Characters" then
|
Report.Failed("Incorrect results from Procedure Tail with " &
|
Report.Failed("Incorrect results from Procedure Tail with " &
|
"the Count parameter greater than Source'Length, " &
|
"the Count parameter greater than Source'Length, " &
|
"and the Drop parameter = Left");
|
"and the Drop parameter = Left");
|
end if;
|
end if;
|
|
|
BString_20 := BS20.To_Bounded_String("Maximum Length Chars");
|
BString_20 := BS20.To_Bounded_String("Maximum Length Chars");
|
BS20.Tail(BString_20, 23, '-', Ada.Strings.Right);
|
BS20.Tail(BString_20, 23, '-', Ada.Strings.Right);
|
|
|
if ("---Maximum Length Ch") /= BString_20 then
|
if ("---Maximum Length Ch") /= BString_20 then
|
Report.Failed("Incorrect results from Procedure Tail with " &
|
Report.Failed("Incorrect results from Procedure Tail with " &
|
"the Count parameter greater than Source'Length, " &
|
"the Count parameter greater than Source'Length, " &
|
"and the Drop parameter = Right");
|
"and the Drop parameter = Right");
|
end if;
|
end if;
|
|
|
exception
|
exception
|
when The_Error : others =>
|
when The_Error : others =>
|
Report.Failed ("The following exception was raised in the " &
|
Report.Failed ("The following exception was raised in the " &
|
"Test_Block: " & Exception_Name(The_Error));
|
"Test_Block: " & Exception_Name(The_Error));
|
end Test_Block;
|
end Test_Block;
|
|
|
Report.Result;
|
Report.Result;
|
|
|
end CXA4028;
|
end CXA4028;
|
|
|