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 | |
18 | pragma License (Modified_Gpl); |
19 | pragma Ada_2022; |
20 | |
21 | with GNAT.Source_Info; |
22 | |
23 | --- |
24 | -- @summary |
25 | -- assertions for access types. |
26 | -- |
27 | -- @description |
28 | -- Additional Asserts which produce more detailed diagnostic messages Diagnostics will be reported via the |
29 | -- Report_Assertion function. The Report function is passed as a generic ot avoid dependence to AUnit. |
30 | -- |
31 | generic |
32 | type Element_Type (<>) is limited private; |
33 | type Element_Access is access Element_Type; |
34 | package AdaCL.Assert.Pointer is |
35 | --- |
36 | -- Assert that a access is equal a given value |
37 | -- |
38 | --: @param Actual Actual value |
39 | --: @param Expected Expected value |
40 | --: @param Name Name of variable or function restlt. |
41 | --: @param Source Source code |
42 | --: @param Line Line number |
43 | procedure Equal |
44 | (Actual : Element_Access; |
45 | Expected : Element_Access; |
46 | Name : String; |
47 | Source : String := GNAT.Source_Info.File; |
48 | Line : Natural := GNAT.Source_Info.Line); |
49 | |
50 | --- |
51 | -- Assert that a access is not equal a given value |
52 | -- |
53 | --: @param Actual Actual value |
54 | --: @param Expected Expected value |
55 | --: @param Name Name of variable or function result. |
56 | --: @param Source Source code |
57 | --: @param Line Line number |
58 | procedure Not_Equal |
59 | (Actual : Element_Access; |
60 | Expected : Element_Access; |
61 | Name : String; |
62 | Source : String := GNAT.Source_Info.File; |
63 | Line : Natural := GNAT.Source_Info.Line); |
64 | |
65 | --- |
66 | -- Assert that access is null |
67 | -- |
68 | --: @param Actual Actual value |
69 | --: @param Name Name of variable or function restlt. |
70 | --: @param Source Source code |
71 | --: @param Line Line number |
72 | procedure Is_Null |
73 | (Actual : Element_Access; |
74 | Name : String; |
75 | Source : String := GNAT.Source_Info.File; |
76 | Line : Natural := GNAT.Source_Info.Line); |
77 | |
78 | --- |
79 | -- Assert that access is not null |
80 | -- |
81 | --: @param Actual Actual value |
82 | --: @param Name Name of variable or function restlt. |
83 | --: @param Source Source code |
84 | --: @param Line Line number |
85 | procedure Not_Null |
86 | (Actual : Element_Access; |
87 | Name : String; |
88 | Source : String := GNAT.Source_Info.File; |
89 | Line : Natural := GNAT.Source_Info.Line); |
90 | |
91 | end AdaCL.Assert.Pointer; |
92 | |
93 | ---------------------------------------------------------------- {{{ ---------- |
94 | --: vim: set textwidth=0 nowrap tabstop=8 shiftwidth=3 softtabstop=3 expandtab : |
95 | --: vim: set filetype=ada fileencoding=utf-8 fileformat=unix foldmethod=marker : |
96 | --: vim: set spell spelllang=en_gb |