From: Jérémie Astor Date: Wed, 6 Jan 2021 22:58:13 +0000 (+0100) Subject: :art: update tests X-Git-Tag: nightly~1049 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=60b23c0f99c16e9f80c250709e32473a4e366f1a;p=gwion.git :art: update tests --- diff --git a/tests/plug/array.c b/tests/plug/array.c index b76f5f0b..7fe9ed0d 100644 --- a/tests/plug/array.c +++ b/tests/plug/array.c @@ -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")) diff --git a/tests/plug/class_template.c b/tests/plug/class_template.c index 4a22db45..f0699abd 100644 --- a/tests/plug/class_template.c +++ b/tests/plug/class_template.c @@ -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; } diff --git a/tests/plug/class_template_invalid.c b/tests/plug/class_template_invalid.c index 4b3e6fbc..350ad7c6 100644 --- a/tests/plug/class_template_invalid.c +++ b/tests/plug/class_template_invalid.c @@ -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; } diff --git a/tests/plug/coverage.c b/tests/plug/coverage.c index ccb769cd..2b4635e4 100644 --- a/tests/plug/coverage.c +++ b/tests/plug/coverage.c @@ -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; diff --git a/tests/plug/fptr.c b/tests/plug/fptr.c index 05ce1e88..50811bd4 100644 --- a/tests/plug/fptr.c +++ b/tests/plug/fptr.c @@ -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; } diff --git a/tests/plug/func_fail4.c b/tests/plug/func_fail4.c index 31a87811..fca1a108 100644 --- a/tests/plug/func_fail4.c +++ b/tests/plug/func_fail4.c @@ -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; } diff --git a/tests/plug/global_var.c b/tests/plug/global_var.c index e9487b60..de157f0d 100644 --- a/tests/plug/global_var.c +++ b/tests/plug/global_var.c @@ -11,11 +11,11 @@ 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; } diff --git a/tests/plug/invalid_type1.c b/tests/plug/invalid_type1.c index 879b6f65..ed294aa7 100644 --- a/tests/plug/invalid_type1.c +++ b/tests/plug/invalid_type1.c @@ -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; } diff --git a/tests/plug/invalid_type2.c b/tests/plug/invalid_type2.c index bc2061fc..fd7cf9d5 100644 --- a/tests/plug/invalid_type2.c +++ b/tests/plug/invalid_type2.c @@ -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; } diff --git a/tests/plug/invalid_type3.c b/tests/plug/invalid_type3.c index 18728785..4d6ae887 100644 --- a/tests/plug/invalid_type3.c +++ b/tests/plug/invalid_type3.c @@ -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; } diff --git a/tests/plug/static_string.c b/tests/plug/static_string.c index af57b7cb..3a5177ea 100644 --- a/tests/plug/static_string.c +++ b/tests/plug/static_string.c @@ -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; } diff --git a/tests/plug/str2list_fail.c b/tests/plug/str2list_fail.c index ddca56cb..3205ab32 100644 --- a/tests/plug/str2list_fail.c +++ b/tests/plug/str2list_fail.c @@ -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; } diff --git a/tests/plug/struct.c b/tests/plug/struct.c index 5c8d1a21..9fa4767e 100644 --- a/tests/plug/struct.c +++ b/tests/plug/struct.c @@ -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;