]> sigrok.org Git - libsigrok.git/blobdiff - tests/lib.c
kingst-la2016: fix segfault that often occurs when a capture is aborted
[libsigrok.git] / tests / lib.c
index cb8b8a48b352f017e5a068e7e7259c23e2ee9001..15beca27ae60096e070ff8bb41eb8be4716dc5e6 100644 (file)
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
+#include <config.h>
 #include <stdio.h>
 #include <string.h>
 #include <glib.h>
 #include <glib/gstdio.h>
 #include <check.h>
-#include "../include/libsigrok/libsigrok.h"
+#include <libsigrok/libsigrok.h>
 #include "lib.h"
 
 struct sr_context *srtest_ctx;
@@ -97,7 +97,7 @@ void srtest_set_samplerate(struct sr_dev_driver *driver, uint64_t samplerate)
        struct sr_dev_inst *sdi;
        GVariant *gvar;
 
-       sdi = g_slist_nth_data(driver->priv, 0);
+       sdi = g_slist_nth_data(driver->context, 0);
 
        gvar = g_variant_new_uint64(samplerate);
        ret = driver->config_set(SR_CONF_SAMPLERATE, gvar, sdi, NULL);
@@ -115,7 +115,7 @@ uint64_t srtest_get_samplerate(struct sr_dev_driver *driver)
        struct sr_dev_inst *sdi;
        GVariant *gvar;
 
-       sdi = g_slist_nth_data(driver->priv, 0);
+       sdi = g_slist_nth_data(driver->context, 0);
 
        ret = driver->config_get(SR_CONF_SAMPLERATE, &gvar, sdi, NULL);
        samplerate = g_variant_get_uint64(gvar);