adacl-assert-vectors.ads

1--------------------------------------------------------------- {{{1 ----------
2--: Copyright © 2007 … 2023 Martin Krischik «krischik@users.sourceforge.net»
3-------------------------------------------------------------------------------
4--: Ada_Demo is free software: you can redistribute it and/or modify it under
5--: the terms of the GNU General Public License as published by the Free
6--: Software Foundation, either version 3 of the License, or (at your option)
7--: any later version.
8--:
9--: Ada_Demo is distributed in the hope that it will be useful, but WITHOUT
10--: ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11--: FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12--: more details.
13--:
14--: You should have received a copy of the GNU General Public License along
15--: with Ada_Demo. If not, see <http://www.gnu.org/licenses/>.
16--------------------------------------------------------------- }}}1 ----------
17
18pragma License (Modified_Gpl);
19pragma Ada_2022;
20
21with GNAT.Source_Info;
22with Ada.Containers.Indefinite_Vectors;
23
24---
25-- @summary
26-- Assertions for vectors
27--
28-- @description
29-- Additional Asserts which produce more detailed diagnostic messages Diagnostics will be reported via the
30-- Report_Assertion function. The Report function is passed as a generic ot avoid dependence to AUnit.
31--
32generic
33 type Element_Type (<>) is private;
34 type Index_Type is range <>;
35 with package Vectors_Package is new Ada.Containers.Indefinite_Vectors (Index_Type, Element_Type);
36package AdaCL.Assert.Vectors is
37
38 subtype Vector_Type is Vectors_Package.Vector;
39
40 ---
41 -- Assert that a array is equal a given value
42 --
43 --: @param Actual Actual value
44 --: @param Expected Expected value
45 --: @param Name Name of variable or function restlt.
46 --: @param Source Source code
47 --: @param Line Line number
48 procedure Equal
49 (Actual : Vector_Type;
50 Expected : Vector_Type;
51 Name : String;
52 Source : String := GNAT.Source_Info.File;
53 Line : Natural := GNAT.Source_Info.Line);
54
55 ---
56 -- Assert that a array is of given length
57 --
58 --: @param Actual Actual value
59 --: @param Expected Expected value
60 --: @param Name Name of variable or function restlt.
61 --: @param Source Source code
62 --: @param Line Line number
63 procedure Length
64 (Actual : Vector_Type;
65 Expected : Ada.Containers.Count_Type;
66 Name : String;
67 Source : String := GNAT.Source_Info.File;
68 Line : Natural := GNAT.Source_Info.Line);
69end AdaCL.Assert.Vectors;
70
71---------------------------------------------------------------- {{{ ----------
72--: vim: set textwidth=0 nowrap tabstop=8 shiftwidth=3 softtabstop=3 expandtab :
73--: vim: set filetype=ada fileencoding=utf-8 fileformat=unix foldmethod=marker :
74--: vim: set spell spelllang=en_gb