Gwion coverage report


Directory: src/
File: src/parse/compat_func.c
Date: 2023-01-30 18:32:28
Exec Total Coverage
Lines: 14 14 100.0%
Functions: 1 1 100.0%
Branches: 16 18 88.9%

Line Branch Exec Source
1 #include "gwion_util.h"
2 #include "gwion_ast.h"
3 #include "gwion_env.h"
4
5 5213 ANN m_bool compat_func(const restrict Func_Def lhs,
6 const restrict Func_Def rhs) {
7 5213 Arg_List args0 = lhs->base->args;
8 5213 Arg_List args1 = rhs->base->args;
9
4/4
✓ Branch 0 taken 5148 times.
✓ Branch 1 taken 65 times.
✓ Branch 2 taken 5139 times.
✓ Branch 3 taken 9 times.
5213 if(!args0 && !args1)
10 5139 return GW_OK;
11
6/8
✓ Branch 0 taken 9 times.
✓ Branch 1 taken 65 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 9 times.
✓ Branch 4 taken 65 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 5 times.
✓ Branch 7 taken 60 times.
74 if((!args0 && args1) || (args0 && !args1))
12 14 return GW_ERROR;
13
2/2
✓ Branch 0 taken 29 times.
✓ Branch 1 taken 31 times.
60 if(args0->len != args1->len)
14 29 return GW_ERROR;
15
2/2
✓ Branch 0 taken 50 times.
✓ Branch 1 taken 14 times.
64 for(uint32_t i = 0; i < args0->len; i++) {
16 50 Arg *arg0 = mp_vector_at(args0, Arg, i);
17 50 Arg *arg1 = mp_vector_at(args1, Arg, i);
18
2/2
✓ Branch 0 taken 17 times.
✓ Branch 1 taken 33 times.
50 if (arg0->type != arg1->type) return GW_ERROR;
19 }
20 14 return GW_OK;
21 }
22