From ddc324da03b73e96dc6d2cb21bf06e2082a679af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Sat, 20 Sep 2025 08:19:36 +0200 Subject: [PATCH] gio/tests/fake-document-portal: Use a sequential ID for docs It makes things clearer to test --- gio/tests/dbus-appinfo.c | 2 +- gio/tests/fake-document-portal.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gio/tests/dbus-appinfo.c b/gio/tests/dbus-appinfo.c index 67e4591ce..a9ec6e3a1 100644 --- a/gio/tests/dbus-appinfo.c +++ b/gio/tests/dbus-appinfo.c @@ -349,7 +349,7 @@ on_flatpak_open (GApplication *app, g_test_message ("on_flatpak_open received file '%s'", g_file_peek_path (files[0])); /* The file has been exported via the document portal */ - f = g_file_new_for_uri ("file:///document-portal/document-id/org.gtk.test.dbusappinfo.flatpak.desktop"); + f = g_file_new_for_uri ("file:///document-portal/document-id-0/org.gtk.test.dbusappinfo.flatpak.desktop"); g_assert_true (g_file_equal (files[0], f)); g_object_unref (f); } diff --git a/gio/tests/fake-document-portal.c b/gio/tests/fake-document-portal.c index 291e374d8..0292a343f 100644 --- a/gio/tests/fake-document-portal.c +++ b/gio/tests/fake-document-portal.c @@ -96,7 +96,7 @@ on_handle_add_full (FakeDocuments *object, const gchar * const *permissions, gpointer user_data) { - const gchar **doc_ids = NULL; + gchar **doc_ids = NULL; GVariant *extra_out = NULL; gsize length, i; @@ -105,20 +105,20 @@ on_handle_add_full (FakeDocuments *object, else length = 0; - doc_ids = g_new0 (const gchar *, length + 1 /* NULL terminator */); + doc_ids = g_new0 (gchar *, length + 1 /* NULL terminator */); for (i = 0; i < length; i++) { - doc_ids[i] = "document-id"; + doc_ids[i] = g_strdup_printf ("document-id-%" G_GSIZE_FORMAT, i); } extra_out = g_variant_new_array (G_VARIANT_TYPE ("{sv}"), NULL, 0); fake_documents_complete_add_full (object, invocation, NULL, - doc_ids, + (const char **) doc_ids, extra_out); - g_free (doc_ids); + g_strfreev (doc_ids); return TRUE; }