diff options
author | Ted Gould <ted@gould.cx> | 2010-02-16 21:40:50 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-02-16 21:40:50 -0600 |
commit | af36cb86cf0cb671cd8521e66562341a2a015fd1 (patch) | |
tree | 6aade9ec182e1a0ed1aa71a935e3b7f425605154 /tests/test-desktop-shortcuts.c | |
parent | e0bc1911d9618a2d8ac4d1d93de3e7f81d1a14ae (diff) | |
download | libayatana-indicator-af36cb86cf0cb671cd8521e66562341a2a015fd1.tar.gz libayatana-indicator-af36cb86cf0cb671cd8521e66562341a2a015fd1.tar.bz2 libayatana-indicator-af36cb86cf0cb671cd8521e66562341a2a015fd1.zip |
Add a test to launch an nick
Diffstat (limited to 'tests/test-desktop-shortcuts.c')
-rw-r--r-- | tests/test-desktop-shortcuts.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/test-desktop-shortcuts.c b/tests/test-desktop-shortcuts.c index 02137ef..7594e51 100644 --- a/tests/test-desktop-shortcuts.c +++ b/tests/test-desktop-shortcuts.c @@ -92,12 +92,32 @@ test_desktop_shortcuts_nicknames (void) return; } +/* Try executing a shortcut which will touch a file */ +void +test_desktop_shortcuts_launch (void) +{ + IndicatorDesktopShortcuts * ids = indicator_desktop_shortcuts_new(SRCDIR "/test-well-formed.desktop", "Touch"); + g_assert(ids != NULL); + + const gchar ** nicks = indicator_desktop_shortcuts_get_nicks(ids); + g_assert(nicks[0] != NULL); + + g_assert(indicator_desktop_shortcuts_nick_exec(ids, nicks[0])); + g_assert(g_file_test("test-desktop-shortcuts-touch-test", G_FILE_TEST_EXISTS)); + + g_object_unref(ids); + + return; +} + +/* Build our test suite */ void test_desktop_shortcuts_suite (void) { g_test_add_func ("/libindicator/desktopshortcuts/creation", test_desktop_shortcuts_creation); g_test_add_func ("/libindicator/desktopshortcuts/globalnosho", test_desktop_shortcuts_globalnoshow); g_test_add_func ("/libindicator/desktopshortcuts/nicknames", test_desktop_shortcuts_nicknames); + g_test_add_func ("/libindicator/desktopshortcuts/launch", test_desktop_shortcuts_launch); return; } |