From ecc8a59445eebba8d99f69f4db82ecfe221592b6 Mon Sep 17 00:00:00 2001
From: Erwan Jahier <jahier@imag.fr>
Date: Fri, 13 Jun 2014 17:01:14 +0200
Subject: [PATCH] Soc2c : soc ctx were still not in the good order. Sigh.

test: 203->198 failures
---
 src/soc2c.ml      |  7 +++++--
 test/lus2lic.sum  | 18 +++++++++---------
 test/lus2lic.time |  2 +-
 todo.org          |  4 ++++
 4 files changed, 19 insertions(+), 12 deletions(-)

diff --git a/src/soc2c.ml b/src/soc2c.ml
index 2c1a8649..94ba97ac 100644
--- a/src/soc2c.ml
+++ b/src/soc2c.ml
@@ -1,4 +1,4 @@
-(* Time-stamp: <modified the 13/06/2014 (at 16:23) by Erwan Jahier> *)
+(* Time-stamp: <modified the 13/06/2014 (at 16:55) by Erwan Jahier> *)
 
 
 (* let put (os: out_channel) (fmt:('a, unit, string, unit) format4) : 'a = *)
@@ -317,13 +317,16 @@ let (typedef : LicPrg.t -> Soc.tbl -> Soc.t -> string) =
       fun (acc,visited) soc ->
         if KeySet.mem soc.key visited then (acc,visited) else
           let visited = KeySet.add soc.key visited in
-          let acc = (typedef_of_soc soc) ^ acc in
+          let acc,visited =
           List.fold_left
             (fun (acc,visited) (iname, sk) ->
               let soc = SocUtils.find_no_exc sk soc_tbl in
               soc_with_mem (acc,visited) soc
             )
             (acc,visited) soc.instances
+          in
+          let acc = acc ^ (typedef_of_soc soc) in
+          acc,visited
     in
     let soc_ctx_typedef_with = 
       if is_memory_less main_soc then "" else fst (soc_with_mem ("",visited) main_soc)
diff --git a/test/lus2lic.sum b/test/lus2lic.sum
index d5f2c813..f2e434dc 100644
--- a/test/lus2lic.sum
+++ b/test/lus2lic.sum
@@ -1,4 +1,4 @@
-Test Run By jahier on Fri Jun 13 16:25:12 2014
+Test Run By jahier on Fri Jun 13 17:01:22 2014
 Native configuration is i686-pc-linux-gnu
 
 		=== lus2lic tests ===
@@ -100,7 +100,7 @@ PASS: ./lus2lic {-ec -o /tmp/lucky.ec should_work/lucky.lus}
 PASS: ./myec2c {-o /tmp/lucky.c /tmp/lucky.ec}
 PASS: ../utils/test_lus2lic_no_node should_work/lucky.lus
 PASS: ./lus2lic {-2c should_work/lucky.lus -n lucky}
-FAIL: Check that the generated C code compiles  : gcc lucky_lucky.c lucky_lucky_loop.c 
+PASS: gcc lucky_lucky.c lucky_lucky_loop.c 
 PASS: ./lus2lic {-o /tmp/heater_control.lic should_work/heater_control.lus}
 PASS: ./lus2lic {-ec -o /tmp/heater_control.ec should_work/heater_control.lus}
 PASS: ./myec2c {-o /tmp/heater_control.c /tmp/heater_control.ec}
@@ -118,7 +118,7 @@ PASS: ./lus2lic {-ec -o /tmp/cminus.ec should_work/cminus.lus}
 PASS: ./myec2c {-o /tmp/cminus.c /tmp/cminus.ec}
 PASS: ../utils/test_lus2lic_no_node should_work/cminus.lus
 PASS: ./lus2lic {-2c should_work/cminus.lus -n cminus}
-FAIL: Check that the generated C code compiles  : gcc cminus_cminus.c cminus_cminus_loop.c 
+PASS: gcc cminus_cminus.c cminus_cminus_loop.c 
 PASS: ./lus2lic {-o /tmp/rs.lic should_work/rs.lus}
 PASS: ./lus2lic {-ec -o /tmp/rs.ec should_work/rs.lus}
 PASS: ./myec2c {-o /tmp/rs.c /tmp/rs.ec}
@@ -608,7 +608,7 @@ PASS: ./lus2lic {-ec -o /tmp/mouse.ec should_work/mouse.lus}
 PASS: ./myec2c {-o /tmp/mouse.c /tmp/mouse.ec}
 PASS: ../utils/test_lus2lic_no_node should_work/mouse.lus
 PASS: ./lus2lic {-2c should_work/mouse.lus -n mouse}
-FAIL: Check that the generated C code compiles  : gcc mouse_mouse.c mouse_mouse_loop.c 
+PASS: gcc mouse_mouse.c mouse_mouse_loop.c 
 PASS: ./lus2lic {-o /tmp/param_node3.lic should_work/param_node3.lus}
 PASS: ./lus2lic {-ec -o /tmp/param_node3.ec should_work/param_node3.lus}
 PASS: ./myec2c {-o /tmp/param_node3.c /tmp/param_node3.ec}
@@ -932,7 +932,7 @@ PASS: ./lus2lic {-ec -o /tmp/stopwatch.ec should_work/stopwatch.lus}
 PASS: ./myec2c {-o /tmp/stopwatch.c /tmp/stopwatch.ec}
 PASS: ../utils/test_lus2lic_no_node should_work/stopwatch.lus
 PASS: ./lus2lic {-2c should_work/stopwatch.lus -n stopwatch}
-FAIL: Check that the generated C code compiles  : gcc stopwatch_stopwatch.c stopwatch_stopwatch_loop.c 
+PASS: gcc stopwatch_stopwatch.c stopwatch_stopwatch_loop.c 
 PASS: ./lus2lic {-o /tmp/test_condact.lic should_work/test_condact.lus}
 PASS: ./lus2lic {-ec -o /tmp/test_condact.ec should_work/test_condact.lus}
 PASS: ./myec2c {-o /tmp/test_condact.c /tmp/test_condact.ec}
@@ -1350,7 +1350,7 @@ PASS: ./lus2lic {-ec -o /tmp/poussoir.ec should_work/poussoir.lus}
 PASS: ./myec2c {-o /tmp/poussoir.c /tmp/poussoir.ec}
 PASS: ../utils/test_lus2lic_no_node should_work/poussoir.lus
 PASS: ./lus2lic {-2c should_work/poussoir.lus -n poussoir}
-FAIL: Check that the generated C code compiles  : gcc poussoir_poussoir.c poussoir_poussoir_loop.c 
+PASS: gcc poussoir_poussoir.c poussoir_poussoir_loop.c 
 PASS: ./lus2lic {-o /tmp/SWITCH1.lic should_work/SWITCH1.lus}
 PASS: ./lus2lic {-ec -o /tmp/SWITCH1.ec should_work/SWITCH1.lus}
 PASS: ./myec2c {-o /tmp/SWITCH1.c /tmp/SWITCH1.ec}
@@ -1479,9 +1479,9 @@ XPASS: Test bad programs (semantics): lus2lic {-o /tmp/bug.lic should_fail/seman
 
 		=== lus2lic Summary ===
 
-# of expected passes		1206
-# of unexpected failures	203
+# of expected passes		1211
+# of unexpected failures	198
 # of unexpected successes	21
 # of expected failures		37
-testcase ./lus2lic.tests/non-reg.exp completed in 121 seconds
+testcase ./lus2lic.tests/non-reg.exp completed in 118 seconds
 testcase ./lus2lic.tests/progression.exp completed in 0 seconds
diff --git a/test/lus2lic.time b/test/lus2lic.time
index efbe1164..8501891b 100644
--- a/test/lus2lic.time
+++ b/test/lus2lic.time
@@ -1,2 +1,2 @@
-testcase ./lus2lic.tests/non-reg.exp completed in 121 seconds
+testcase ./lus2lic.tests/non-reg.exp completed in 118 seconds
 testcase ./lus2lic.tests/progression.exp completed in 0 seconds
diff --git a/todo.org b/todo.org
index 74ae10dd..88c2aeb0 100644
--- a/todo.org
+++ b/todo.org
@@ -39,6 +39,10 @@ oops: lus2lic internal error
  when compiling lustre program should_work/simple.lus
 
 
+* lus2lic -2C
+** TODO Ca plante si un identificateur lustre se nomme double...
+   - State "TODO"       from ""           [2014-06-13 Fri 16:59]
+
 * Packages, modeles, etc.
 ** STARTED Il ne detecte plus les erreurs de type lors d'instanciation de noeuds
    - State "STARTED"    from "TODO"       [2013-01-28 Mon 17:02]
-- 
GitLab