ADDED tests/natools-chunked_strings-tests-bugfixes.adb Index: tests/natools-chunked_strings-tests-bugfixes.adb ================================================================== --- tests/natools-chunked_strings-tests-bugfixes.adb +++ tests/natools-chunked_strings-tests-bugfixes.adb @@ -0,0 +1,45 @@ +------------------------------------------------------------------------------ +-- Copyright (c) 2013, Natacha Porté -- +-- -- +-- Permission to use, copy, modify, and distribute this software for any -- +-- purpose with or without fee is hereby granted, provided that the above -- +-- copyright notice and this permission notice appear in all copies. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -- +-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -- +-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -- +-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -- +-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -- +-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -- +-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -- +------------------------------------------------------------------------------ + +with Ada.Strings.Maps; + +procedure Natools.Chunked_Strings.Tests.Bugfixes + (Report : in out Natools.Tests.Reporter'Class) +is + package NT renames Natools.Tests; +begin + Report.Section ("Extra tests for complete coverage"); + + declare + Name : constant String := "Overreach of Index"; + CS : Chunked_String := To_Chunked_String ("abcd0123"); + N : Natural; + begin + CS.Head (4); + N := CS.Index (Ada.Strings.Maps.To_Set ("0123456789")); + + if N /= 0 then + Report.Item (Name, NT.Fail); + Report.Info ("Index of digit" & Natural'Image (N) & ", expected 0."); + else + Report.Item (Name, NT.Success); + end if; + exception + when Error : others => NT.Report_Exception (Report, Name, Error); + end; + + Report.End_Section; +end Natools.Chunked_Strings.Tests.Bugfixes; ADDED tests/natools-chunked_strings-tests-bugfixes.ads Index: tests/natools-chunked_strings-tests-bugfixes.ads ================================================================== --- tests/natools-chunked_strings-tests-bugfixes.ads +++ tests/natools-chunked_strings-tests-bugfixes.ads @@ -0,0 +1,26 @@ +------------------------------------------------------------------------------ +-- Copyright (c) 2013, Natacha Porté -- +-- -- +-- Permission to use, copy, modify, and distribute this software for any -- +-- purpose with or without fee is hereby granted, provided that the above -- +-- copyright notice and this permission notice appear in all copies. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -- +-- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -- +-- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -- +-- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -- +-- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -- +-- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -- +-- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -- +------------------------------------------------------------------------------ + +------------------------------------------------------------------------------ +-- Natools.Chunked_Strings.Tests.Bugfixes contains test cases for known -- +-- (and hopefully fixed) bugs. -- +------------------------------------------------------------------------------ + +with Natools.Tests; + +generic procedure Natools.Chunked_Strings.Tests.Bugfixes + (Report : in out Natools.Tests.Reporter'Class); +pragma Preelaborate (Bugfixes); Index: tests/natools-chunked_strings-tests.adb ================================================================== --- tests/natools-chunked_strings-tests.adb +++ tests/natools-chunked_strings-tests.adb @@ -12,10 +12,11 @@ -- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -- -- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF -- -- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -- ------------------------------------------------------------------------------ +with Natools.Chunked_Strings.Tests.Bugfixes; with Natools.Chunked_Strings.Tests.Coverage; with Natools.Chunked_Strings.Tests.CXA4010; with Natools.Chunked_Strings.Tests.CXA4011; with Natools.Chunked_Strings.Tests.CXA4030; with Natools.Chunked_Strings.Tests.CXA4031; @@ -31,10 +32,11 @@ procedure Test_CXA4010 is new CXA4010; procedure Test_CXA4011 is new CXA4011; procedure Test_CXA4030 is new CXA4030; procedure Test_CXA4031 is new CXA4031; procedure Test_CXA4032 is new CXA4032; + procedure Test_Bugfixes is new Bugfixes; begin NT.Section (Report, "Blackbox tests of Chunked_Strings"); Test_CXA4010 (Report); Test_CXA4011 (Report); Test_CXA4030 (Report); @@ -46,10 +48,12 @@ Acc : Chunked_String; begin Accumulators.Tests.Test (Report, Acc); end; NT.End_Section (Report); + + Test_Bugfixes (Report); NT.End_Section (Report); end All_Blackbox_Tests; procedure All_Greybox_Tests (Report : in out Natools.Tests.Reporter'Class)