diff options
author | Carlos Garnacho <carlosg@gnome.org> | 2021-11-10 23:51:49 +0200 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2021-11-13 13:15:39 +0100 |
commit | d1f4d84e3cac0c4c52b30cfbb16c63c32155eb00 (patch) | |
tree | 307b295f5ddfa658c3585440ba9a8de9e51b612a /tests/libtracker-sparql | |
parent | b9e67c794df653eca5ee2c04f09a08e13f37d751 (diff) | |
download | tracker-d1f4d84e3cac0c4c52b30cfbb16c63c32155eb00.tar.gz |
tests: Add tests for remote TrackerSparqlStatements
Use the same infrastructure to also test statements with a remote
TrackerSparqlConnection/TrackerEndpoint.
Diffstat (limited to 'tests/libtracker-sparql')
-rw-r--r-- | tests/libtracker-sparql/tracker-statement-test.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/libtracker-sparql/tracker-statement-test.c b/tests/libtracker-sparql/tracker-statement-test.c index 77b54c431..002829817 100644 --- a/tests/libtracker-sparql/tracker-statement-test.c +++ b/tests/libtracker-sparql/tracker-statement-test.c @@ -259,6 +259,7 @@ thread_func (gpointer user_data) { StartupData *data = user_data; TrackerEndpointDBus *endpoint; + TrackerEndpointHttp *endpoint_http; GMainContext *context; GMainLoop *main_loop; @@ -271,6 +272,10 @@ thread_func (gpointer user_data) if (!endpoint) return NULL; + endpoint_http = tracker_endpoint_http_new (data->direct, 54321, NULL, NULL, NULL); + if (!endpoint_http) + return NULL; + started = TRUE; g_main_loop_run (main_loop); @@ -280,6 +285,7 @@ thread_func (gpointer user_data) static gboolean create_connections (TrackerSparqlConnection **dbus, TrackerSparqlConnection **direct, + TrackerSparqlConnection **remote, GError **error) { StartupData data; @@ -301,6 +307,7 @@ create_connections (TrackerSparqlConnection **dbus, *dbus = tracker_sparql_connection_bus_new (bus_name, NULL, data.dbus_conn, error); *direct = create_local_connection (error); + *remote = tracker_sparql_connection_remote_new ("http://127.0.0.1:54321/sparql"); g_thread_unref (thread); return TRUE; @@ -332,16 +339,17 @@ add_tests (TrackerSparqlConnection *conn, gint main (gint argc, gchar **argv) { - TrackerSparqlConnection *dbus = NULL, *direct = NULL; + TrackerSparqlConnection *dbus = NULL, *direct = NULL, *remote = NULL; GError *error = NULL; g_test_init (&argc, &argv, NULL); - g_assert_true (create_connections (&dbus, &direct, &error)); + g_assert_true (create_connections (&dbus, &direct, &remote, &error)); g_assert_no_error (error); add_tests (direct, "direct", TRUE); add_tests (dbus, "dbus", FALSE); + add_tests (remote, "http", FALSE); return g_test_run (); } |