From 69e9cde3fb28e7038ec86b4c258f5cb9e52a49c9 Mon Sep 17 00:00:00 2001 From: Maximilien Colange Date: Mon, 29 Feb 2016 14:37:32 +0100 Subject: [PATCH] Update test compiled test to match the new interface. --- tests/compiled.ml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/tests/compiled.ml b/tests/compiled.ml index 6159a78..9ee4ff9 100644 --- a/tests/compiled.ml +++ b/tests/compiled.ml @@ -12,11 +12,15 @@ struct type state = int type ta = { - clocks : Varcontext.VarContext.t; init : state; + clocks : string array; } - let clocks t = t.clocks + (* /!\ clocks are numbered from 1 to nb_clocks *) + let nb_clocks t = (Array.length t.clocks) + let string_of_clock t c = + assert(c >= 1 && c <= (nb_clocks t)); + t.clocks.(c-1) let initial_state t = t.init @@ -37,18 +41,18 @@ struct let rate_of_state _ _ = 1 let lubounds t s = - Array.make (Varcontext.VarContext.size t.clocks) 10, - Array.make (Varcontext.VarContext.size t.clocks) 10 + Array.make (nb_clocks t) 10, + Array.make (nb_clocks t) 10 let global_mbounds t = - Array.make (Varcontext.VarContext.size t.clocks) 10 + Array.make (nb_clocks t) 10 let model = - let cl = Varcontext.VarContext.create () in - let _ = Varcontext.VarContext.add cl "c0" in (); + let cl = Array.make 1 "" in + cl.(0) <- "c0"; { - clocks = cl; init = 0; + clocks = cl; } let string_of_state _ _ = "state" -- 2.24.1