stephes_ada_library_3.7.3_08b48307/source_devel/sal-gen_graphs-gen_aunit.ads

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
--  Abstract :
--
--  AUnit checks for parent
--
--  Copyright (C) 2017, 2019 Stephen Leake All Rights Reserved.
--
--  This library is free software;  you can redistribute it and/or modify it
--  under terms of the  GNU General Public License  as published by the Free
--  Software  Foundation;  either version 3,  or (at your  option) any later
--  version. This library is distributed in the hope that it will be useful,
--  but WITHOUT ANY WARRANTY;  without even the implied warranty of MERCHAN-
--  TABILITY or FITNESS FOR A PARTICULAR PURPOSE.

pragma License (GPL);

with AUnit.Checks;
with SAL.Ada_Containers.Gen_Doubly_Linked_Lists_AUnit;
with SAL.Ada_Containers.Gen_Indefinite_Vectors_AUnit;
generic
   with procedure Check_Edge_Data (Label : in String; Computed, Expected : in Edge_Data);
package SAL.Gen_Graphs.Gen_AUnit is

   procedure Check is new AUnit.Checks.Gen_Check_Discrete (Vertex_Index);
   procedure Check is new AUnit.Checks.Gen_Check_Discrete (Base_Edge_ID);

   procedure Check
     (Label    : in String;
      Computed : in Edge_Item;
      Expected : in Edge_Item);

   procedure Check is new SAL.Ada_Containers.Gen_Doubly_Linked_Lists_AUnit
     (Element_Type  => Edge_Item,
      Lists         => Edge_Lists,
      Check_Element => Check);

   function "&" (Left : in Edge_Lists.List; Right : in Edge_Item) return Edge_Lists.List;

   function Trimmed_Image is new SAL.Gen_Trimmed_Image (Base_Edge_ID);

   function Image (Item : in Edge_Lists.List) return String;
   --  In unit test expected path building format

   procedure Check
     (Label    : in String;
      Computed : in Path_Item;
      Expected : in Path_Item);

   procedure Check_Path is new AUnit.Checks.Gen_Check_Unconstrained_Array
     --  Has "Strict_Indices" param
     (Item_Type   => Path_Item,
      Index_Type  => Positive,
      Array_Type  => Path,
      Check_Index => AUnit.Checks.Check,
      Check_Item  => Check);

   procedure Check
     (Label    : in String;
      Computed : in Path;
      Expected : in Path);
   --  For composing.

   function Image (Item : in Path) return String;
   --  In unit test expected path building format

   procedure Check is new AUnit.Checks.Gen_Check_Discrete (Path_Index);

   procedure Check is new SAL.Ada_Containers.Gen_Indefinite_Vectors_AUnit
     (Index_Type    => Path_Index,
      Element_Type  => Path,
      Vectors       => Path_Arrays,
      Check_Index   => Check,
      Check_Element => Check);

   procedure Check is new SAL.Ada_Containers.Gen_Doubly_Linked_Lists_AUnit
     (Element_Type  => Vertex_Index,
      Lists         => Vertex_Lists,
      Check_Element => Check);

   function "+" (Right : in Vertex_Index) return Vertex_Lists.List;
   function "&" (Left : in Vertex_Lists.List; Right : in Vertex_Index) return Vertex_Lists.List;

   procedure Check is new SAL.Ada_Containers.Gen_Doubly_Linked_Lists_AUnit
     (Element_Type  => Vertex_Lists.List,
      "="           => Vertex_Lists."=",
      Lists         => Component_Lists,
      Check_Element => Check);

end SAL.Gen_Graphs.Gen_AUnit;