diff options
author | Jed Barber <jjbarber@y7mail.com> | 2020-05-20 01:21:51 +1000 |
---|---|---|
committer | Jed Barber <jjbarber@y7mail.com> | 2020-05-20 01:21:51 +1000 |
commit | d07979218ea80c58e64148d9638ed3e6195ff6ed (patch) | |
tree | def34d24f16923e8a05fc652e847240d8eb16865 /src/directed_graphs.adb | |
parent | 65c9afbdc7daf588aaff505b2c148c4218f231d5 (diff) |
Initial unit tests
Diffstat (limited to 'src/directed_graphs.adb')
-rw-r--r-- | src/directed_graphs.adb | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/directed_graphs.adb b/src/directed_graphs.adb index 8b59051..4b9e823 100644 --- a/src/directed_graphs.adb +++ b/src/directed_graphs.adb @@ -974,10 +974,8 @@ package body Directed_Graphs is is use type Node_Maps.Cursor; begin - if Impl.Checks and then Position.Container = null then - raise Constraint_Error with "Graph does not exist"; - end if; - if Position.Place = Node_Maps.No_Element or else + if Position.Container = null or else + Position.Place = Node_Maps.No_Element or else not Position.Container.Contains (Node_Maps.Key (Position.Place)) then return No_Node; @@ -2568,7 +2566,7 @@ package body Directed_Graphs is end if; end loop; raise Constraint_Error with "No unused nodes available"; - return Extended_Node_ID_Type'First; + return Node_ID_Type'First; end Unused; function Unused |