Debian Codegraph @

tests/test-error.c

raw
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
2 *
3 * @file tests/test-default-action.c Unit test: error handling
4 *
5 * @Copyright (C) 2004 Mike Hearn <[email protected]>
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
21 */
22
23 #include <libnotify/notify.h>
24 #include <stdio.h>
25 #include <unistd.h>
26
27 int
28 main ()
29 {
30 NotifyNotification *n;
31
32 notify_init ("Error Handling");
33
34 n = notify_notification_new ("Summary", "Content", NULL);
35 notify_notification_set_timeout (n, 3000); //3 seconds
36
37 /* TODO: Create an error condition */
38
39
40 if (!notify_notification_show (n, NULL)) {
41 fprintf (stderr, "failed to send notification\n");
42 return 1;
43 }
44
45
46 return 0;
47 }