gint i, j;
expected_words = g_strsplit (expected, " ", 0);
- result_words = g_strsplit (result, " ", 0);
+ result_words = g_strsplit_set (result, " \n", 0);
for (i = 0; expected_words[i]; i++)
{
g_free (result);
}
+static void
+assert_implementations (const gchar *interface,
+ const gchar *expected,
+ gboolean with_usr,
+ gboolean with_home)
+{
+ gchar *result;
+
+ result = run_apps ("implementations", interface, with_usr, with_home, NULL, NULL);
+ g_strchomp (result);
+ assert_strings_equivalent (expected, result);
+ g_free (result);
+}
+
#define ALL_USR_APPS "evince-previewer.desktop nautilus-classic.desktop gnome-font-viewer.desktop " \
"baobab.desktop yelp.desktop eog.desktop cheese.desktop gnome-clocks.desktop " \
"gnome-contacts.desktop kde4-kate.desktop gcr-prompter.desktop totem.desktop " \
"kde4-konqbrowser.desktop\n", TRUE, TRUE, "en_US.UTF-8", "eo");
}
+static void
+test_implements (void)
+{
+ /* Make sure we can find our search providers... */
+ assert_implementations ("org.gnome.Shell.SearchProvider2",
+ "gnome-music.desktop gnome-contacts.desktop eog.desktop",
+ TRUE, FALSE);
+
+ /* And our image acquisition possibilities... */
+ assert_implementations ("org.freedesktop.ImageProvider",
+ "cheese.desktop",
+ TRUE, FALSE);
+
+ /* Make sure the user's eog is properly masking the system one */
+ assert_implementations ("org.gnome.Shell.SearchProvider2",
+ "gnome-music.desktop gnome-contacts.desktop",
+ TRUE, TRUE);
+
+ /* Make sure we get nothing if we have nothing */
+ assert_implementations ("org.gnome.Shell.SearchProvider2", "", FALSE, FALSE);
+}
+
int
main (int argc,
char *argv[])
g_test_add_func ("/desktop-app-info/extra-getters", test_extra_getters);
g_test_add_func ("/desktop-app-info/actions", test_actions);
g_test_add_func ("/desktop-app-info/search", test_search);
+ g_test_add_func ("/desktop-app-info/implements", test_implements);
result = g_test_run ();