]> sigrok.org Git - libsigrok.git/commitdiff
unit tests: Update for sr_session_new() API change.
authorUwe Hermann <redacted>
Thu, 26 Mar 2015 22:49:35 +0000 (23:49 +0100)
committerUwe Hermann <redacted>
Thu, 26 Mar 2015 22:49:35 +0000 (23:49 +0100)
tests/input_binary.c
tests/session.c

index 403f7307a2de33936cc3faa251b8dba3f68476a2..1ecfb082bdf61daa1674a4c12bd1b69dea944dcb 100644 (file)
@@ -208,7 +208,7 @@ static void check_buf(GHashTable *options, const uint8_t *buf, int check,
 
        sdi = sr_input_dev_inst_get(in);
 
-       sr_session_new(&session);
+       sr_session_new(srtest_ctx, &session);
        sr_session_datafeed_callback_add(session, datafeed_in, NULL);
        sr_session_dev_add(session, sdi);
 
index 699f58360c4f7bafd5e1151004bae88bf9c57d44..e0ea6e24703c492b1393a53c9f872a10f6386959 100644 (file)
@@ -32,7 +32,7 @@ START_TEST(test_session_new)
        int ret;
        struct sr_session *sess;
 
-       ret = sr_session_new(&sess);
+       ret = sr_session_new(srtest_ctx, &sess);
        fail_unless(ret == SR_OK, "sr_session_new() failed: %d.", ret);
        sr_session_destroy(sess);
 }
@@ -46,7 +46,7 @@ START_TEST(test_session_new_bogus)
 {
        int ret;
 
-       ret = sr_session_new(NULL);
+       ret = sr_session_new(srtest_ctx, NULL);
        fail_unless(ret != SR_OK, "sr_session_new(NULL) worked.");
 }
 END_TEST
@@ -63,11 +63,11 @@ START_TEST(test_session_new_multiple)
        sess1 = sess2 = sess3 = NULL;
 
        /* Multiple sr_session_new() calls must work. */
-       ret = sr_session_new(&sess1);
+       ret = sr_session_new(srtest_ctx, &sess1);
        fail_unless(ret == SR_OK, "sr_session_new() 1 failed: %d.", ret);
-       ret = sr_session_new(&sess2);
+       ret = sr_session_new(srtest_ctx, &sess2);
        fail_unless(ret == SR_OK, "sr_session_new() 2 failed: %d.", ret);
-       ret = sr_session_new(&sess3);
+       ret = sr_session_new(srtest_ctx, &sess3);
        fail_unless(ret == SR_OK, "sr_session_new() 3 failed: %d.", ret);
 
        /* The returned session pointers must all be non-NULL. */
@@ -99,7 +99,7 @@ START_TEST(test_session_destroy)
        int ret;
        struct sr_session *sess;
 
-       sr_session_new(&sess);
+       sr_session_new(srtest_ctx, &sess);
        ret = sr_session_destroy(sess);
        fail_unless(ret == SR_OK, "sr_session_destroy() failed: %d.", ret);
 }
@@ -124,7 +124,7 @@ START_TEST(test_session_trigger_set_get)
        struct sr_session *sess;
        struct sr_trigger *t1, *t2;
 
-       sr_session_new(&sess);
+       sr_session_new(srtest_ctx, &sess);
        t1 = sr_trigger_new("T1");
 
        /* Set a trigger and see if getting it works OK. */
@@ -146,7 +146,7 @@ START_TEST(test_session_trigger_set_get_null)
        struct sr_session *sess;
        struct sr_trigger *t;
 
-       sr_session_new(&sess);
+       sr_session_new(srtest_ctx, &sess);
 
        /* Adding a NULL trigger is allowed. */
        ret = sr_session_trigger_set(sess, NULL);