From b76489ad7c96eea0f36eafbd8edeea986c9c1a92 Mon Sep 17 00:00:00 2001
From: Erwan Jahier <jahier@imag.fr>
Date: Fri, 10 Jul 2015 14:25:16 +0200
Subject: [PATCH] Fix the bug detected in the previous commit where type
 instance were not propagated in package obtained from a model instance.

---
 src/lic2soc.ml   |  6 +++---
 test/lus2lic.sum | 40 +++++++++++++++++++++-------------------
 2 files changed, 24 insertions(+), 22 deletions(-)

diff --git a/src/lic2soc.ml b/src/lic2soc.ml
index b3bafe4a..8cbcd9aa 100644
--- a/src/lic2soc.ml
+++ b/src/lic2soc.ml
@@ -1,4 +1,4 @@
-(** Time-stamp: <modified the 10/07/2015 (at 14:09) by Erwan Jahier> *)
+(** Time-stamp: <modified the 10/07/2015 (at 14:12) by Erwan Jahier> *)
 
 (* XXX ce module est mal écrit. A reprendre. (R1) *)
  
@@ -50,8 +50,8 @@ let rec lic_to_data_type: (Lic.type_ -> Data.t) =
     Data.Struct(id, List.map trans_field fl)
   )
   | Lic.Array_type_eff(ty,i) -> Data.Array(lic_to_data_type ty,i)
-  | Lic.Abstract_type_eff (id, t) -> 
-     Data.Alias(Lv6Id.string_of_long id,lic_to_data_type t) 
+  | Lic.Abstract_type_eff (id, t) -> lic_to_data_type t
+  (*     Data.Alias(Lv6Id.string_of_long id,lic_to_data_type t) *)
 
   | Lic.TypeVar Lic.Any -> Data.Alpha 0
   | Lic.TypeVar Lic.AnyNum -> 
diff --git a/test/lus2lic.sum b/test/lus2lic.sum
index 9cf28b38..1856a29c 100644
--- a/test/lus2lic.sum
+++ b/test/lus2lic.sum
@@ -1,5 +1,5 @@
 ==> lus2lic0.sum <==
-Test Run By jahier on Fri Jul 10 14:09:55 
+Test Run By jahier on Fri Jul 10 14:13:50 
 Native configuration is x86_64-unknown-linux-gnu
 
 		=== lus2lic0 tests ===
@@ -64,7 +64,7 @@ XFAIL: Test bad programs (assert): test_lus2lic_no_node should_fail/assert/lecte
 XFAIL: Test bad programs (assert): test_lus2lic_no_node should_fail/assert/s.lus
 
 ==> lus2lic1.sum <==
-Test Run By jahier on Fri Jul 10 14:09:53 
+Test Run By jahier on Fri Jul 10 14:13:51 
 Native configuration is x86_64-unknown-linux-gnu
 
 		=== lus2lic1 tests ===
@@ -396,7 +396,7 @@ PASS: gcc -o multipar.exec multipar_multipar.c multipar_multipar_loop.c
 PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c multipar.lus  {}
 
 ==> lus2lic2.sum <==
-Test Run By jahier on Fri Jul 10 14:10:43 
+Test Run By jahier on Fri Jul 10 14:14:06 
 Native configuration is x86_64-unknown-linux-gnu
 
 		=== lus2lic2 tests ===
@@ -473,7 +473,7 @@ PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c nc9.lus  {}
 PASS: ./lus2lic  {-2c nested.lus -n nested}
 PASS: gcc -o nested.exec nested_nested.c nested_nested_loop.c 
 PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c nested.lus  {}
-FAIL: Generate c code  : ./lus2lic  {-2c newpacks.lus -n newpacks}
+PASS: ./lus2lic  {-2c newpacks.lus -n newpacks}
 PASS: ./lus2lic  {-2c noAlarm.lus -n noAlarm}
 PASS: gcc -o noAlarm.exec noAlarm_noAlarm.c noAlarm_noAlarm_loop.c 
 PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c noAlarm.lus  {}
@@ -513,11 +513,11 @@ PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c over3.lus  {}
 PASS: ./lus2lic  {-2c overload.lus -n overload}
 PASS: gcc -o overload.exec overload_overload.c overload_overload_loop.c 
 PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c overload.lus  {}
-FAIL: Generate c code  : ./lus2lic  {-2c p.lus -n p}
+PASS: ./lus2lic  {-2c p.lus -n p}
 PASS: ./lus2lic  {-2c pack1.lus -n pack1}
 PASS: ./lus2lic  {-2c packageTableau.lus -n packageTableau}
 PASS: ./lus2lic  {-2c packed_cst.lus -n packed_cst}
-FAIL: Generate c code  : ./lus2lic  {-2c packs.lus -n packs}
+PASS: ./lus2lic  {-2c packs.lus -n packs}
 PASS: ./lus2lic  {-2c param_node.lus -n param_node}
 PASS: gcc -o param_node.exec param_node_param_node.c param_node_param_node_loop.c 
 PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c param_node.lus  {}
@@ -632,7 +632,7 @@ PASS: gcc -o testCA.exec testCA_testCA.c testCA_testCA_loop.c
 PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c testCA.lus  {}
 PASS: ./lus2lic  {-2c testCapt.lus -n testCapt}
 PASS: ./lus2lic  {-2c testPilote.lus -n testPilote}
-FAIL: Generate c code  : ./lus2lic  {-2c test_Int.lus -n test_Int}
+PASS: ./lus2lic  {-2c test_Int.lus -n test_Int}
 PASS: ./lus2lic  {-2c test_arrow.lus -n test_arrow}
 PASS: gcc -o test_arrow.exec test_arrow_test_arrow.c test_arrow_test_arrow_loop.c 
 PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c test_arrow.lus  {}
@@ -733,7 +733,7 @@ PASS: gcc -o zzz2.exec zzz2_zzz2.c zzz2_zzz2_loop.c
 PASS: /home/jahier/lus2lic/test/../utils/compare_exec_and_2c zzz2.lus  {}
 
 ==> lus2lic3.sum <==
-Test Run By jahier on Fri Jul 10 14:09:57 
+Test Run By jahier on Fri Jul 10 14:14:53 
 Native configuration is x86_64-unknown-linux-gnu
 
 		=== lus2lic3 tests ===
@@ -1235,7 +1235,7 @@ PASS: ./myec2c {-o multipar.c multipar.ec}
 PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node multipar.lus {}
 
 ==> lus2lic4.sum <==
-Test Run By jahier on Fri Jul 10 14:09:53 
+Test Run By jahier on Fri Jul 10 14:15:06 
 Native configuration is x86_64-unknown-linux-gnu
 
 		=== lus2lic4 tests ===
@@ -1730,8 +1730,8 @@ PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node zzz2.lus {}
 
 		=== lus2lic2 Summary ===
 
-# of expected passes		317
-# of unexpected failures	8
+# of expected passes		321
+# of unexpected failures	4
 
 ==> lus2lic3.sum <==
 
@@ -1747,13 +1747,15 @@ PASS: /home/jahier/lus2lic/test/../utils/test_lus2lic_no_node zzz2.lus {}
 # of expected passes		462
 # of unexpected failures	5
 ===============================
-# Total number of failures: 29
-lus2lic0.log:testcase ./lus2lic.tests/test0.exp completed in 0 seconds
-lus2lic1.log:testcase ./lus2lic.tests/test1.exp completed in 17 seconds
-lus2lic2.log:testcase ./lus2lic.tests/test2.exp completed in 50 seconds
-lus2lic3.log:testcase ./lus2lic.tests/test3.exp completed in 15 seconds
-lus2lic4.log:testcase ./lus2lic.tests/test4.exp completed in 48 seconds
+# Total number of failures: 25
+lus2lic0.log:testcase ./lus2lic.tests/test0.exp completed in 1 seconds
+lus2lic1.log:testcase ./lus2lic.tests/test1.exp completed in 15 seconds
+lus2lic2.log:testcase ./lus2lic.tests/test2.exp completed in 47 seconds
+lus2lic3.log:testcase ./lus2lic.tests/test3.exp completed in 13 seconds
+lus2lic4.log:testcase ./lus2lic.tests/test4.exp completed in 47 seconds
 * Ref time: 
+0.04user 0.02system 2:03.11elapsed 0%CPU (0avgtext+0avgdata 5020maxresident)k
+0inputs+0outputs (0major+5526minor)pagefaults 0swaps
 * Quick time (-j 4):
-0.05user 0.02system 1:40.88elapsed 0%CPU (0avgtext+0avgdata 5032maxresident)k
-0inputs+0outputs (0major+5545minor)pagefaults 0swaps
+0.02user 0.04system 0:56.00elapsed 0%CPU (0avgtext+0avgdata 5028maxresident)k
+0inputs+0outputs (0major+5587minor)pagefaults 0swaps
-- 
GitLab