| 81 | } |
| 82 | |
| 83 | static bool td_name_args(cbm_test_declarations_t *declarations, yyjson_val *value, |
| 84 | cbm_test_declaration_t *item) { |
| 85 | if (!yyjson_is_arr(value)) |
| 86 | return false; |
| 87 | size_t count = yyjson_arr_size(value); |
| 88 | if (!count || count > TD_MAX_NAME_ARGS) |
| 89 | return false; |
| 90 | int *args = cbm_arena_alloc(&declarations->arena, count * sizeof(*args)); |
| 91 | if (!args) |
| 92 | return false; |
| 93 | size_t index, maximum; |
| 94 | yyjson_val *argument; |
| 95 | yyjson_arr_foreach(value, index, maximum, argument) { |
| 96 | if (!td_argument(argument, &args[index])) |
| 97 | return false; |
| 98 | } |
| 99 | /* Ordered duplicates carry meaning for an adapter, so retain them. */ |
| 100 | item->name_args = args; |
| 101 | item->name_arg_count = (int)count; |
| 102 | return true; |
| 103 | } |
| 104 | |
| 105 | static bool td_record(cbm_test_declarations_t *declarations, yyjson_val *record, |
| 106 | cbm_test_declaration_t *item) { |
no test coverage detected