[libsoup/carlosgc/test-for-result-message] tests: add a test to check soup_session_get_async_result_message() with soup_session_send_and_read_a




commit 9cded1ab1f6056551e9eb500d8b70114815f5d03
Author: Carlos Garcia Campos <cgarcia igalia com>
Date:   Thu Mar 18 11:13:52 2021 +0100

    tests: add a test to check soup_session_get_async_result_message() with soup_session_send_and_read_async()

 tests/test-utils.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/tests/test-utils.c b/tests/test-utils.c
index 21ece494..0078803b 100644
--- a/tests/test-utils.c
+++ b/tests/test-utils.c
@@ -310,6 +310,7 @@ soup_test_session_abort_unref (SoupSession *session)
 }
 
 typedef struct {
+       SoupMessage *msg;
        GBytes *body;
        GError *error;
        gboolean done;
@@ -321,6 +322,7 @@ send_and_read_async_ready_cb (SoupSession   *session,
                              SendAsyncData *data)
 {
        data->done = TRUE;
+       g_assert_true (soup_session_get_async_result_message (session, result) == data->msg);
        data->body = soup_session_send_and_read_finish (session, result, &data->error);
 }
 
@@ -340,7 +342,7 @@ soup_test_session_async_send (SoupSession  *session,
        gboolean message_finished = FALSE;
        GMainContext *async_context = g_main_context_ref_thread_default ();
        gulong signal_id;
-       SendAsyncData data = { NULL, NULL, FALSE };
+       SendAsyncData data = { msg, NULL, NULL, FALSE };
 
        signal_id = g_signal_connect (msg, "finished",
                                      G_CALLBACK (on_message_finished), &message_finished);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]