2
* test_list_entry.c -- Test for AlarmListEntry
4
* Copyright (C) 2007-2008 Johannes H. Jensen <joh@pseudoberries.com>
6
* This program is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU General Public License
8
* as published by the Free Software Foundation; either version 2
9
* of the License, or (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21
* Johannes H. Jensen <joh@pseudoberries.com>
26
#include "list-entry.h"
29
entry_dump (AlarmListEntry *entry)
31
g_print ("ListEntry %p: ");
33
g_print ("name: '%s', data: '%s', icon: '%s'", entry->name, entry->data, entry->icon);
39
AlarmListEntry *entry = NULL;
40
GList *list = NULL, *l;
41
GnomeVFSResult result;
45
// Test alarm list entry alloc
46
entry = alarm_list_entry_new ("Name", "Some data", "Icon");
48
alarm_list_entry_free(entry);
50
entry = alarm_list_entry_new ("Name", NULL, NULL);
52
alarm_list_entry_free(entry);
54
// Test alarm list entry from file
55
entry = alarm_list_entry_new_file("file:///usr/share/sounds/question.wav", &result, &mime);
57
g_print ("VFSResult: %s, MIME: %s\n", gnome_vfs_result_to_string(result), mime);
58
alarm_list_entry_free (entry);
62
list = alarm_list_entry_list_new ("file:///usr/share/sounds/", NULL);
64
g_print ("\nGot %d entries: \n---\n", g_list_length(list));
65
for (l = list, i = 0; l; l = l->next, i++) {
66
entry = (AlarmListEntry *)l->data;
67
g_print ("#%2d: ", i);
71
alarm_list_entry_list_free (&list);
73
g_print ("After list_free: %p\n", list);