diff options
author | Bert Vermeulen <bert@biot.com> | 2013-12-12 01:29:26 +0100 |
---|---|---|
committer | Bert Vermeulen <bert@biot.com> | 2013-12-12 01:29:26 +0100 |
commit | 6b85745afe65ebd2722921bf23e91fa4573f4302 (patch) | |
tree | f5323043ea855dc500228668fce8a121a3b41a0f /tests | |
parent | 5cb2cb0209d043b5b3293002ebf305efd59e05b9 (diff) | |
download | libsigrokdecode-6b85745afe65ebd2722921bf23e91fa4573f4302.tar.gz libsigrokdecode-6b85745afe65ebd2722921bf23e91fa4573f4302.zip |
runtc: Add support for binary output.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/runtc.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/tests/runtc.c b/tests/runtc.c index 4276973..f0649f9 100644 --- a/tests/runtc.c +++ b/tests/runtc.c @@ -263,9 +263,9 @@ static int run_testcase(char *infile, GSList *pdlist, struct output *op) struct option *option; GVariant *gvar; GHashTable *probes, *opts; - GSList *pdl, *l, *annl; + GSList *pdl, *l; int idx; - char **dec_ann; + char **decoder_class; if (op->outfile) { if ((op->outfd = open(op->outfile, O_CREAT|O_WRONLY, 0600)) == -1) { @@ -332,24 +332,21 @@ static int run_testcase(char *infile, GSList *pdlist, struct output *op) dec = srd_decoder_get_by_id(pd->name); if (op->class) { if (op->type == SRD_OUTPUT_ANN) - annl = dec->annotations; - /* TODO can't dereference this for binary yet + l = dec->annotations; else if (op->type == SRD_OUTPUT_BINARY) - annl = dec->binary; - */ + l = dec->binary; else /* Only annotations and binary for now. */ return FALSE; idx = 0; - while(annl) { - dec_ann = annl->data; - /* TODO can't dereference this for binary yet */ - if (!strcmp(dec_ann[0], op->class)) { + while(l) { + decoder_class = l->data; + if (!strcmp(decoder_class[0], op->class)) { op->class_idx = idx; break; } else idx++; - annl = annl->next; + l = l->next; } if (op->class_idx == -1) { ERR("Output class '%s' not found in decoder %s.", |