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 fixed point values |
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 Fixed_Type is delta <>; |
33 | package AdaCL.Assert.Fixed is |
34 | --- |
35 | -- Assert that a Float value is equal a given value |
36 | -- |
37 | --: @param Actual Actual value |
38 | --: @param Expected Expected value |
39 | --: @param Name Name of variable or function restlt. |
40 | --: @param Source Source code |
41 | --: @param Line Line number |
42 | procedure Equal |
43 | (Actual : Fixed_Type; |
44 | Expected : Fixed_Type; |
45 | Name : String; |
46 | Source : String := GNAT.Source_Info.File; |
47 | Line : Natural := GNAT.Source_Info.Line); |
48 | |
49 | --- |
50 | -- Assert that a Float value is not equal a given value |
51 | -- |
52 | --: @param Actual Actual value |
53 | --: @param Expected Expected value |
54 | --: @param Name Name of variable or function restlt. |
55 | --: @param Source Source code |
56 | --: @param Line Line number |
57 | procedure Not_Equal |
58 | (Actual : Fixed_Type; |
59 | Expected : Fixed_Type; |
60 | Name : String; |
61 | Source : String := GNAT.Source_Info.File; |
62 | Line : Natural := GNAT.Source_Info.Line); |
63 | |
64 | --- |
65 | -- Assert that a Float value is greater a given value |
66 | -- |
67 | --: @param Actual Actual value |
68 | --: @param Expected Expected value |
69 | --: @param Name Name of variable or function restlt. |
70 | --: @param Source Source code |
71 | --: @param Line Line number |
72 | procedure Greater |
73 | (Actual : Fixed_Type; |
74 | Expected : Fixed_Type; |
75 | Name : String; |
76 | Source : String := GNAT.Source_Info.File; |
77 | Line : Natural := GNAT.Source_Info.Line); |
78 | |
79 | --- |
80 | -- Assert that a Float value is greater or equal a given value |
81 | -- |
82 | --: @param Actual Actual value |
83 | --: @param Expected Expected value |
84 | --: @param Name Name of variable or function restlt. |
85 | --: @param Source Source code |
86 | --: @param Line Line number |
87 | procedure Greater_Equal |
88 | (Actual : Fixed_Type; |
89 | Expected : Fixed_Type; |
90 | Name : String; |
91 | Source : String := GNAT.Source_Info.File; |
92 | Line : Natural := GNAT.Source_Info.Line); |
93 | |
94 | --- |
95 | -- Assert that a Float value is less a given value |
96 | -- |
97 | --: @param Actual Actual value |
98 | --: @param Expected Expected value |
99 | --: @param Name Name of variable or function restlt. |
100 | --: @param Source Source code |
101 | --: @param Line Line number |
102 | procedure Less |
103 | (Actual : Fixed_Type; |
104 | Expected : Fixed_Type; |
105 | Name : String; |
106 | Source : String := GNAT.Source_Info.File; |
107 | Line : Natural := GNAT.Source_Info.Line); |
108 | |
109 | --- |
110 | -- Assert that a Float value is less or equal a given value |
111 | -- |
112 | --: @param Actual Actual value |
113 | --: @param Expected Expected value |
114 | --: @param Name Name of variable or function restlt. |
115 | --: @param Source Source code |
116 | --: @param Line Line number |
117 | procedure Less_Equal |
118 | (Actual : Fixed_Type; |
119 | Expected : Fixed_Type; |
120 | Name : String; |
121 | Source : String := GNAT.Source_Info.File; |
122 | Line : Natural := GNAT.Source_Info.Line); |
123 | |
124 | --- |
125 | -- Assert that an Float value is inside range |
126 | -- |
127 | --: @param Actual Actual value |
128 | --: @param First Expected minimum value |
129 | --: @param Last Expected maximum value |
130 | --: @param Name Name of variable or function restlt. |
131 | --: @param Source Source code |
132 | --: @param Line Line number |
133 | procedure In_Range |
134 | (Actual : Fixed_Type; |
135 | First : Fixed_Type; |
136 | Last : Fixed_Type; |
137 | Name : String; |
138 | Source : String := GNAT.Source_Info.File; |
139 | Line : Natural := GNAT.Source_Info.Line); |
140 | |
141 | end AdaCL.Assert.Fixed; |
142 | |
143 | ---------------------------------------------------------------- {{{ ---------- |
144 | --: vim: set textwidth=0 nowrap tabstop=8 shiftwidth=3 softtabstop=3 expandtab : |
145 | --: vim: set filetype=ada fileencoding=utf-8 fileformat=unix foldmethod=marker : |
146 | --: vim: set spell spelllang=en_gb |