X-Git-Url: https://sigrok.org/gitweb/?p=libsigrokdecode.git;a=blobdiff_plain;f=tests%2Fruntc.c;h=096ff1609e638c85b4952302e19b3b721a5dc7eb;hp=25b4e389f0cfe46e022568e3bb0b4d3157e6704f;hb=f6c7eade2b8853b3d525b5cc0402e89ca74c1908;hpb=6a15597a7b3f901b566b7bfc8c484a14e0fb6a11 diff --git a/tests/runtc.c b/tests/runtc.c index 25b4e38..096ff16 100644 --- a/tests/runtc.c +++ b/tests/runtc.c @@ -17,6 +17,7 @@ * along with this program. If not, see . */ +#include #include "../libsigrokdecode.h" #include #include @@ -35,7 +36,7 @@ #ifdef __LINUX__ #include #endif -#include "../config.h" +#include "config.h" int debug = FALSE; int statistics = FALSE; @@ -48,7 +49,7 @@ struct channel { struct option { char *key; - char *value; + GVariant *value; }; struct pd { @@ -327,7 +328,7 @@ static int run_testcase(char *infile, GSList *pdlist, struct output *op) struct srd_session *sess; struct srd_decoder *dec; struct srd_decoder_inst *di, *prev_di; - srd_pd_output_callback_t cb; + srd_pd_output_callback cb; struct pd *pd; struct channel *channel; struct option *option; @@ -688,8 +689,8 @@ int main(int argc, char **argv) struct channel *channel; struct option *option; struct output *op; - int ret; - char c, *opt_infile, **kv, **opstr; + int ret, c; + char *opt_infile, **kv, **opstr; op = malloc(sizeof(struct output)); op->pd = NULL; @@ -736,7 +737,8 @@ int main(int argc, char **argv) } else { option = malloc(sizeof(struct option)); option->key = g_strdup(kv[0]); - option->value = g_strdup(kv[1]); + option->value = g_variant_new_string(kv[1]); + g_variant_ref_sink(option->value); /* Apply to last PD. */ pd->options = g_slist_append(pd->options, option); } @@ -759,6 +761,9 @@ int main(int argc, char **argv) op->type = SRD_OUTPUT_BINARY; else if (!strcmp(opstr[1], "python")) op->type = SRD_OUTPUT_PYTHON; + else if (!strcmp(opstr[1], "exception")) + /* Doesn't matter, we just need it to bomb out. */ + op->type = SRD_OUTPUT_PYTHON; else { ERR("Unknown output type '%s'", opstr[1]); g_strfreev(opstr);