X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=tests%2Fcheck_input_binary.c;h=6f11759fd2ba600b6d66eccfe323348c7bacd901;hb=4172352914138a17340cbd2dde74d095cb61a247;hp=f69c73743fdcf9698884f465d60cfdb693aefe3b;hpb=71185b48a114a8278e8baac04f5053ae046fdbcf;p=libsigrok.git diff --git a/tests/check_input_binary.c b/tests/check_input_binary.c index f69c7374..6f11759f 100644 --- a/tests/check_input_binary.c +++ b/tests/check_input_binary.c @@ -20,7 +20,7 @@ #include #include -#include "../libsigrok.h" +#include "../include/libsigrok/libsigrok.h" #include "lib.h" #define FILENAME "foo.dat" @@ -34,7 +34,7 @@ static struct sr_context *sr_ctx; static uint64_t df_packet_counter = 0, sample_counter = 0; static gboolean have_seen_df_end = FALSE; -static GArray *logic_probelist = NULL; +static GArray *logic_channellist = NULL; static int check_to_perform; static uint64_t expected_samples; static uint64_t *expected_samplerate; @@ -123,10 +123,10 @@ static void datafeed_in(const struct sr_dev_inst *sdi, // g_debug("Received SR_DF_HEADER."); // fail_unless(p != NULL, "SR_DF_HEADER payload was NULL."); - logic_probelist = srtest_get_enabled_logic_probes(sdi); - fail_unless(logic_probelist != NULL); - fail_unless(logic_probelist->len != 0); - // g_debug("Enabled probes: %d.", logic_probelist->len); + logic_channellist = srtest_get_enabled_logic_channels(sdi); + fail_unless(logic_channellist != NULL); + fail_unless(logic_channellist->len != 0); + // g_debug("Enabled channels: %d.", logic_channellist->len); break; case SR_DF_META: // g_debug("Received SR_DF_META."); @@ -204,11 +204,12 @@ static void check_buf(const char *filename, GHashTable *param, int ret; struct sr_input *in; struct sr_input_format *in_format; + struct sr_session *session; /* Initialize global variables for this run. */ df_packet_counter = sample_counter = 0; have_seen_df_end = FALSE; - logic_probelist = NULL; + logic_channellist = NULL; check_to_perform = check; expected_samples = samples; expected_samplerate = samplerate; @@ -226,11 +227,11 @@ static void check_buf(const char *filename, GHashTable *param, ret = in->format->init(in, filename); fail_unless(ret == SR_OK, "Input format init error: %d", ret); - sr_session_new(); - sr_session_datafeed_callback_add(datafeed_in, NULL); - sr_session_dev_add(in->sdi); + sr_session_new(&session); + sr_session_datafeed_callback_add(session, datafeed_in, NULL); + sr_session_dev_add(session, in->sdi); in_format->loadfile(in, filename); - sr_session_destroy(); + sr_session_destroy(session); g_unlink(filename); /* Delete file again. */ }