From 07d5b287ce0c88b33765991cf4f53edb76d4a0cd Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Wed, 9 Oct 2019 14:10:17 +0200 Subject: [PATCH] :art: Correct locations in import --- include/env.h | 2 +- include/import.h | 13 ++-- src/emit/emit.c | 8 +-- src/gwion.c | 2 +- src/lib/engine.c | 22 +++---- src/lib/import.c | 46 +++++++------ src/parse/check.c | 2 +- tests/import/array.c | 18 ++--- tests/import/begin_class.c | 6 +- tests/import/callback.c | 14 ++-- tests/import/class_template.c | 14 ++-- tests/import/coverage.c | 66 +++++++++---------- tests/import/empty_union.c | 4 +- tests/import/end_class.c | 2 +- tests/import/enum.c | 102 ++++++++++++++--------------- tests/import/extend_array.c | 8 +-- tests/import/extend_event.c | 8 +-- tests/import/extend_pair.c | 12 ++-- tests/import/fptr.c | 22 +++---- tests/import/global_func.c | 6 +- tests/import/global_var.c | 4 +- tests/import/invalid_arg.c | 12 ++-- tests/import/invalid_array.c | 36 +++++----- tests/import/invalid_func.c | 10 +-- tests/import/invalid_type1.c | 10 +-- tests/import/invalid_type2.c | 10 +-- tests/import/invalid_type3.c | 10 +-- tests/import/op_already_imported.c | 4 +- tests/import/static_string.c | 4 +- tests/import/template_arg.c | 12 ++-- tests/import/union.c | 8 +-- tests/import/variadic.c | 14 ++-- 32 files changed, 259 insertions(+), 252 deletions(-) diff --git a/include/env.h b/include/env.h index 8f214540..313fa0de 100644 --- a/include/env.h +++ b/include/env.h @@ -50,6 +50,6 @@ ANN Type find_type(const Env, ID_List); ANN m_bool already_defined(const Env env, const Symbol s, const loc_t pos); ANN m_bool type_engine_check_prog(const Env, const Ast); ANN m_bool traverse_func_template(const Env, const Func_Def); -ANN ID_List str2list(const Env, const m_str path, m_uint* array_depth); +ANN ID_List str2list(const Env, const m_str path, m_uint* array_depth, const loc_t); ANN2(1,3) void env_err(const Env, const struct YYLTYPE *pos, const m_str fmt, ...); #endif diff --git a/include/import.h b/include/import.h index ac71a28b..ffc9992f 100644 --- a/include/import.h +++ b/include/import.h @@ -17,12 +17,12 @@ typedef struct Gwi_* Gwi; #define OP_CHECK(a) ANN Type a(const Env env NUSED, void* data NUSED, m_bool* mut NUSED) #define OP_EMIT(a) ANN Instr a(const Emitter emit NUSED, void* data NUSED) #ifdef GWION_BUILTIN -#define GWI_BB(a) (void)(a); -#define GWI_OB(a) (void)(a); +#define GWI_BB(a) { gwi_set_loc(gwi, __FILE__, __LINE__); (void)(a); } +#define GWI_OB(a) { gwi_set_loc(gwi, __FILE__, __LINE__); (void)(a); } #define GWION_IMPORT(a) ANN m_bool import_##a(const Gwi gwi) #else -#define GWI_BB(a) CHECK_BB(a) -#define GWI_OB(a) CHECK_OB(a) +#define GWI_BB(a) { gwi_set_loc(gwi, __FILE__, __LINE__); CHECK_BB(a) } +#define GWI_OB(a) { gwi_set_loc(gwi, __FILE__, __LINE__); CHECK_OB(a) } #define GWION_IMPORT(a) ANN m_bool import(const Gwi gwi) #endif #define ALLOC_PTR(p, a, b, c) b* a = (b*)_mp_calloc(p, sizeof(b)); *a = (b)c @@ -71,7 +71,7 @@ ANN m_int gwi_oper_add(const Gwi gwi, const opck); ANN m_int gwi_oper_emi(const Gwi gwi, const opem); ANN2(1) m_int gwi_oper_end(const Gwi gwi, const m_str op, const f_instr f); ANN m_int gwi_oper_cond(const Gwi, const m_str, const f_instr, const f_instr); -ANN Type_Decl* str2decl(const Env, const m_str, m_uint* depth); +ANN Type_Decl* str2decl(const Env, const m_str, m_uint* depth, const loc_t); OP_CHECK(opck_const_rhs); OP_CHECK(opck_unary_meta); @@ -86,7 +86,7 @@ OP_CHECK(opck_new); OP_EMIT(opem_basic_cast); OP_EMIT(opem_new); -ANN Type_List str2tl(const Env env, const m_str s, m_uint *depth); +ANN Type_List str2tl(const Env env, const m_str s, m_uint *depth, const loc_t); #define FREEARG(a) ANN void a(Instr instr NUSED, void *gwion NUSED) typedef void (*f_freearg)(Instr, void*); @@ -94,4 +94,5 @@ ANN void register_freearg(const Gwi, const f_instr, const f_freearg); ANN void gwi_reserve(const Gwi, const m_str); typedef struct SpecialId_* SpecialId; ANN void gwi_specialid(const Gwi gwi, const m_str id, const SpecialId); +ANN void gwi_set_loc(const Gwi, const m_str, const uint); #endif diff --git a/src/emit/emit.c b/src/emit/emit.c index 7d82d2aa..6d37b6b7 100644 --- a/src/emit/emit.c +++ b/src/emit/emit.c @@ -834,14 +834,14 @@ ANN static m_bool is_special(const Emitter emit, const Type t) { return GW_ERROR; } -ANN static Type_List tmpl_tl(const Env env, const m_str name) { +ANN static Type_List tmpl_tl(const Env env, const m_str name, const loc_t pos) { const m_str start = strchr(name, '<'); const m_str end = strchr(name, '@'); char c[strlen(name)]; strcpy(c, start + 2); c[strlen(start) - strlen(end) - 4] = '\0'; m_uint depth; - return str2tl(env, c, &depth); + return str2tl(env, c, &depth, pos); } ANN static inline m_bool traverse_emit_func_def(const Emitter emit, const Func_Def fdef) { @@ -870,7 +870,7 @@ static inline m_bool push_func_code(const Emitter emit, const Func f) { struct dottmpl_ *dt = mp_calloc(emit->gwion->mp, dottmpl); dt->name = s_name(insert_symbol(c)); dt->vt_index = f->def->base->tmpl->base; - dt->tl = tmpl_tl(emit->env, c); + dt->tl = tmpl_tl(emit->env, c, td_pos(f->def->base->td)); dt->base = f->def; instr->opcode = eOP_MAX; instr->m_val = (m_uint)dt; @@ -907,7 +907,7 @@ ANN static Instr get_prelude(const Emitter emit, const Func f) { char c[sz + 1]; memcpy(c, f->name, sz); c[sz] = '\0'; - dt->tl = tmpl_tl(emit->env, c); + dt->tl = tmpl_tl(emit->env, c, td_pos(f->def->base->td)); dt->name = s_name(insert_symbol(c)); dt->vt_index = f->def->base->tmpl->base; dt->base = f->def; diff --git a/src/gwion.c b/src/gwion.c index 6317124f..32d92a9b 100644 --- a/src/gwion.c +++ b/src/gwion.c @@ -116,7 +116,7 @@ ANN void gwion_end(const Gwion gwion) { ANN void env_err(const Env env, const struct YYLTYPE* pos, const m_str fmt, ...) { if(env->context && env->context->error) - return; + return; if(env->class_def) gw_err(_("in class: '%s'\n"), env->class_def->name); if(env->func) diff --git a/src/lib/engine.c b/src/lib/engine.c index d29ef4cc..81eec0ae 100644 --- a/src/lib/engine.c +++ b/src/lib/engine.c @@ -79,7 +79,7 @@ ANN static m_bool import_core_libs(const Gwi gwi) { const Type t_class = gwi_mk_type(gwi, "@Class", SZ_INT, NULL); gwi->gwion->type[et_class] = t_class; GWI_BB(gwi_add_type(gwi, t_class)) - CHECK_BB(gwi_gack(gwi, gwi->gwion->type[et_class], gack_class)) // not working yet + GWI_BB(gwi_gack(gwi, gwi->gwion->type[et_class], gack_class)) // not working yet gwi->gwion->type[et_class] = t_class; const Type t_undefined = gwi_mk_type(gwi, "@Undefined", SZ_INT, NULL); GWI_BB(gwi_set_global_type(gwi, t_undefined, et_undefined)) @@ -87,7 +87,7 @@ ANN static m_bool import_core_libs(const Gwi gwi) { GWI_BB(gwi_set_global_type(gwi, t_auto, et_auto)) SET_FLAG(t_class, abstract); const Type t_void = gwi_mk_type(gwi, "void", 0, NULL); - CHECK_BB(gwi_gack(gwi, t_void, gack_void)) + GWI_BB(gwi_gack(gwi, t_void, gack_void)) GWI_BB(gwi_set_global_type(gwi, t_void, et_void)) const Type t_null = gwi_mk_type(gwi, "@null", SZ_INT, NULL); GWI_BB(gwi_set_global_type(gwi, t_null, et_null)) @@ -102,16 +102,16 @@ ANN static m_bool import_core_libs(const Gwi gwi) { const Type t_gack = gwi_mk_type(gwi, "@Gack", SZ_INT, NULL); GWI_BB(gwi_set_global_type(gwi, t_gack, et_gack)) const Type t_int = gwi_mk_type(gwi, "int", SZ_INT, NULL); - CHECK_BB(gwi_gack(gwi, t_int, gack_int)) + GWI_BB(gwi_gack(gwi, t_int, gack_int)) GWI_BB(gwi_set_global_type(gwi, t_int, et_int)) const Type t_float = gwi_mk_type(gwi, "float", SZ_FLOAT, NULL); - CHECK_BB(gwi_gack(gwi, t_float, gack_float)) + GWI_BB(gwi_gack(gwi, t_float, gack_float)) GWI_BB(gwi_set_global_type(gwi, t_float, et_float)) const Type t_dur = gwi_mk_type(gwi, "dur", SZ_FLOAT, NULL); - CHECK_BB(gwi_gack(gwi, t_dur, gack_float)) + GWI_BB(gwi_gack(gwi, t_dur, gack_float)) GWI_BB(gwi_add_type(gwi, t_dur)) const Type t_time = gwi_mk_type(gwi, "time", SZ_FLOAT, NULL); - CHECK_BB(gwi_gack(gwi, t_time, gack_float)) + GWI_BB(gwi_gack(gwi, t_time, gack_float)) GWI_BB(gwi_add_type(gwi, t_time)) const Type t_now = gwi_mk_type(gwi, "@now", SZ_FLOAT, "time"); GWI_BB(gwi_add_type(gwi, t_now)) @@ -119,16 +119,16 @@ ANN static m_bool import_core_libs(const Gwi gwi) { gwi_specialid(gwi, "now", &spid); const Type t_complex = gwi_mk_type(gwi, "complex", SZ_COMPLEX , NULL); gwi->gwion->type[et_complex] = t_complex; - CHECK_BB(gwi_gack(gwi, t_complex, gack_complex)) + GWI_BB(gwi_gack(gwi, t_complex, gack_complex)) const Type t_polar = gwi_mk_type(gwi, "polar", SZ_COMPLEX , NULL); gwi->gwion->type[et_polar] = t_polar; - CHECK_BB(gwi_gack(gwi, t_polar, gack_polar)) + GWI_BB(gwi_gack(gwi, t_polar, gack_polar)) const Type t_vec3 = gwi_mk_type(gwi, "Vec3", SZ_VEC3, NULL); gwi->gwion->type[et_vec3] = t_vec3; - CHECK_BB(gwi_gack(gwi, t_vec3, gack_vec3)) + GWI_BB(gwi_gack(gwi, t_vec3, gack_vec3)) const Type t_vec4 = gwi_mk_type(gwi, "Vec4", SZ_VEC4, NULL); gwi->gwion->type[et_vec4] = t_vec4; - CHECK_BB(gwi_gack(gwi, t_vec4, gack_vec4)) + GWI_BB(gwi_gack(gwi, t_vec4, gack_vec4)) GWI_BB(import_object(gwi)) const Type t_union = gwi_mk_type(gwi, "@Union", SZ_INT, "Object"); gwi->gwion->type[et_union] = t_union; @@ -167,7 +167,7 @@ ANN m_bool type_engine_init(VM* vm, const Vector plug_dirs) { vm->gwion->env->name = "[builtin]"; struct YYLTYPE loc = {}; struct Gwi_ gwi = { .gwion=vm->gwion, .loc=&loc }; - GWI_BB(import_core_libs(&gwi)) + CHECK_BB(import_core_libs(&gwi)) vm->gwion->env->name = "[imported]"; for(m_uint i = 0; i < vector_size(plug_dirs); ++i) { m_bool (*import)(Gwi) = (m_bool(*)(Gwi))vector_at(plug_dirs, i); diff --git a/src/lib/import.c b/src/lib/import.c index 8ceae5df..b3d33d24 100644 --- a/src/lib/import.c +++ b/src/lib/import.c @@ -157,12 +157,13 @@ ANN static m_bool path_valid(const Env env, ID_List* list, const struct Path* p) return GW_OK; } -ANN /* static */ ID_List str2list(const Env env, const m_str path, m_uint* array_depth) { +ANN ID_List str2list(const Env env, const m_str path, + m_uint* array_depth, const loc_t pos) { const m_uint len = strlen(path); ID_List list = NULL; m_uint depth = 0; char curr[len + 1]; - struct Path p = { path, curr, len, { 1,1,1,1} }; + struct Path p = { path, curr, len, { pos->first_line, pos->first_column, pos->last_line, pos->last_column } }; memset(curr, 0, len + 1); while(p.len > 2 && path[p.len - 1] == ']' && path[p.len - 2] == '[') { @@ -203,7 +204,7 @@ ANN static m_bool mk_xtor(MemPool p, const Type type, const m_uint d, const ae_f ANN2(1,2) Type gwi_mk_type(const Gwi gwi NUSED, const m_str name, const m_uint size, const m_str parent_name) { m_uint depth; - const Type_Decl* td = parent_name ? str2decl(gwi->gwion->env, parent_name, &depth) : NULL; + const Type_Decl* td = parent_name ? str2decl(gwi->gwion->env, parent_name, &depth, gwi->loc) : NULL; const Type parent = td ? known_type(gwi->gwion->env, td) : NULL; const Type t = new_type(gwi->gwion->mp, 0, name, parent); t->size = size; @@ -325,7 +326,7 @@ ANN static void dl_var_release(MemPool p, const DL_Var* v) { ANN m_int gwi_item_ini(const Gwi gwi, const restrict m_str type, const restrict m_str name) { DL_Var* v = &gwi->var; memset(v, 0, sizeof(DL_Var)); - if(!(v->t.xid = str2list(gwi->gwion->env, type, &v->array_depth))) + if(!(v->t.xid = str2list(gwi->gwion->env, type, &v->array_depth, gwi->loc))) GWI_ERR_B(_(" ... during var import '%s.%s'."), gwi->gwion->env->class_def->name, name) v->var.xid = insert_symbol(gwi->gwion->st, name); return GW_OK; @@ -382,16 +383,16 @@ static Array_Sub make_dll_arg_list_array(MemPool p, Array_Sub array_sub, return array_sub; } -ANN /*static */ Type_List str2tl(const Env env, const m_str s, m_uint *depth) { - DECL_OO(Type_Decl*, td, = str2decl(env, s, depth)) +ANN Type_List str2tl(const Env env, const m_str s, m_uint *depth, const loc_t pos) { + DECL_OO(Type_Decl*, td, = str2decl(env, s, depth, pos)) td->array = make_dll_arg_list_array(env->gwion->mp, NULL, depth, 0); return new_type_list(env->gwion->mp, td, NULL); } -ANN Type_Decl* str2decl(const Env env, const m_str s, m_uint *depth) { +ANN Type_Decl* str2decl(const Env env, const m_str s, m_uint *depth, const loc_t pos) { m_uint i = 0; DECL_OO(m_str, type_name, = get_type_name(env, s, i++)) - DECL_OO(ID_List, id, = str2list(env, type_name, depth)) + DECL_OO(ID_List, id, = str2list(env, type_name, depth, pos)) Type_Decl* td = new_type_decl(env->gwion->mp, id); Type_List tmp = NULL; if(!td) { @@ -401,9 +402,9 @@ ANN Type_Decl* str2decl(const Env env, const m_str s, m_uint *depth) { while((type_name = get_type_name(env, s, i++))) { m_uint d = 0; if(!tmp) - td->types = tmp = str2tl(env, type_name, &d); + td->types = tmp = str2tl(env, type_name, &d, pos); else { - tmp->next = str2tl(env, type_name, &d); + tmp->next = str2tl(env, type_name, &d, pos); tmp = tmp->next; } } @@ -422,12 +423,12 @@ ANN static Arg_List make_dll_arg_list(const Gwi gwi, DL_Func * dl_fun) { Type_Decl* type_decl = NULL; DL_Value* arg = &dl_fun->args[i-1]; ID_List type_path2; - if(!(type_decl = str2decl(env, arg->type, &array_depth))) { + if(!(type_decl = str2decl(env, arg->type, &array_depth, gwi->loc))) { if(arg_list) free_arg_list(env->gwion->mp, arg_list); GWI_ERR_O(_(" ... at argument '%"UINT_F"'"), i + 1) } - if((type_path2 = str2list(env, arg->name, &array_depth2))) + if((type_path2 = str2list(env, arg->name, &array_depth2, gwi->loc))) free_id_list(env->gwion->mp, type_path2); if(array_depth && array_depth2) { free_type_decl(env->gwion->mp, type_decl); @@ -445,7 +446,7 @@ ANN static Arg_List make_dll_arg_list(const Gwi gwi, DL_Func * dl_fun) { ANN Type_Decl* import_td(const Gwi gwi, const m_str name) { const Env env = gwi->gwion->env; m_uint array_depth; - DECL_OO(const ID_List, type_path, = str2list(env, name, &array_depth)) + DECL_OO(const ID_List, type_path, = str2list(env, name, &array_depth, gwi->loc)) Type_Decl* type_decl = new_type_decl(env->gwion->mp, type_path); if(!type_decl) { free_id_list(env->gwion->mp, type_path); @@ -497,9 +498,9 @@ ANN m_int gwi_func_end(const Gwi gwi, const ae_flag flag) { return GW_OK; } -static Type get_type(const Env env, const m_str str) { +ANN2(1,3) static Type get_type(const Env env, const m_str str, const loc_t pos) { m_uint depth = 0; - const ID_List list = (str && str != (m_str)OP_ANY_TYPE) ? str2list(env, str, &depth) : NULL; + const ID_List list = (str && str != (m_str)OP_ANY_TYPE) ? str2list(env, str, &depth, pos) : NULL; const Type t = (str == (m_str) OP_ANY_TYPE) ? OP_ANY_TYPE : list ? find_type(env, list) : NULL; if(list) free_id_list(env->gwion->mp, list); @@ -509,9 +510,9 @@ static Type get_type(const Env env, const m_str str) { ANN2(1,2) static int import_op(const Gwi gwi, const DL_Oper* op, const f_instr f) { const Env env = gwi->gwion->env; - const Type lhs = op->lhs ? get_type(env, op->lhs) : NULL; - const Type rhs = op->rhs ? get_type(env, op->rhs) : NULL; - const Type ret = get_type(env, op->ret); + const Type lhs = op->lhs ? get_type(env, op->lhs, gwi->loc) : NULL; + const Type rhs = op->rhs ? get_type(env, op->rhs, gwi->loc) : NULL; + const Type ret = get_type(env, op->ret, gwi->loc); const struct Op_Import opi = { lhs, rhs, ret, op->ck, op->em, (uintptr_t)f, gwi->loc, op->op }; return add_op(gwi->gwion, &opi); @@ -562,7 +563,7 @@ ANN static Fptr_Def import_fptr(const Gwi gwi, DL_Func* dl_fun, ae_flag flag) { m_uint array_depth; ID_List type_path; Type_Decl* type_decl = NULL; - if(!(type_path = str2list(env, dl_fun->type, &array_depth)) || + if(!(type_path = str2list(env, dl_fun->type, &array_depth, gwi->loc)) || !(type_decl = new_type_decl(env->gwion->mp, type_path))) GWI_ERR_O(_(" ... during fptr import '%s' (type)."), dl_fun->name); const Arg_List args = make_dll_arg_list(gwi, dl_fun); @@ -612,7 +613,7 @@ ANN static Exp make_exp(const Gwi gwi, const m_str type, const m_str name) { ID_List id_list; m_uint array_depth; Array_Sub array = NULL; - CHECK_OO((id_list = str2list(env, type, &array_depth))) + CHECK_OO((id_list = str2list(env, type, &array_depth, gwi->loc))) if(array_depth) { array = new_array_sub(env->gwion->mp, NULL); array->depth = array_depth; @@ -725,3 +726,8 @@ ANN void gwi_specialid(const Gwi gwi, const m_str id, const SpecialId spid) { map_set(&gwi->gwion->data->id, (vtype)insert_symbol(gwi->gwion->st, id), (vtype)a); gwi_reserve(gwi, id); } + +ANN void gwi_set_loc(const Gwi gwi, const m_str file, const uint line) { + gwi->loc->first_line = gwi->loc->last_line = line; + gwi->gwion->env->name = file; +} diff --git a/src/parse/check.c b/src/parse/check.c index 87c5fc5a..e75ad4ce 100644 --- a/src/parse/check.c +++ b/src/parse/check.c @@ -101,7 +101,7 @@ ANN Type check_td(const Env env, Type_Decl *td) { ERR_O(td->exp->pos, _("Expression must be of type '%s', not '%s'\n" "maybe you meant typeof(Expression)"), env->gwion->type[et_class]->name, td->exp->type->name); m_uint depth; - td->xid = str2list(env, t->name, &depth); + td->xid = str2list(env, t->name, &depth, td->exp->pos); if(depth) { Exp base = new_exp_prim_int(env->gwion->mp, 0, new_loc(env->gwion->mp, __LINE__)), e = base; for(m_uint i = 0; i < depth - 1; ++i) diff --git a/tests/import/array.c b/tests/import/array.c index c61cc5c2..e6621d5a 100644 --- a/tests/import/array.c +++ b/tests/import/array.c @@ -16,14 +16,14 @@ MFUN(test_mfun){} GWION_IMPORT(array_test) { Type t_invalid_var_name; - CHECK_OB((t_invalid_var_name = gwi_mk_type(gwi, "invalid_var_name", SZ_INT, "Object"))) - CHECK_BB(gwi_class_ini(gwi, t_invalid_var_name, NULL, NULL)) - CHECK_BB(gwi_item_ini(gwi, "int[]", "int_array")) - CHECK_BB(gwi_item_end(gwi, 0, NULL)) // import array var - CHECK_BB(gwi_func_ini(gwi, "float[][]", "f", test_mfun)) - CHECK_BB(gwi_func_end(gwi, 0)) - CHECK_BB(gwi_func_ini(gwi, "float[][]", "g", test_mfun)) - CHECK_BB(gwi_func_end(gwi, 0)) - CHECK_BB(gwi_class_end(gwi)) + GWI_OB((t_invalid_var_name = gwi_mk_type(gwi, "invalid_var_name", SZ_INT, "Object"))) + GWI_BB(gwi_class_ini(gwi, t_invalid_var_name, NULL, NULL)) + GWI_BB(gwi_item_ini(gwi, "int[]", "int_array")) + GWI_BB(gwi_item_end(gwi, 0, NULL)) // import array var + GWI_BB(gwi_func_ini(gwi, "float[][]", "f", test_mfun)) + GWI_BB(gwi_func_end(gwi, 0)) + GWI_BB(gwi_func_ini(gwi, "float[][]", "g", test_mfun)) + GWI_BB(gwi_func_end(gwi, 0)) + GWI_BB(gwi_class_end(gwi)) return GW_OK; } diff --git a/tests/import/begin_class.c b/tests/import/begin_class.c index 3114c1ea..9d55d390 100644 --- a/tests/import/begin_class.c +++ b/tests/import/begin_class.c @@ -15,8 +15,8 @@ MFUN(test_mfun){} GWION_IMPORT(begin_class) { Type t_invalid_var_name; - CHECK_OB((t_invalid_var_name = gwi_mk_type(gwi, "invalid_var_name", SZ_INT, "Object"))) - CHECK_BB(gwi_class_ini(gwi, t_invalid_var_name, NULL, NULL)) - CHECK_BB(gwi_class_ini(gwi, t_invalid_var_name, NULL, NULL)) + GWI_OB((t_invalid_var_name = gwi_mk_type(gwi, "invalid_var_name", SZ_INT, "Object"))) + GWI_BB(gwi_class_ini(gwi, t_invalid_var_name, NULL, NULL)) + GWI_BB(gwi_class_ini(gwi, t_invalid_var_name, NULL, NULL)) return GW_OK; } diff --git a/tests/import/callback.c b/tests/import/callback.c index 064a90f3..49e57221 100644 --- a/tests/import/callback.c +++ b/tests/import/callback.c @@ -71,14 +71,14 @@ static SFUN(cb_func) { } GWION_IMPORT(callback) { - CHECK_BB(gwi_fptr_ini(gwi, "Vec4", "PtrType")) - CHECK_OB(gwi_fptr_end(gwi, 0)) + GWI_BB(gwi_fptr_ini(gwi, "Vec4", "PtrType")) + GWI_OB(gwi_fptr_end(gwi, 0)) const Type t_callback = gwi_mk_type(gwi, "Callback", SZ_INT, "Object"); - CHECK_BB(gwi_class_ini(gwi, t_callback, NULL, NULL)) - CHECK_BB(gwi_func_ini(gwi, "int", "callback", cb_func)) - CHECK_BB(gwi_func_arg(gwi, "PtrType", "func")) - CHECK_BB(gwi_func_end(gwi, ae_flag_static)) - CHECK_BB(gwi_class_end(gwi)) + GWI_BB(gwi_class_ini(gwi, t_callback, NULL, NULL)) + GWI_BB(gwi_func_ini(gwi, "int", "callback", cb_func)) + GWI_BB(gwi_func_arg(gwi, "PtrType", "func")) + GWI_BB(gwi_func_end(gwi, ae_flag_static)) + GWI_BB(gwi_class_end(gwi)) return GW_OK; } diff --git a/tests/import/class_template.c b/tests/import/class_template.c index bb16c823..79d677c7 100644 --- a/tests/import/class_template.c +++ b/tests/import/class_template.c @@ -31,17 +31,17 @@ GWION_IMPORT(class_template) { Type t_class_template; const m_str list[2] = { "A", "B" }; gwi_tmpl_ini(gwi, 2, list); - CHECK_OB((t_class_template = gwi_mk_type(gwi, "ClassTemplate", SZ_INT, "Object"))) - CHECK_BB(gwi_class_ini(gwi, t_class_template, class_template_ctor, NULL)) + GWI_OB((t_class_template = gwi_mk_type(gwi, "ClassTemplate", SZ_INT, "Object"))) + GWI_BB(gwi_class_ini(gwi, t_class_template, class_template_ctor, NULL)) gwi_tmpl_end(gwi); - CHECK_BB(gwi_item_ini(gwi, "A[]", "key")) - CHECK_BB((o_map_key = gwi_item_end(gwi, ae_flag_member | ae_flag_template, NULL))) - CHECK_BB(gwi_item_ini(gwi, "B[]", "value")) - CHECK_BB((o_map_value = gwi_item_end(gwi, ae_flag_member, NULL))) + GWI_BB(gwi_item_ini(gwi, "A[]", "key")) + GWI_BB((o_map_key = gwi_item_end(gwi, ae_flag_member | ae_flag_template, NULL))) + GWI_BB(gwi_item_ini(gwi, "B[]", "value")) + GWI_BB((o_map_value = gwi_item_end(gwi, ae_flag_member, NULL))) /*gwi_func_ini(gwi, "B", "set", class_template_set);*/ /*gwi_func_end(gwi, ae_flag_member);*/ - CHECK_BB(gwi_class_end(gwi)) + GWI_BB(gwi_class_end(gwi)) return GW_OK; } diff --git a/tests/import/coverage.c b/tests/import/coverage.c index 73794a33..a2e78356 100644 --- a/tests/import/coverage.c +++ b/tests/import/coverage.c @@ -21,65 +21,65 @@ SFUN(coverage_vec4) { m_vec4 v = {0,0,0,0}; *(m_vec4*)RETURN = v; } GWION_IMPORT(coverage) { Type t_coverage; - CHECK_OB((t_coverage = gwi_mk_type(gwi, "Coverage", SZ_INT, "Object"))) - CHECK_BB(gwi_class_ini(gwi, t_coverage, NULL, NULL)) - CHECK_BB(gwi_func_ini(gwi, "int", "i", coverage_int)) - CHECK_BB(gwi_func_end(gwi, ae_flag_static)) - CHECK_BB(gwi_func_ini(gwi, "float", "f", coverage_float)) - CHECK_BB(gwi_func_end(gwi, ae_flag_static)) - CHECK_BB(gwi_func_ini(gwi, "complex", "c", coverage_complex)) - CHECK_BB(gwi_func_end(gwi, ae_flag_static)) - CHECK_BB(gwi_func_ini(gwi, "Vec3", "v", coverage_vec3)) - CHECK_BB(gwi_func_end(gwi, ae_flag_static)) - CHECK_BB(gwi_func_ini(gwi, "Vec4", "w", coverage_vec4)) - CHECK_BB(gwi_func_end(gwi, ae_flag_static)) + GWI_OB((t_coverage = gwi_mk_type(gwi, "Coverage", SZ_INT, "Object"))) + GWI_BB(gwi_class_ini(gwi, t_coverage, NULL, NULL)) + GWI_BB(gwi_func_ini(gwi, "int", "i", coverage_int)) + GWI_BB(gwi_func_end(gwi, ae_flag_static)) + GWI_BB(gwi_func_ini(gwi, "float", "f", coverage_float)) + GWI_BB(gwi_func_end(gwi, ae_flag_static)) + GWI_BB(gwi_func_ini(gwi, "complex", "c", coverage_complex)) + GWI_BB(gwi_func_end(gwi, ae_flag_static)) + GWI_BB(gwi_func_ini(gwi, "Vec3", "v", coverage_vec3)) + GWI_BB(gwi_func_end(gwi, ae_flag_static)) + GWI_BB(gwi_func_ini(gwi, "Vec4", "w", coverage_vec4)) + GWI_BB(gwi_func_end(gwi, ae_flag_static)) ALLOC_PTR(gwi->gwion->mp, i, m_uint, 5); - CHECK_BB(gwi_item_ini(gwi,"int", "s_i")) - CHECK_BB(gwi_item_end(gwi, ae_flag_static, i)) + GWI_BB(gwi_item_ini(gwi,"int", "s_i")) + GWI_BB(gwi_item_end(gwi, ae_flag_static, i)) ALLOC_PTR(gwi->gwion->mp, f, m_float, 2.1); - CHECK_BB(gwi_item_ini(gwi,"int", "s_f")) - CHECK_BB(gwi_item_end(gwi, ae_flag_static, (void*)f)) + GWI_BB(gwi_item_ini(gwi,"int", "s_f")) + GWI_BB(gwi_item_end(gwi, ae_flag_static, (void*)f)) const m_complex _c = 2.1 + 2.2*I; ALLOC_PTR(gwi->gwion->mp, c, m_complex, _c); - CHECK_BB(gwi_item_ini(gwi,"complex", "s_c")) - CHECK_BB(gwi_item_end(gwi, ae_flag_static, (void*)c)) + GWI_BB(gwi_item_ini(gwi,"complex", "s_c")) + GWI_BB(gwi_item_end(gwi, ae_flag_static, (void*)c)) const m_vec3 _v = { 2.1, 2.2, 2.3 }; ALLOC_PTR(gwi->gwion->mp, v, m_vec3, _v); - CHECK_BB(gwi_item_ini(gwi,"Vec3", "s_v")) - CHECK_BB(gwi_item_end(gwi, ae_flag_static, (void*)v)) + GWI_BB(gwi_item_ini(gwi,"Vec3", "s_v")) + GWI_BB(gwi_item_end(gwi, ae_flag_static, (void*)v)) const m_vec4 _w = { 2.1, 2.2, 2.3, 2.4 }; ALLOC_PTR(gwi->gwion->mp, w, m_vec4, _w); - CHECK_BB(gwi_item_ini(gwi,"Vec4", "s_w")) - CHECK_BB(gwi_item_end(gwi, ae_flag_static, (void*)w)) + GWI_BB(gwi_item_ini(gwi,"Vec4", "s_w")) + GWI_BB(gwi_item_end(gwi, ae_flag_static, (void*)w)) ALLOC_PTR(gwi->gwion->mp, ci, m_uint, 5); - CHECK_BB(gwi_item_ini(gwi,"int", "sc_i")) - CHECK_BB(gwi_item_end(gwi, ae_flag_static | ae_flag_const, ci)) + GWI_BB(gwi_item_ini(gwi,"int", "sc_i")) + GWI_BB(gwi_item_end(gwi, ae_flag_static | ae_flag_const, ci)) ALLOC_PTR(gwi->gwion->mp, cf, m_float, 2.1); - CHECK_BB(gwi_item_ini(gwi,"float", "sc_f")) - CHECK_BB(gwi_item_end(gwi, ae_flag_static | ae_flag_const, (void*)cf)) + GWI_BB(gwi_item_ini(gwi,"float", "sc_f")) + GWI_BB(gwi_item_end(gwi, ae_flag_static | ae_flag_const, (void*)cf)) const m_complex _cc = 2.1 + 2.2*I; ALLOC_PTR(gwi->gwion->mp, cc, m_complex, _cc); - CHECK_BB(gwi_item_ini(gwi,"complex", "sc_c")) - CHECK_BB(gwi_item_end(gwi, ae_flag_static | ae_flag_const, (void*)cc)) + GWI_BB(gwi_item_ini(gwi,"complex", "sc_c")) + GWI_BB(gwi_item_end(gwi, ae_flag_static | ae_flag_const, (void*)cc)) const m_vec3 _cv = { 2.1, 2.2, 2.3 }; ALLOC_PTR(gwi->gwion->mp, cv, m_vec3, _cv); - CHECK_BB(gwi_item_ini(gwi,"Vec3", "sc_v")) - CHECK_BB(gwi_item_end(gwi, ae_flag_static | ae_flag_const, (void*)cv)) + GWI_BB(gwi_item_ini(gwi,"Vec3", "sc_v")) + GWI_BB(gwi_item_end(gwi, ae_flag_static | ae_flag_const, (void*)cv)) const m_vec4 _cw = { 2.1, 2.2, 2.3, 2.4 }; ALLOC_PTR(gwi->gwion->mp, cw, m_vec4, _cw); - CHECK_BB(gwi_item_ini(gwi,"Vec4", "sc_w")) - CHECK_BB(gwi_item_end(gwi, ae_flag_static | ae_flag_const, (void*)cw)) + GWI_BB(gwi_item_ini(gwi,"Vec4", "sc_w")) + GWI_BB(gwi_item_end(gwi, ae_flag_static | ae_flag_const, (void*)cw)) - CHECK_BB(gwi_class_end(gwi)) + GWI_BB(gwi_class_end(gwi)) return GW_OK; } diff --git a/tests/import/empty_union.c b/tests/import/empty_union.c index 9cadc1bf..1f20d554 100644 --- a/tests/import/empty_union.c +++ b/tests/import/empty_union.c @@ -12,7 +12,7 @@ #include "import.h" GWION_IMPORT(empty_union_test) { - CHECK_BB(gwi_union_ini(gwi, NULL)) - CHECK_OB(gwi_union_end(gwi, 0)) + GWI_BB(gwi_union_ini(gwi, NULL)) + GWI_OB(gwi_union_end(gwi, 0)) return GW_OK; } diff --git a/tests/import/end_class.c b/tests/import/end_class.c index 586fffc4..388fa82e 100644 --- a/tests/import/end_class.c +++ b/tests/import/end_class.c @@ -14,6 +14,6 @@ MFUN(test_mfun){} GWION_IMPORT(end_class) { - CHECK_BB(gwi_class_end(gwi)) + GWI_BB(gwi_class_end(gwi)) return GW_OK; } diff --git a/tests/import/enum.c b/tests/import/enum.c index 32b63e79..af03a964 100644 --- a/tests/import/enum.c +++ b/tests/import/enum.c @@ -12,61 +12,61 @@ #include "import.h" GWION_IMPORT(enum_test) { - CHECK_BB(gwi_enum_ini(gwi, NULL)) - CHECK_BB(gwi_enum_add(gwi, "ENUM0", 0)) - CHECK_BB(gwi_enum_add(gwi, "ENUM1", 1)) - CHECK_BB(gwi_enum_add(gwi, "ENUM2", 2)) - CHECK_BB(gwi_enum_add(gwi, "ENUM3", 3)) - CHECK_BB(gwi_enum_add(gwi, "ENUM4", 4)) - CHECK_BB(gwi_enum_add(gwi, "ENUM5", 5)) - CHECK_BB(gwi_enum_add(gwi, "ENUM6", 6)) - CHECK_BB(gwi_enum_add(gwi, "ENUM7", 7)) - CHECK_BB(gwi_enum_add(gwi, "ENUM8", 8)) - CHECK_BB(gwi_enum_add(gwi, "ENUM9", 9)) - CHECK_OB(gwi_enum_end(gwi)) + GWI_BB(gwi_enum_ini(gwi, NULL)) + GWI_BB(gwi_enum_add(gwi, "ENUM0", 0)) + GWI_BB(gwi_enum_add(gwi, "ENUM1", 1)) + GWI_BB(gwi_enum_add(gwi, "ENUM2", 2)) + GWI_BB(gwi_enum_add(gwi, "ENUM3", 3)) + GWI_BB(gwi_enum_add(gwi, "ENUM4", 4)) + GWI_BB(gwi_enum_add(gwi, "ENUM5", 5)) + GWI_BB(gwi_enum_add(gwi, "ENUM6", 6)) + GWI_BB(gwi_enum_add(gwi, "ENUM7", 7)) + GWI_BB(gwi_enum_add(gwi, "ENUM8", 8)) + GWI_BB(gwi_enum_add(gwi, "ENUM9", 9)) + GWI_OB(gwi_enum_end(gwi)) - CHECK_BB(gwi_enum_ini(gwi, "test")) - CHECK_BB(gwi_enum_add(gwi, "TYPED_ENUM0", 0)) - CHECK_BB(gwi_enum_add(gwi, "TYPED_ENUM1", 1)) - CHECK_BB(gwi_enum_add(gwi, "TYPED_ENUM2", 2)) - CHECK_BB(gwi_enum_add(gwi, "TYPED_ENUM3", 3)) - CHECK_BB(gwi_enum_add(gwi, "TYPED_ENUM4", 4)) - CHECK_BB(gwi_enum_add(gwi, "TYPED_ENUM5", 5)) - CHECK_BB(gwi_enum_add(gwi, "TYPED_ENUM6", 6)) - CHECK_BB(gwi_enum_add(gwi, "TYPED_ENUM7", 7)) - CHECK_BB(gwi_enum_add(gwi, "TYPED_ENUM8", 8)) - CHECK_BB(gwi_enum_add(gwi, "TYPED_ENUM9", 9)) - CHECK_OB(gwi_enum_end(gwi)) + GWI_BB(gwi_enum_ini(gwi, "test")) + GWI_BB(gwi_enum_add(gwi, "TYPED_ENUM0", 0)) + GWI_BB(gwi_enum_add(gwi, "TYPED_ENUM1", 1)) + GWI_BB(gwi_enum_add(gwi, "TYPED_ENUM2", 2)) + GWI_BB(gwi_enum_add(gwi, "TYPED_ENUM3", 3)) + GWI_BB(gwi_enum_add(gwi, "TYPED_ENUM4", 4)) + GWI_BB(gwi_enum_add(gwi, "TYPED_ENUM5", 5)) + GWI_BB(gwi_enum_add(gwi, "TYPED_ENUM6", 6)) + GWI_BB(gwi_enum_add(gwi, "TYPED_ENUM7", 7)) + GWI_BB(gwi_enum_add(gwi, "TYPED_ENUM8", 8)) + GWI_BB(gwi_enum_add(gwi, "TYPED_ENUM9", 9)) + GWI_OB(gwi_enum_end(gwi)) Type t_enum; - CHECK_OB((t_enum = gwi_mk_type(gwi, "Enum", 0, NULL))) - CHECK_BB(gwi_class_ini(gwi, t_enum, NULL, NULL)) - CHECK_BB(gwi_enum_ini(gwi, 0)) - CHECK_BB(gwi_enum_add(gwi, "ENUM0", 0)) - CHECK_BB(gwi_enum_add(gwi, "ENUM1", 1)) - CHECK_BB(gwi_enum_add(gwi, "ENUM2", 2)) - CHECK_BB(gwi_enum_add(gwi, "ENUM3", 3)) - CHECK_BB(gwi_enum_add(gwi, "ENUM4", 4)) - CHECK_BB(gwi_enum_add(gwi, "ENUM5", 5)) - CHECK_BB(gwi_enum_add(gwi, "ENUM6", 6)) - CHECK_BB(gwi_enum_add(gwi, "ENUM7", 7)) - CHECK_BB(gwi_enum_add(gwi, "ENUM8", 8)) - CHECK_BB(gwi_enum_add(gwi, "ENUM9", 9)) - CHECK_OB(gwi_enum_end(gwi)) + GWI_OB((t_enum = gwi_mk_type(gwi, "Enum", 0, NULL))) + GWI_BB(gwi_class_ini(gwi, t_enum, NULL, NULL)) + GWI_BB(gwi_enum_ini(gwi, 0)) + GWI_BB(gwi_enum_add(gwi, "ENUM0", 0)) + GWI_BB(gwi_enum_add(gwi, "ENUM1", 1)) + GWI_BB(gwi_enum_add(gwi, "ENUM2", 2)) + GWI_BB(gwi_enum_add(gwi, "ENUM3", 3)) + GWI_BB(gwi_enum_add(gwi, "ENUM4", 4)) + GWI_BB(gwi_enum_add(gwi, "ENUM5", 5)) + GWI_BB(gwi_enum_add(gwi, "ENUM6", 6)) + GWI_BB(gwi_enum_add(gwi, "ENUM7", 7)) + GWI_BB(gwi_enum_add(gwi, "ENUM8", 8)) + GWI_BB(gwi_enum_add(gwi, "ENUM9", 9)) + GWI_OB(gwi_enum_end(gwi)) - CHECK_BB(gwi_enum_ini(gwi, "Enumtest")) - CHECK_BB(gwi_enum_add(gwi, "TYPED_ENUM0", 0)) - CHECK_BB(gwi_enum_add(gwi, "TYPED_ENUM1", 1)) - CHECK_BB(gwi_enum_add(gwi, "TYPED_ENUM2", 2)) - CHECK_BB(gwi_enum_add(gwi, "TYPED_ENUM3", 3)) - CHECK_BB(gwi_enum_add(gwi, "TYPED_ENUM4", 4)) - CHECK_BB(gwi_enum_add(gwi, "TYPED_ENUM5", 5)) - CHECK_BB(gwi_enum_add(gwi, "TYPED_ENUM6", 6)) - CHECK_BB(gwi_enum_add(gwi, "TYPED_ENUM7", 7)) - CHECK_BB(gwi_enum_add(gwi, "TYPED_ENUM8", 8)) - CHECK_BB(gwi_enum_add(gwi, "TYPED_ENUM9", 9)) - CHECK_OB(gwi_enum_end(gwi)) - CHECK_OB(gwi_class_end(gwi)) + GWI_BB(gwi_enum_ini(gwi, "Enumtest")) + GWI_BB(gwi_enum_add(gwi, "TYPED_ENUM0", 0)) + GWI_BB(gwi_enum_add(gwi, "TYPED_ENUM1", 1)) + GWI_BB(gwi_enum_add(gwi, "TYPED_ENUM2", 2)) + GWI_BB(gwi_enum_add(gwi, "TYPED_ENUM3", 3)) + GWI_BB(gwi_enum_add(gwi, "TYPED_ENUM4", 4)) + GWI_BB(gwi_enum_add(gwi, "TYPED_ENUM5", 5)) + GWI_BB(gwi_enum_add(gwi, "TYPED_ENUM6", 6)) + GWI_BB(gwi_enum_add(gwi, "TYPED_ENUM7", 7)) + GWI_BB(gwi_enum_add(gwi, "TYPED_ENUM8", 8)) + GWI_BB(gwi_enum_add(gwi, "TYPED_ENUM9", 9)) + GWI_OB(gwi_enum_end(gwi)) + GWI_OB(gwi_class_end(gwi)) return GW_OK; } diff --git a/tests/import/extend_array.c b/tests/import/extend_array.c index 2668dd98..9c4bc4a4 100644 --- a/tests/import/extend_array.c +++ b/tests/import/extend_array.c @@ -16,13 +16,13 @@ GWION_IMPORT(extend_array_test) { Type t_array_ext; - CHECK_OB((t_array_ext = gwi_mk_type(gwi, "ArrayExt", SZ_INT, NULL))) - CHECK_BB(gwi_class_ini(gwi, t_array_ext, NULL, NULL)) + GWI_OB((t_array_ext = gwi_mk_type(gwi, "ArrayExt", SZ_INT, NULL))) + GWI_BB(gwi_class_ini(gwi, t_array_ext, NULL, NULL)) Type_Decl* td = new_type_decl(gwi->gwion->st->p, new_id_list(gwi->gwion->st->p, insert_symbol(gwi->gwion->st, "float"), GWI_LOC)); Exp e = new_exp_prim_int(gwi->gwion->st->p, 1, GWI_LOC); Array_Sub array = new_array_sub(gwi->gwion->st->p, e); add_type_decl_array(td, array); - CHECK_BB(gwi_class_ext(gwi, td)) - CHECK_BB(gwi_class_end(gwi)) + GWI_BB(gwi_class_ext(gwi, td)) + GWI_BB(gwi_class_end(gwi)) return GW_OK; } diff --git a/tests/import/extend_event.c b/tests/import/extend_event.c index cad5df3d..920674f1 100644 --- a/tests/import/extend_event.c +++ b/tests/import/extend_event.c @@ -18,10 +18,10 @@ static CTOR(ev_ctor) { printf(" %p this to test ctor\n", (void*)o); } GWION_IMPORT(extend_event_test) { Type t_ev ; - CHECK_OB((t_ev = gwi_mk_type(gwi, "Ev", SZ_INT , NULL))) - CHECK_BB(gwi_class_ini(gwi, t_ev, ev_ctor, NULL)) + GWI_OB((t_ev = gwi_mk_type(gwi, "Ev", SZ_INT , NULL))) + GWI_BB(gwi_class_ini(gwi, t_ev, ev_ctor, NULL)) Type_Decl* td = new_type_decl(gwi->gwion->st->p, new_id_list(gwi->gwion->st->p, insert_symbol(gwi->gwion->st, "Event"), GWI_LOC)); - CHECK_BB(gwi_class_ext(gwi, td)) - CHECK_BB(gwi_class_end(gwi)) + GWI_BB(gwi_class_ext(gwi, td)) + GWI_BB(gwi_class_end(gwi)) return GW_OK; } diff --git a/tests/import/extend_pair.c b/tests/import/extend_pair.c index 4aa6264a..a977eca2 100644 --- a/tests/import/extend_pair.c +++ b/tests/import/extend_pair.c @@ -17,17 +17,17 @@ GWION_IMPORT(extend_pair_test) { m_str types[] = { "A", "B" }; Type t_pair_ext ; - CHECK_OB((t_pair_ext = gwi_mk_type(gwi, "PairExt", SZ_INT , NULL))) - CHECK_BB(gwi_tmpl_ini(gwi, 2, types)) - CHECK_BB(gwi_class_ini(gwi, t_pair_ext, NULL, NULL)) - CHECK_BB(gwi_tmpl_end(gwi)) + GWI_OB((t_pair_ext = gwi_mk_type(gwi, "PairExt", SZ_INT , NULL))) + GWI_BB(gwi_tmpl_ini(gwi, 2, types)) + GWI_BB(gwi_class_ini(gwi, t_pair_ext, NULL, NULL)) + GWI_BB(gwi_tmpl_end(gwi)) Type_Decl* td = new_type_decl(gwi->gwion->st->p, new_id_list(gwi->gwion->st->p, insert_symbol(gwi->gwion->st, "Pair"), GWI_LOC)); Type_Decl* td0 = new_type_decl(gwi->gwion->st->p ,new_id_list(gwi->gwion->st->p, insert_symbol(gwi->gwion->st, "A"), GWI_LOC)); Type_Decl* td1 = new_type_decl(gwi->gwion->st->p ,new_id_list(gwi->gwion->st->p, insert_symbol(gwi->gwion->st, "B"), GWI_LOC)); Type_List tl1 = new_type_list(gwi->gwion->st->p, td1, NULL); Type_List tl0 = new_type_list(gwi->gwion->st->p,td0, tl1); td->types = tl0; - CHECK_BB(gwi_class_ext(gwi, td)) - CHECK_BB(gwi_class_end(gwi)) + GWI_BB(gwi_class_ext(gwi, td)) + GWI_BB(gwi_class_end(gwi)) return GW_OK; } diff --git a/tests/import/fptr.c b/tests/import/fptr.c index b6c70773..7ab7bd11 100644 --- a/tests/import/fptr.c +++ b/tests/import/fptr.c @@ -14,17 +14,17 @@ static MFUN(test_func) { puts("test"); } GWION_IMPORT(typedef_test) { Type t_func_typedef; - CHECK_OB((t_func_typedef = gwi_mk_type(gwi, "FuncTypedef", SZ_INT , NULL))) - CHECK_BB(gwi_fptr_ini(gwi, "void", "PtrType")) - CHECK_OB(gwi_fptr_end(gwi, 0)) + GWI_OB((t_func_typedef = gwi_mk_type(gwi, "FuncTypedef", SZ_INT , NULL))) + GWI_BB(gwi_fptr_ini(gwi, "void", "PtrType")) + GWI_OB(gwi_fptr_end(gwi, 0)) - CHECK_BB(gwi_class_ini(gwi, t_func_typedef, NULL, NULL)) - CHECK_BB(gwi_fptr_ini(gwi, "void", "PtrType")) - CHECK_OB(gwi_fptr_end(gwi, ae_flag_static)) - CHECK_BB(gwi_func_ini(gwi, "void", "test_func", test_func)) - CHECK_BB(gwi_func_end(gwi, ae_flag_static)) - CHECK_BB(gwi_item_ini(gwi, "PtrType", "ptr")) - CHECK_BB(gwi_item_end(gwi, ae_flag_static, NULL)) - CHECK_BB(gwi_class_end(gwi)) + GWI_BB(gwi_class_ini(gwi, t_func_typedef, NULL, NULL)) + GWI_BB(gwi_fptr_ini(gwi, "void", "PtrType")) + GWI_OB(gwi_fptr_end(gwi, ae_flag_static)) + GWI_BB(gwi_func_ini(gwi, "void", "test_func", test_func)) + GWI_BB(gwi_func_end(gwi, ae_flag_static)) + GWI_BB(gwi_item_ini(gwi, "PtrType", "ptr")) + GWI_BB(gwi_item_end(gwi, ae_flag_static, NULL)) + GWI_BB(gwi_class_end(gwi)) return GW_OK; } diff --git a/tests/import/global_func.c b/tests/import/global_func.c index e0e35bcc..ae20834d 100644 --- a/tests/import/global_func.c +++ b/tests/import/global_func.c @@ -18,8 +18,8 @@ SFUN(coverage_int) { } GWION_IMPORT(global_func_test) { - CHECK_BB(gwi_func_ini(gwi, "int", "test", coverage_int)) - CHECK_BB(gwi_func_arg(gwi, "int", "i")) - CHECK_BB(gwi_func_end(gwi, 0)) + GWI_BB(gwi_func_ini(gwi, "int", "test", coverage_int)) + GWI_BB(gwi_func_arg(gwi, "int", "i")) + GWI_BB(gwi_func_end(gwi, 0)) return GW_OK; } diff --git a/tests/import/global_var.c b/tests/import/global_var.c index 95677a2d..100bdfdd 100644 --- a/tests/import/global_var.c +++ b/tests/import/global_var.c @@ -17,7 +17,7 @@ GWION_IMPORT(global_var_test) { // ALLOC_PTR(i, m_uint, 1); 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")); - CHECK_BB(gwi_item_ini(gwi,"string", "i")) - CHECK_BB(gwi_item_end(gwi, 0, obj)) + GWI_BB(gwi_item_ini(gwi,"string", "i")) + GWI_BB(gwi_item_end(gwi, 0, obj)) return GW_OK; } diff --git a/tests/import/invalid_arg.c b/tests/import/invalid_arg.c index 7a834928..aa8ca887 100644 --- a/tests/import/invalid_arg.c +++ b/tests/import/invalid_arg.c @@ -14,13 +14,13 @@ static MFUN(test_mfun){} GWION_IMPORT(invalid_arg_test) { Type t_invalid_var_type ; - CHECK_OB((t_invalid_var_type = gwi_mk_type(gwi, "invalid_var_type", + GWI_OB((t_invalid_var_type = gwi_mk_type(gwi, "invalid_var_type", SZ_INT , NULL))) - CHECK_BB(gwi_class_ini(gwi, t_invalid_var_type, NULL, NULL)) - CHECK_BB(gwi_func_ini(gwi, "int[]", "func", test_mfun)) - CHECK_BB(gwi_func_arg(gwi, ".int", "i")) - CHECK_BB(gwi_func_end(gwi, ae_flag_static)) + GWI_BB(gwi_class_ini(gwi, t_invalid_var_type, NULL, NULL)) + GWI_BB(gwi_func_ini(gwi, "int[]", "func", test_mfun)) + GWI_BB(gwi_func_arg(gwi, ".int", "i")) + GWI_BB(gwi_func_end(gwi, ae_flag_static)) - CHECK_BB(gwi_class_end(gwi)) + GWI_BB(gwi_class_end(gwi)) return GW_OK; } diff --git a/tests/import/invalid_array.c b/tests/import/invalid_array.c index 69d80841..b4bc5603 100644 --- a/tests/import/invalid_array.c +++ b/tests/import/invalid_array.c @@ -14,27 +14,27 @@ static MFUN(test_mfun){} GWION_IMPORT(inalid_array_test) { Type t_invalid_var_type; - CHECK_OB((t_invalid_var_type = gwi_mk_type(gwi, "invalid_var_type", + GWI_OB((t_invalid_var_type = gwi_mk_type(gwi, "invalid_var_type", SZ_INT , NULL))) - CHECK_BB(gwi_class_ini(gwi, t_invalid_var_type, NULL, NULL)) - CHECK_BB(gwi_func_ini(gwi, "int[]", "func", test_mfun)) - CHECK_BB(gwi_func_arg(gwi, "int[][]", "i")) - CHECK_BB(gwi_func_arg(gwi, "int", "j[]")) - CHECK_BB(gwi_func_arg(gwi, "int[]", "k[]")) - CHECK_BB(gwi_func_arg(gwi, "int", "l")) - CHECK_BB(gwi_func_end(gwi, ae_flag_static)) + GWI_BB(gwi_class_ini(gwi, t_invalid_var_type, NULL, NULL)) + GWI_BB(gwi_func_ini(gwi, "int[]", "func", test_mfun)) + GWI_BB(gwi_func_arg(gwi, "int[][]", "i")) + GWI_BB(gwi_func_arg(gwi, "int", "j[]")) + GWI_BB(gwi_func_arg(gwi, "int[]", "k[]")) + GWI_BB(gwi_func_arg(gwi, "int", "l")) + GWI_BB(gwi_func_end(gwi, ae_flag_static)) - CHECK_BB(gwi_func_ini(gwi, "int[]", "func", test_mfun)) - CHECK_BB(gwi_func_arg(gwi, "int", "j[][]")) - CHECK_BB(gwi_func_arg(gwi, "int[]", "+k[][][]")) - CHECK_BB(gwi_func_arg(gwi, "int", "l")) - CHECK_BB(gwi_func_end(gwi, ae_flag_static)) + GWI_BB(gwi_func_ini(gwi, "int[]", "func", test_mfun)) + GWI_BB(gwi_func_arg(gwi, "int", "j[][]")) + GWI_BB(gwi_func_arg(gwi, "int[]", "+k[][][]")) + GWI_BB(gwi_func_arg(gwi, "int", "l")) + GWI_BB(gwi_func_end(gwi, ae_flag_static)) - CHECK_BB(gwi_func_ini(gwi, "int[]", "func", test_mfun)) - CHECK_BB(gwi_func_arg(gwi, "+int", "j[][]")) - CHECK_BB(gwi_func_arg(gwi, "int[]", "+k[][][]")) - CHECK_BB(gwi_func_end(gwi, ae_flag_static)) + GWI_BB(gwi_func_ini(gwi, "int[]", "func", test_mfun)) + GWI_BB(gwi_func_arg(gwi, "+int", "j[][]")) + GWI_BB(gwi_func_arg(gwi, "int[]", "+k[][][]")) + GWI_BB(gwi_func_end(gwi, ae_flag_static)) - CHECK_BB(gwi_class_end(gwi)) + GWI_BB(gwi_class_end(gwi)) return GW_OK; } diff --git a/tests/import/invalid_func.c b/tests/import/invalid_func.c index 6d927369..35149164 100644 --- a/tests/import/invalid_func.c +++ b/tests/import/invalid_func.c @@ -14,12 +14,12 @@ static MFUN(test_mfun){} GWION_IMPORT(invalid_func_test) { Type t_invalid_var_type ; - CHECK_OB((t_invalid_var_type = gwi_mk_type(gwi, "invalid_var_type", + GWI_OB((t_invalid_var_type = gwi_mk_type(gwi, "invalid_var_type", SZ_INT , NULL))) - CHECK_BB(gwi_class_ini(gwi, t_invalid_var_type, NULL, NULL)) - CHECK_BB(gwi_func_ini(gwi, ".int", "i", test_mfun)) - CHECK_BB(gwi_func_end(gwi, ae_flag_static)) + GWI_BB(gwi_class_ini(gwi, t_invalid_var_type, NULL, NULL)) + GWI_BB(gwi_func_ini(gwi, ".int", "i", test_mfun)) + GWI_BB(gwi_func_end(gwi, ae_flag_static)) - CHECK_BB(gwi_class_end(gwi)) + GWI_BB(gwi_class_end(gwi)) return GW_OK; } diff --git a/tests/import/invalid_type1.c b/tests/import/invalid_type1.c index e3cebb6f..d0d8299c 100644 --- a/tests/import/invalid_type1.c +++ b/tests/import/invalid_type1.c @@ -13,11 +13,11 @@ GWION_IMPORT(invalid_type1_test) { Type t_invalid_var_type; - CHECK_OB((t_invalid_var_type = gwi_mk_type(gwi, "invalid_var_type", + GWI_OB((t_invalid_var_type = gwi_mk_type(gwi, "invalid_var_type", SZ_INT , NULL))) - CHECK_BB(gwi_class_ini(gwi, t_invalid_var_type, NULL, NULL)) - CHECK_BB(gwi_item_ini(gwi,"i|nt", "test")) - CHECK_BB(gwi_item_end(gwi, 0, NULL)) - CHECK_BB(gwi_class_end(gwi)) + GWI_BB(gwi_class_ini(gwi, t_invalid_var_type, NULL, NULL)) + GWI_BB(gwi_item_ini(gwi,"i|nt", "test")) + GWI_BB(gwi_item_end(gwi, 0, NULL)) + GWI_BB(gwi_class_end(gwi)) return GW_OK; } diff --git a/tests/import/invalid_type2.c b/tests/import/invalid_type2.c index dd0a8926..a69c9de5 100644 --- a/tests/import/invalid_type2.c +++ b/tests/import/invalid_type2.c @@ -13,11 +13,11 @@ GWION_IMPORT(invalid_type2_test) { Type t_invalid_var_type ; - CHECK_OB((t_invalid_var_type = gwi_mk_type(gwi, "invalid_var_type", + GWI_OB((t_invalid_var_type = gwi_mk_type(gwi, "invalid_var_type", SZ_INT , NULL))) - CHECK_BB(gwi_class_ini(gwi, t_invalid_var_type, NULL, NULL)) - CHECK_BB(gwi_item_ini(gwi,".int", "test")) - CHECK_BB(gwi_item_end(gwi, 0, NULL)) - CHECK_BB(gwi_class_end(gwi)) + GWI_BB(gwi_class_ini(gwi, t_invalid_var_type, NULL, NULL)) + GWI_BB(gwi_item_ini(gwi,".int", "test")) + GWI_BB(gwi_item_end(gwi, 0, NULL)) + GWI_BB(gwi_class_end(gwi)) return GW_OK; } diff --git a/tests/import/invalid_type3.c b/tests/import/invalid_type3.c index aa48af2c..d4dea952 100644 --- a/tests/import/invalid_type3.c +++ b/tests/import/invalid_type3.c @@ -14,11 +14,11 @@ GWION_IMPORT(invalid_type3_test) { Type t_invalid_var_type ; - CHECK_OB((t_invalid_var_type = gwi_mk_type(gwi, ".invalid_var_type", + GWI_OB((t_invalid_var_type = gwi_mk_type(gwi, ".invalid_var_type", SZ_INT , NULL))) - CHECK_BB(gwi_class_ini(gwi, t_invalid_var_type, NULL, NULL)) - CHECK_BB(gwi_item_ini(gwi,".int", "test")) - CHECK_BB(gwi_item_end(gwi, 0, NULL)) - CHECK_BB(gwi_class_end(gwi)) + GWI_BB(gwi_class_ini(gwi, t_invalid_var_type, NULL, NULL)) + GWI_BB(gwi_item_ini(gwi,".int", "test")) + GWI_BB(gwi_item_end(gwi, 0, NULL)) + GWI_BB(gwi_class_end(gwi)) return GW_OK; } diff --git a/tests/import/op_already_imported.c b/tests/import/op_already_imported.c index c91bcc8b..faf524fa 100644 --- a/tests/import/op_already_imported.c +++ b/tests/import/op_already_imported.c @@ -16,7 +16,7 @@ GWION_IMPORT(op_already_imported) { - CHECK_BB(gwi_oper_ini(gwi, "int", "int", "int")) - CHECK_BB(gwi_oper_end(gwi, "=>", NULL)) + GWI_BB(gwi_oper_ini(gwi, "int", "int", "int")) + GWI_BB(gwi_oper_end(gwi, "=>", NULL)) return GW_OK; } diff --git a/tests/import/static_string.c b/tests/import/static_string.c index b18749f4..42e13939 100644 --- a/tests/import/static_string.c +++ b/tests/import/static_string.c @@ -16,7 +16,7 @@ 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")); - CHECK_BB(gwi_item_ini(gwi, "string", "self")) - CHECK_BB(gwi_item_end(gwi, ae_flag_global, obj)) + GWI_BB(gwi_item_ini(gwi, "string", "self")) + GWI_BB(gwi_item_end(gwi, ae_flag_global, obj)) return GW_OK; } diff --git a/tests/import/template_arg.c b/tests/import/template_arg.c index 5089c9d3..725131ee 100644 --- a/tests/import/template_arg.c +++ b/tests/import/template_arg.c @@ -14,11 +14,11 @@ static MFUN(template_arg_fun) {} GWION_IMPORT(template_arg_test) { Type t_template_arg; - CHECK_OB((t_template_arg = gwi_mk_type(gwi, "TemplateArg", SZ_INT , NULL))) - CHECK_BB(gwi_class_ini(gwi, t_template_arg, NULL, NULL)) - CHECK_BB(gwi_func_ini(gwi, "int", "set", template_arg_fun)) - CHECK_BB(gwi_func_arg(gwi, "Pair,float>","test")) - CHECK_BB(gwi_func_end(gwi, 0)) - CHECK_BB(gwi_class_end(gwi)) + GWI_OB((t_template_arg = gwi_mk_type(gwi, "TemplateArg", SZ_INT , NULL))) + GWI_BB(gwi_class_ini(gwi, t_template_arg, NULL, NULL)) + GWI_BB(gwi_func_ini(gwi, "int", "set", template_arg_fun)) + GWI_BB(gwi_func_arg(gwi, "Pair,float>","test")) + GWI_BB(gwi_func_end(gwi, 0)) + GWI_BB(gwi_class_end(gwi)) return GW_OK; } diff --git a/tests/import/union.c b/tests/import/union.c index c56aefa0..f86a986e 100644 --- a/tests/import/union.c +++ b/tests/import/union.c @@ -12,9 +12,9 @@ #include "import.h" GWION_IMPORT(union_test) { - CHECK_BB(gwi_union_ini(gwi, NULL)) - CHECK_BB(gwi_union_add(gwi,"float", "f")) - CHECK_BB(gwi_union_add(gwi,"int", "i")) - CHECK_OB(gwi_union_end(gwi, 0)) + GWI_BB(gwi_union_ini(gwi, NULL)) + GWI_BB(gwi_union_add(gwi,"float", "f")) + GWI_BB(gwi_union_add(gwi,"int", "i")) + GWI_OB(gwi_union_end(gwi, 0)) return GW_OK; } diff --git a/tests/import/variadic.c b/tests/import/variadic.c index 39633c8e..b523fdde 100644 --- a/tests/import/variadic.c +++ b/tests/import/variadic.c @@ -42,12 +42,12 @@ static MFUN(m_variadic) { GWION_IMPORT(variadic test) { const Type t_variadic = gwi_mk_type(gwi, "Variadic", SZ_INT, "Object"); - CHECK_BB(gwi_class_ini(gwi, t_variadic, NULL, NULL)) - CHECK_BB(gwi_func_ini(gwi, "void", "member", m_variadic)) - CHECK_BB(gwi_func_arg(gwi, "string", "format")) - CHECK_BB(gwi_func_end(gwi, ae_flag_variadic)) - CHECK_BB(gwi_func_ini(gwi, "void", "test", m_test)) - CHECK_BB(gwi_func_end(gwi, 0)) - CHECK_BB(gwi_class_end(gwi)) + GWI_BB(gwi_class_ini(gwi, t_variadic, NULL, NULL)) + GWI_BB(gwi_func_ini(gwi, "void", "member", m_variadic)) + GWI_BB(gwi_func_arg(gwi, "string", "format")) + GWI_BB(gwi_func_end(gwi, ae_flag_variadic)) + GWI_BB(gwi_func_ini(gwi, "void", "test", m_test)) + GWI_BB(gwi_func_end(gwi, 0)) + GWI_BB(gwi_class_end(gwi)) return GW_OK; } -- 2.43.0