]> sigrok.org Git - libsigrok.git/blobdiff - tests/lib.c
A few more random 'probe' to 'channel' changes.
[libsigrok.git] / tests / lib.c
index b5a4950843181cd9ddac5d1164c242ab9f680592..ad0b3e1f38a2c75b9faa043385801e3ce4cc322c 100644 (file)
@@ -24,6 +24,7 @@
 #include <glib/gstdio.h>
 #include <check.h>
 #include "../libsigrok.h"
+#include "lib.h"
 
 /* Get a libsigrok driver by name. */
 struct sr_dev_driver *srtest_driver_get(const char *drivername)
@@ -153,7 +154,7 @@ void srtest_set_samplerate(struct sr_dev_driver *driver, uint64_t samplerate)
        sdi = g_slist_nth_data(driver->priv, 0);
 
        gvar = g_variant_new_uint64(samplerate);
-       ret = driver->config_set(SR_CONF_SAMPLERATE, gvar, sdi);
+       ret = driver->config_set(SR_CONF_SAMPLERATE, gvar, sdi, NULL);
        g_variant_unref(gvar);
 
        fail_unless(ret == SR_OK, "%s: Failed to set SR_CONF_SAMPLERATE: %d.",
@@ -170,7 +171,7 @@ uint64_t srtest_get_samplerate(struct sr_dev_driver *driver)
 
        sdi = g_slist_nth_data(driver->priv, 0);
 
-       ret = driver->config_get(SR_CONF_SAMPLERATE, &gvar, sdi);
+       ret = driver->config_get(SR_CONF_SAMPLERATE, &gvar, sdi, NULL);
        samplerate = g_variant_get_uint64(gvar);
        g_variant_unref(gvar);
 
@@ -198,7 +199,7 @@ void srtest_check_samplerate(struct sr_context *sr_ctx, const char *drivername,
 void srtest_buf_to_file(const char *filename, const uint8_t *buf, uint64_t len)
 {
        FILE *f;
-       GError *error;
+       GError *error = NULL;
        gboolean ret;
 
        f = g_fopen(filename, "wb");
@@ -210,21 +211,21 @@ void srtest_buf_to_file(const char *filename, const uint8_t *buf, uint64_t len)
        fclose(f);
 }
 
-GArray *srtest_get_enabled_logic_probes(const struct sr_dev_inst *sdi)
+GArray *srtest_get_enabled_logic_channels(const struct sr_dev_inst *sdi)
 {
-       struct sr_probe *probe;
-       GArray *probes;
+       struct sr_channel *ch;
+       GArray *channels;
        GSList *l;
 
-       probes = g_array_new(FALSE, FALSE, sizeof(int));
-       for (l = sdi->probes; l; l = l->next) {
-               probe = l->data;
-               if (probe->type != SR_PROBE_LOGIC)
+       channels = g_array_new(FALSE, FALSE, sizeof(int));
+       for (l = sdi->channels; l; l = l->next) {
+               ch = l->data;
+               if (ch->type != SR_CHANNEL_LOGIC)
                        continue;
-               if (probe->enabled != TRUE)
+               if (ch->enabled != TRUE)
                        continue;
-               g_array_append_val(probes, probe->index);
+               g_array_append_val(channels, ch->index);
        }
 
-       return probes;
+       return channels;
 }