connection-test: make it not require access to private SoupConnection symbols
authorDan Winship <danw@gnome.org>
Fri, 2 Nov 2012 16:07:30 +0000 (12:07 -0400)
committerDan Winship <danw@gnome.org>
Fri, 2 Nov 2012 16:07:30 +0000 (12:07 -0400)
tests/connection-test.c

index ef21ec9..8050b3d 100644 (file)
@@ -5,8 +5,6 @@
 
 #include "test-utils.h"
 
-#include "libsoup/soup-connection.h"
-
 SoupServer *server;
 SoupURI *base_uri;
 GMutex server_mutex;
@@ -713,11 +711,10 @@ static void
 connection_state_changed (GObject *object, GParamSpec *param,
                          gpointer user_data)
 {
-       SoupConnection *conn = SOUP_CONNECTION (object);
        SoupConnectionState *state = user_data;
        SoupConnectionState new_state;
 
-       new_state = soup_connection_get_state (conn);
+       g_object_get (object, "state", &new_state, NULL);
        if (state_transitions[*state] != new_state) {
                debug_printf (1, "      Unexpected transition: %s -> %s\n",
                              state_names[*state], state_names[new_state]);
@@ -731,12 +728,12 @@ connection_state_changed (GObject *object, GParamSpec *param,
 }
 
 static void
-connection_created (SoupSession *session, SoupConnection *conn,
+connection_created (SoupSession *session, GObject *conn,
                    gpointer user_data)
 {
        SoupConnectionState *state = user_data;
 
-       *state = soup_connection_get_state (conn);
+       g_object_get (conn, "state", state, NULL);
        if (*state != SOUP_CONNECTION_NEW) {
                debug_printf (1, "      Unexpected initial state: %d\n",
                              *state);