diff options
author | Ted Gould <ted@gould.cx> | 2010-02-16 21:34:30 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2010-02-16 21:34:30 -0600 |
commit | e0bc1911d9618a2d8ac4d1d93de3e7f81d1a14ae (patch) | |
tree | 08562129b402d5099d992cfcbbde173d31274ef8 /tests | |
parent | c636c3e6adb411281646a446866ea0e737b6ba99 (diff) | |
download | libayatana-indicator-e0bc1911d9618a2d8ac4d1d93de3e7f81d1a14ae.tar.gz libayatana-indicator-e0bc1911d9618a2d8ac4d1d93de3e7f81d1a14ae.tar.bz2 libayatana-indicator-e0bc1911d9618a2d8ac4d1d93de3e7f81d1a14ae.zip |
Adding a check to ensure we're getting the right names from the nicks.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test-desktop-shortcuts.c | 32 | ||||
-rw-r--r-- | tests/test-well-formed.desktop | 4 |
2 files changed, 33 insertions, 3 deletions
diff --git a/tests/test-desktop-shortcuts.c b/tests/test-desktop-shortcuts.c index 6dab100..02137ef 100644 --- a/tests/test-desktop-shortcuts.c +++ b/tests/test-desktop-shortcuts.c @@ -62,12 +62,42 @@ test_desktop_shortcuts_localfilter (void) return; } +/* Nick names -- checks to see they all have names */ +void +test_desktop_shortcuts_nicknames (void) +{ + IndicatorDesktopShortcuts * ids = indicator_desktop_shortcuts_new(SRCDIR "/test-well-formed.desktop", "France"); + g_assert(ids != NULL); + + const gchar ** nicks = indicator_desktop_shortcuts_get_nicks(ids); + gint i = 0; + while (nicks[i] != NULL) { + gchar * expectedstr = g_strdup_printf("%s's shortcut", nicks[i]); + gchar * name = indicator_desktop_shortcuts_nick_get_name(ids, nicks[i]); + g_assert(name != NULL); + + gboolean same = (g_strcmp0(expectedstr, name) == 0); + + g_free(name); + g_free(expectedstr); + + g_assert(same); + + i++; + } + + + g_object_unref(ids); + + return; +} + 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/localfilter", test_desktop_shortcuts_localfilter); + g_test_add_func ("/libindicator/desktopshortcuts/nicknames", test_desktop_shortcuts_nicknames); return; } diff --git a/tests/test-well-formed.desktop b/tests/test-well-formed.desktop index fc906a3..dc2744f 100644 --- a/tests/test-well-formed.desktop +++ b/tests/test-well-formed.desktop @@ -5,11 +5,11 @@ NotShowIn=Germany X-Ayatana-Desktop-Shortcuts=bob;alvin;jim [bob Shortcut Group] -Name=Bob's shortcut +Name=bob's shortcut Exec=ls bob [alvin Shortcut Group] -Name=Alivin's shortcut +Name=alvin's shortcut Exec=ls alvin OnlyShowIn=France |