2
* Copyright (C) 2009 Canonical Ltd
4
* This program is free software: you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 3 as
6
* published by the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
13
* You should have received a copy of the GNU General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
* Authored by Gordon Allott <gord.allott@canonical.com>
21
#include <launcher/launcher.h>
23
#define TEST_DESKTOP_FILE TESTDIR"/firefox.desktop"
26
test_create_new_category (void)
28
LauncherCategory *category = launcher_category_new ("foobar", "Hello World!", NULL);
29
g_assert (category != NULL);
33
test_applications (void)
35
GSList *applist = NULL;
37
LauncherAppman *appman = launcher_appman_get_default ();
38
LauncherCategory *category = launcher_category_new ("foobar", "hello world", NULL);
39
LauncherApplication *app = launcher_appman_get_application_for_desktop_file (appman, TEST_DESKTOP_FILE);
41
launcher_category_add_application (category, app);
42
applist = launcher_category_get_applications (category);
44
g_assert (applist != NULL);
45
g_assert (applist->data == app);
47
launcher_category_remove_application (category, app);
48
applist = launcher_category_get_applications (category);
50
g_assert (applist == NULL);
54
test_category_create_suite (void)
56
#define DOMAIN "/Launcher"
58
g_test_add_func (DOMAIN"/Category", test_create_new_category);
59
g_test_add_func (DOMAIN"/Category/Applications", test_applications);