tests: Add .desktop file for non-existent binary ...

... to test that it is filtered out correctly by
g_desktop_app_info_load_from_keyfile() (but not
g_desktop_app_info_search()).

https://bugzilla.gnome.org/show_bug.cgi?id=795488
This commit is contained in:
Florian Müllner 2018-04-24 16:01:36 +02:00
parent 0d10dd9fe5
commit f9f497a702
4 changed files with 18 additions and 2 deletions

View File

@ -300,6 +300,7 @@ usr_desktop_files = \
evince-previewer.desktop \
evince.desktop \
file-roller.desktop \
frobnicator.desktop \
gcr-prompter.desktop \
gcr-viewer.desktop \
gedit.desktop \

View File

@ -672,6 +672,12 @@ test_search (void)
*/
assert_search ("sh", "gnome-terminal.desktop\n", TRUE, FALSE, NULL, NULL);
/* "frobnicator.desktop" is ignored by get_all() because the binary is
* missing, but search should still find it (to avoid either stale results
* from the cache or expensive stat() calls for each potential result)
*/
assert_search ("frobni", "frobnicator.desktop\n", TRUE, FALSE, NULL, NULL);
/* Obvious multi-word search */
assert_search ("gno hel", "yelp.desktop\n", TRUE, TRUE, NULL, NULL);

View File

@ -0,0 +1,9 @@
[Desktop Entry]
Name=Frobnicator
Comment=Frobnicate your life!
Exec=/does-not-exist
Icon=frobnicator
StartupNotify=true
Terminal=false
Type=Application
Categories=GNOME;GTK;Utilities

View File

@ -962,7 +962,7 @@ test_measure (void)
if (size > 0)
g_assert_cmpuint (num_bytes, ==, size);
g_assert_cmpuint (num_dirs, ==, 6);
g_assert_cmpuint (num_files, ==, 30);
g_assert_cmpuint (num_files, ==, 31);
g_object_unref (file);
g_free (path);
@ -1056,7 +1056,7 @@ test_measure_async (void)
g_free (path);
data->expected_dirs = 6;
data->expected_files = 30;
data->expected_files = 31;
g_file_measure_disk_usage_async (file,
G_FILE_MEASURE_APPARENT_SIZE,