diff options
Diffstat (limited to 'test/vytree_load_test.ml')
-rw-r--r-- | test/vytree_load_test.ml | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/test/vytree_load_test.ml b/test/vytree_load_test.ml index b56e130..cd8cc8d 100644 --- a/test/vytree_load_test.ml +++ b/test/vytree_load_test.ml @@ -1,3 +1,8 @@ +[@@@ocaml.warning "-27"] + +module VT = Vyos1x.Vytree +module VL = Vyos1x.Vylist + let max = 9999 (* Path length *) @@ -15,16 +20,16 @@ let insert_full tree path data = | [] -> tree | p :: ps -> let basepath = basepath @ [p] in - let tree = Vytree.insert tree basepath data in + let tree = VT.insert tree basepath data in aux tree ps basepath data in - let existent_path = Vytree.get_existent_path tree path in - let rest = Vylist.complement path existent_path in + let existent_path = VT.get_existent_path tree path in + let rest = VL.complement path existent_path in aux tree rest existent_path () let rec add_many_children t n basepath data = if n >= 0 then - let t = Vytree.insert t (basepath @ [(string_of_int n)]) () in + let t = VT.insert t (basepath @ [(string_of_int n)]) () in add_many_children t (n - 1) basepath data else t @@ -39,13 +44,13 @@ let rec do_inserts tree child n = do_inserts tree child (n - 1) else tree -let tree = Vytree.make () "root" +let tree = VT.make () "root" (* Add a hundred children *) let tree = add_many_children tree max_children [] () (* Use the last child to ensure that the child list is traversed to the end every time *) -let name = List.nth (Vytree.list_children tree) (max_children - 1) +let name = List.nth (VT.list_children tree) (max_children - 1) let _ = do_inserts tree name max_paths |