diff options
author | Daniel Elstner <daniel.kitta@gmail.com> | 2014-02-20 06:24:23 +0100 |
---|---|---|
committer | Bert Vermeulen <bert@biot.com> | 2014-02-24 01:09:15 +0100 |
commit | 9eec72cb2bf132600db3330f49dace3bdf74080a (patch) | |
tree | a0198edbcbacc2f5a4beec84eea1ed40ce742502 /tests | |
parent | 4aedd5b887ef7e34bc00c0ef76dc91ea2c443583 (diff) | |
download | libsigrokdecode-9eec72cb2bf132600db3330f49dace3bdf74080a.tar.gz libsigrokdecode-9eec72cb2bf132600db3330f49dace3bdf74080a.zip |
Make the data unit size configurable
Diffstat (limited to 'tests')
-rw-r--r-- | tests/runtc.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/tests/runtc.c b/tests/runtc.c index ab1f5e9..b75e414 100644 --- a/tests/runtc.c +++ b/tests/runtc.c @@ -319,6 +319,7 @@ static int run_testcase(char *infile, GSList *pdlist, struct output *op) GHashTable *probes, *opts; GSList *pdl, *l; int idx; + int max_probe; char **decoder_class; if (op->outfile) { @@ -372,13 +373,17 @@ static int run_testcase(char *infile, GSList *pdlist, struct output *op) if (pd->probes) { probes = g_hash_table_new_full(g_str_hash, g_str_equal, NULL, (GDestroyNotify)g_variant_unref); + max_probe = 0; for (l = pd->probes; l; l = l->next) { probe = l->data; + if (probe->probe > max_probe) + max_probe = probe->probe; gvar = g_variant_new_int32(probe->probe); g_variant_ref_sink(gvar); g_hash_table_insert(probes, probe->name, gvar); } - if (srd_inst_probe_set_all(di, probes) != SRD_OK) + if (srd_inst_probe_set_all(di, probes, + (max_probe + 8) / 8) != SRD_OK) return FALSE; g_hash_table_destroy(probes); } |