From: fennecdjay Date: Sat, 23 Nov 2019 21:19:51 +0000 (+0100) Subject: :art: Update tests X-Git-Tag: nightly~2090 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=8a4f71743bfb48217001bf9a90110898f943186a;p=gwion.git :art: Update tests --- diff --git a/src/gwion.c b/src/gwion.c index f37f86a2..727609c9 100644 --- a/src/gwion.c +++ b/src/gwion.c @@ -69,7 +69,7 @@ ANN m_bool gwion_ini(const Gwion gwion, Arg* arg) { gwion->env->gwion = gwion; gwion->vm->bbq->si = new_soundinfo(gwion->mp); gwion->data = new_gwiondata(gwion->mp); - gwion->type = (Type*)xmalloc(MAX_TYPE * sizeof(struct Type_*)); + gwion->type = (Type*)xcalloc(MAX_TYPE, sizeof(struct Type_*)); pass_default(gwion); arg->si = gwion->vm->bbq->si; const m_bool ret = arg_parse(gwion, arg); diff --git a/src/parse/check.c b/src/parse/check.c index 5003dbd1..26b48600 100644 --- a/src/parse/check.c +++ b/src/parse/check.c @@ -938,8 +938,8 @@ ANN Type check_exp(const Env env, const Exp exp) { do { next = curr->next; CHECK_OO((curr->type = check_exp_func[curr->exp_type](env, &curr->d))) -// if(isa(curr->type, env->gwion->type[et_varloop]) > 0 && (prev || next)) -// ERR_O(exp->pos, _("Varloop must be the only expression")) + if(env->gwion->type[et_varloop] && isa(curr->type, env->gwion->type[et_varloop]) > 0 && (prev || next)) + ERR_O(exp->pos, _("Varloop must be the only expression")) if(env->func && isa(curr->type, env->gwion->type[et_lambda]) < 0 && isa(curr->type, env->gwion->type[et_function]) > 0 && !GET_FLAG(curr->type->e->d.func, pure)) UNSET_FLAG(env->func, pure); diff --git a/tests/sh/opt.sh b/tests/sh/opt.sh index 63ae7e49..00f57d10 100644 --- a/tests/sh/opt.sh +++ b/tests/sh/opt.sh @@ -1,5 +1,5 @@ #!/bin/bash -# [test] #19 +# [test] #20 n=0 [ "$1" ] && n="$1" @@ -85,6 +85,10 @@ run "$n" "invalid global type" "examples/complex/invalid_type0.gw examples/compl n=$((n+1)) run "$n" "invalid global func" "examples/complex/invalid_func0.gw examples/complex/invalid_func1.gw" "file" +# comma in module argument +n=$((n+1)) +run "$n" "comma in module argument" "-mpp=-Dtest='\"dqs\,qs\"',-Dtsdl" "file" + # test signal ./gwion -l1 & PID=$!