]> Nishi Git Mirror - gwion.git/commitdiff
:art: update tests
authorJérémie Astor <fennecdjay@gmail.com>
Wed, 6 Jan 2021 22:58:13 +0000 (23:58 +0100)
committerJérémie Astor <fennecdjay@gmail.com>
Wed, 6 Jan 2021 22:58:13 +0000 (23:58 +0100)
13 files changed:
tests/plug/array.c
tests/plug/class_template.c
tests/plug/class_template_invalid.c
tests/plug/coverage.c
tests/plug/fptr.c
tests/plug/func_fail4.c
tests/plug/global_var.c
tests/plug/invalid_type1.c
tests/plug/invalid_type2.c
tests/plug/invalid_type3.c
tests/plug/static_string.c
tests/plug/str2list_fail.c
tests/plug/struct.c

index b76f5f0b81386bc211790868bd0bc922d983331a..7fe9ed0dd1903c891f38181bee7fd332c443b193 100644 (file)
@@ -14,7 +14,7 @@ MFUN(test_mfun){}
 GWION_IMPORT(array_test) {
   GWI_OB(gwi_class_ini(gwi, "ArrayTest", NULL))
   GWI_BB(gwi_item_ini(gwi, "int[]", "int_array"))
-  GWI_BB(gwi_item_end(gwi, 0, NULL)) // import array var
+  GWI_BB(gwi_item_end(gwi, 0, obj, NULL)) // import array var
   GWI_BB(gwi_func_ini(gwi, "float[][]", "f"))
   GWI_BB(gwi_func_end(gwi, test_mfun, ae_flag_none))
   GWI_BB(gwi_func_ini(gwi, "float[][]", "g"))
index 4a22db45f635c30fbbda0a87ea309aeee420526d..f0699abd7f7053c326d014495856e1c0d80c310a 100644 (file)
@@ -28,14 +28,14 @@ GWION_IMPORT(class_template) {
   GWI_OB(gwi_class_ini(gwi, ":[A,B]ClassTemplate", NULL))
   gwi_class_xtor(gwi, class_template_ctor, NULL);
     GWI_BB(gwi_item_ini(gwi, "A[]", "key"))
-    GWI_BB((o_map_key = gwi_item_end(gwi, ae_flag_none, NULL)))
+    GWI_BB((o_map_key = gwi_item_end(gwi, ae_flag_none, obj, NULL)))
     GWI_BB(gwi_item_ini(gwi, "B[]", "value"))
-    GWI_BB((o_map_value = gwi_item_end(gwi, ae_flag_none, NULL)))
+    GWI_BB((o_map_value = gwi_item_end(gwi, ae_flag_none, obj, NULL)))
    GWI_BB(gwi_func_ini(gwi, "int", ":[C,D]test"))
    GWI_BB(gwi_func_end(gwi, (f_xfun)1, ae_flag_none))
 
   GWI_BB(gwi_class_end(gwi))
   GWI_BB(gwi_item_ini(gwi, ":[:[int]Ptr,int[]]ClassTemplate", "testObject"))
-  GWI_BB(gwi_item_end(gwi, ae_flag_none, NULL))
+  GWI_BB(gwi_item_end(gwi, ae_flag_none, obj, NULL))
   return GW_OK;
 }
index 4b3e6fbc394a0d3c9a44260e1c3916df8d25e8b7..350ad7c6e6048fdda51107b1ecca510a16f8c579 100644 (file)
@@ -17,14 +17,14 @@ static m_int o_map_value;
 GWION_IMPORT(class_template) {
   GWI_OB(gwi_class_ini(gwi, "ClassTemplate:[A,B]", NULL))
     GWI_BB(gwi_item_ini(gwi, "A[]", "key"))
-    GWI_BB((o_map_key = gwi_item_end(gwi, ae_flag_none, NULL)))
+    GWI_BB((o_map_key = gwi_item_end(gwi, ae_flag_none, obj, NULL)))
     GWI_BB(gwi_item_ini(gwi, "B[]", "value"))
-    GWI_BB((o_map_value = gwi_item_end(gwi, ae_flag_none, NULL)))
+    GWI_BB((o_map_value = gwi_item_end(gwi, ae_flag_none, obj, NULL)))
    GWI_BB(gwi_func_ini(gwi, "int", "test:[C,D]"))
    GWI_BB(gwi_func_end(gwi, (f_xfun)1, ae_flag_none))
 
   GWI_BB(gwi_class_end(gwi))
   GWI_BB(gwi_item_ini(gwi, "ClassTemplate:[:[int]Ptr,int[]]", "testObject"))
-  GWI_BB(gwi_item_end(gwi, ae_flag_none, NULL))
+  GWI_BB(gwi_item_end(gwi, ae_flag_none, obj, NULL))
   return GW_OK;
 }
index ccb769cd6b6ba9c48c35492ce955ef73c77a03df..2b4635e4c2e3b3b50988577110e8397263d6dddd 100644 (file)
@@ -19,24 +19,20 @@ GWION_IMPORT(coverage) {
   GWI_BB(gwi_func_ini(gwi, "float", "f"))
   GWI_BB(gwi_func_end(gwi, coverage_float, ae_flag_static))
 
-  ALLOC_PTR(gwi->gwion->mp, i, m_uint, 5);
   GWI_BB(gwi_item_ini(gwi,"int", "s_i"))
-  GWI_BB(gwi_item_end(gwi, ae_flag_static, i))
+  GWI_BB(gwi_item_end(gwi, ae_flag_static, num, 5))
 
-  ALLOC_PTR(gwi->gwion->mp, f, m_float, 2.1);
   GWI_BB(gwi_item_ini(gwi,"int", "s_f"))
-  GWI_BB(gwi_item_end(gwi, ae_flag_static, (void*)f))
+  GWI_BB(gwi_item_end(gwi, ae_flag_static, fnum, 2.1))
 
-  ALLOC_PTR(gwi->gwion->mp, ci, m_uint, 5);
   GWI_BB(gwi_item_ini(gwi,"int", "sc_i"))
-  GWI_BB(gwi_item_end(gwi, ae_flag_static | ae_flag_const, ci))
+  GWI_BB(gwi_item_end(gwi, ae_flag_static | ae_flag_const, num, 5))
 
-  ALLOC_PTR(gwi->gwion->mp, cf, m_float, 2.1);
   GWI_BB(gwi_item_ini(gwi,"float", "sc_f"))
-  GWI_BB(gwi_item_end(gwi, ae_flag_static | ae_flag_const, (void*)cf))
+  GWI_BB(gwi_item_end(gwi, ae_flag_static | ae_flag_const, fnum, 2.1))
 
   GWI_BB(gwi_item_ini(gwi,"int[][]", "test_array"))
-  GWI_BB(gwi_item_end(gwi, ae_flag_none, NULL))
+  GWI_BB(gwi_item_end(gwi, ae_flag_none, obj, NULL))
 
   GWI_BB(gwi_class_end(gwi))
   return GW_OK;
index 05ce1e88e0c14fab4e47836d7f4c69158c54aeca..50811bd4ee4e7af304e97f748fcabfe655dd986f 100644 (file)
@@ -19,7 +19,7 @@ GWION_IMPORT(typedef_test) {
     GWI_BB(gwi_func_ini(gwi, "void", "test_func"))
     GWI_BB(gwi_func_end(gwi, test_func, ae_flag_static))
     GWI_BB(gwi_item_ini(gwi, "PtrType", "ptr"))
-    GWI_BB(gwi_item_end(gwi, ae_flag_static, NULL))
+    GWI_BB(gwi_item_end(gwi, ae_flag_static, obj, NULL))
   GWI_BB(gwi_class_end(gwi))
   return GW_OK;
 }
index 31a87811e88d23c5668969ba1f2424812427e2cb..fca1a1080935c0b06e2d7220077778f939b23926 100644 (file)
@@ -12,6 +12,6 @@
 GWION_IMPORT(too_many_args) {
   GWI_BB(gwi_func_ini(gwi, "Ptr:[int]", "test:[A]"))
   GWI_BB(gwi_func_arg(gwi, "int", "i[][]"))
-  GWI_BB(gwi_item_end(gwi, ae_flag_none, NULL))
+  GWI_BB(gwi_item_end(gwi, ae_flag_none, num, 0))
   return GW_OK;
 }
index e9487b604a00122a7fdfc613e818e4418dfccfa1..de157f0dc5f72ad487ea02c15de17a2486cde930 100644 (file)
 
 
 GWION_IMPORT(global_var_test) {
-  const M_Object obj = new_object(gwi->gwion->mp, NULL, gwi->gwion->type[et_string]);
-  STRING(obj) = s_name(insert_symbol(gwi->gwion->st, "test"));
+  const M_Object o = new_object(gwi->gwion->mp, NULL, gwi->gwion->type[et_string]);
+  STRING(o) = s_name(insert_symbol(gwi->gwion->st, "test"));
   GWI_BB(gwi_item_ini(gwi,"string", "i"))
-  GWI_BB(gwi_item_end(gwi, 0, obj))
+  GWI_BB(gwi_item_end(gwi, 0, obj, o))
   GWI_BB(gwi_item_ini(gwi,"float", "f"))
-  GWI_BB(gwi_item_end(gwi, 0, (m_float)2.1))
+  GWI_BB(gwi_item_end(gwi, 0, fnum, 2.1))
   return GW_OK;
 }
index 879b6f6528e780b8b81f638af2c7a48a913f4047..ed294aa7abe7e2ad8f56e82cecb13c2e85055db5 100644 (file)
@@ -11,7 +11,7 @@
 GWION_IMPORT(invalid_type1_test) {
   GWI_OB(gwi_class_ini(gwi, "invalid_var_type", NULL))
   GWI_BB(gwi_item_ini(gwi,"i|nt", "test"))
-  GWI_BB(gwi_item_end(gwi, 0, NULL))
+  GWI_BB(gwi_item_end(gwi, 0, num, 0))
   GWI_BB(gwi_class_end(gwi))
   return GW_OK;
 }
index bc2061fcda8367786f32c99ea7ff9148366a4023..fd7cf9d5e3bcfa1b57c80d45e1624a943a336ecf 100644 (file)
@@ -11,7 +11,7 @@
 GWION_IMPORT(invalid_type2_test) {
   GWI_OB(gwi_class_ini(gwi, "invalid_var_type", NULL))
   GWI_BB(gwi_item_ini(gwi,".int", "test"))
-  GWI_BB(gwi_item_end(gwi, 0, NULL))
+  GWI_BB(gwi_item_end(gwi, 0, num, 0))
   GWI_BB(gwi_class_end(gwi))
   return GW_OK;
 }
index 18728785a4601a9c6565dbe73e67a9d6bd66cd88..4d6ae8870b015ed602a2e6acba1fffde78548d2e 100644 (file)
@@ -11,7 +11,7 @@
 GWION_IMPORT(invalid_type3_test) {
   GWI_OB(gwi_class_ini(gwi, "InvalidVarType", NULL))
   GWI_BB(gwi_item_ini(gwi,".int", "test"))
-  GWI_BB(gwi_item_end(gwi, 0, NULL))
+  GWI_BB(gwi_item_end(gwi, 0, num, 0))
   GWI_BB(gwi_class_end(gwi))
   return GW_OK;
 }
index af57b7cbbbb174fe19e7504b2c1c117d5318b4a2..3a5177ea2fc15f70eabb01b749f6aebf0684f2d1 100644 (file)
@@ -11,9 +11,9 @@
 #include "gwi.h"
 
 GWION_IMPORT(static_string_test) {
-  const M_Object obj = new_object(gwi->gwion->mp, NULL, gwi->gwion->type[et_string]);
-  STRING(obj) = s_name(insert_symbol(gwi->gwion->st, "test static string"));
+  const M_Object o = new_object(gwi->gwion->mp, NULL, gwi->gwion->type[et_string]);
+  STRING(o) = s_name(insert_symbol(gwi->gwion->st, "test static string"));
   GWI_BB(gwi_item_ini(gwi, "string", "self"))
-  GWI_BB(gwi_item_end(gwi, ae_flag_global, obj))
+  GWI_BB(gwi_item_end(gwi, ae_flag_global, obj, o))
   return GW_OK;
 }
index ddca56cb4444fc231988cbf174c3ccc7c574ee8b..3205ab325dce1174446cc8101042603a731fdc11 100644 (file)
@@ -12,6 +12,6 @@
 
 GWION_IMPORT(global_var_test) {
   GWI_BB(gwi_item_ini(gwi,"SoemClass.child", "i"))
-  GWI_BB(gwi_item_end(gwi, ae_flag_none, NULL))
+  GWI_BB(gwi_item_end(gwi, ae_flag_none, num, 0))
   return GW_OK;
 }
index 5c8d1a211128d40d4ee8ae78befbf729b3d5ae07..9fa4767e2cc7e0fc496bd295b3531a07c79ddc39 100644 (file)
@@ -19,24 +19,19 @@ GWION_IMPORT(coverage) {
   GWI_BB(gwi_func_ini(gwi, "float", "f"))
   GWI_BB(gwi_func_end(gwi, coverage_float, ae_flag_static))
 
-  ALLOC_PTR(gwi->gwion->mp, i, m_uint, 5);
-  GWI_BB(gwi_item_ini(gwi,"int", "s_i"))
-  GWI_BB(gwi_item_end(gwi, ae_flag_static, i))
+  GWI_BB(gwi_item_end(gwi, ae_flag_static, num, 5))
 
-  ALLOC_PTR(gwi->gwion->mp, f, m_float, 2.1);
   GWI_BB(gwi_item_ini(gwi,"int", "s_f"))
-  GWI_BB(gwi_item_end(gwi, ae_flag_static, (void*)f))
+  GWI_BB(gwi_item_end(gwi, ae_flag_static, fnum, 2.1))
 
-  ALLOC_PTR(gwi->gwion->mp, ci, m_uint, 5);
   GWI_BB(gwi_item_ini(gwi,"int", "sc_i"))
-  GWI_BB(gwi_item_end(gwi, ae_flag_static | ae_flag_const, ci))
+  GWI_BB(gwi_item_end(gwi, ae_flag_static | ae_flag_const, num, 5))
 
-  ALLOC_PTR(gwi->gwion->mp, cf, m_float, 2.1);
   GWI_BB(gwi_item_ini(gwi,"float", "sc_f"))
-  GWI_BB(gwi_item_end(gwi, ae_flag_static | ae_flag_const, (void*)cf))
+  GWI_BB(gwi_item_end(gwi, ae_flag_static | ae_flag_const, fnum, 2.1))
 
   GWI_BB(gwi_item_ini(gwi,"int[][]", "test_array"))
-  GWI_BB(gwi_item_end(gwi, ae_flag_none, NULL))
+  GWI_BB(gwi_item_end(gwi, ae_flag_none, obj, NULL))
 
   GWI_BB(gwi_struct_end(gwi))
   return GW_OK;