~ken-vandine/+junk/liblauncher-gtk3

« back to all changes in this revision

Viewing changes to tests/test-category.c

  • Committer: Bazaar Package Importer
  • Author(s): Loïc Minier
  • Date: 2009-09-25 12:44:07 UTC
  • mfrom: (0.1.4 karmic) (62.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090925124407-zc40q066a5n5i9hw
* New upstream release.
  - Fixes software-store entry not showing up; LP: #433386.
* Wrap build-deps and deps to get cleaner diffs.
* Bump up Standards-Version to 3.8.3; no change needed.
* Enhance short descriptions slightly.
* Add shlibs:Depends and misc:Depends to liblauncher-dev.
* Build-dep on libglib2.0-dev.
* Let liblauncher-dev dep on libglib2.0-dev, libgtk2.0-dev, libwnck-dev,
  libgnome-menu-dev as their .pcs are referenced in launcher.pc.
* rules: add .PHONY and use $@ in clean:.
* debian/synbols: use 0.1.7~ in versions instead of 0.1.7-0ubuntu1.
* Use dh_prep instead of dh_clean -k.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (C) 2009 Canonical Ltd
3
 
 *
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.
7
 
 *
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.
12
 
 *
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/>.
15
 
 *
16
 
 * Authored by Gordon Allott <gord.allott@canonical.com>
17
 
 *
18
 
 */
19
 
 
20
 
#include <glib.h>
21
 
#include <launcher/launcher.h>
22
 
 
23
 
#define TEST_DESKTOP_FILE TESTDIR"/firefox.desktop"
24
 
 
25
 
void
26
 
test_create_new_category (void)
27
 
{
28
 
  LauncherCategory *category = launcher_category_new ("foobar", "Hello World!", NULL);
29
 
  g_assert (category != NULL);
30
 
}
31
 
 
32
 
void
33
 
test_applications (void)
34
 
{
35
 
  GSList *applist = NULL;
36
 
  
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);
40
 
 
41
 
  launcher_category_add_application (category, app);
42
 
  applist = launcher_category_get_applications (category);
43
 
  
44
 
  g_assert (applist != NULL);
45
 
  g_assert (applist->data == app);
46
 
  
47
 
  launcher_category_remove_application (category, app);
48
 
  applist = launcher_category_get_applications (category);
49
 
  
50
 
  g_assert (applist == NULL);
51
 
}
52
 
 
53
 
void
54
 
test_category_create_suite (void)
55
 
{
56
 
#define DOMAIN "/Launcher"
57
 
  
58
 
  g_test_add_func (DOMAIN"/Category", test_create_new_category);
59
 
  g_test_add_func (DOMAIN"/Category/Applications", test_applications);
60
 
}