]> sigrok.org Git - libsigrok.git/blobdiff - tests/check_strutil.c
tests: Fix binary input test.
[libsigrok.git] / tests / check_strutil.c
index ad67ef24a2c52afe31512fa0bebd96eee45d427d..68e6117dfd3c946f0ff3e4cb241b3324217e8c31 100644 (file)
  */
 
 #include <check.h>
-#include "../libsigrok.h"
+#include "../include/libsigrok/libsigrok.h"
 #include "lib.h"
 
-struct sr_context *sr_ctx;
-
-static void setup(void)
-{
-       int ret;
-
-       ret = sr_init(&sr_ctx);
-       fail_unless(ret == SR_OK, "sr_init() failed: %d.", ret);
-}
-
-static void teardown(void)
-{
-       int ret;
-
-       ret = sr_exit(sr_ctx);
-       fail_unless(ret == SR_OK, "sr_exit() failed: %d.", ret);
-}
-
 static void test_samplerate(uint64_t samplerate, const char *expected)
 {
        char *s;
@@ -180,7 +162,7 @@ Suite *suite_strutil(void)
        s = suite_create("strutil");
 
        tc = tcase_create("sr_samplerate_string");
-       tcase_add_checked_fixture(tc, setup, teardown);
+       tcase_add_checked_fixture(tc, srtest_setup, srtest_teardown);
        tcase_add_test(tc, test_hz);
        tcase_add_test(tc, test_khz);
        tcase_add_test(tc, test_mhz);