Mercurial > pidgin.yaz
annotate libgaim/tests/check_libgaim.c @ 15352:70407d31099b
[gaim-migrate @ 18144]
- Un-urgent blist on receiving focus
- Urgentize on auth alerts
committer: Tailor Script <tailor@pidgin.im>
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Wed, 17 Jan 2007 09:12:01 +0000 |
parents | 4ba77924fc08 |
children |
rev | line source |
---|---|
15044
603960420450
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15043
diff
changeset
|
1 #include <glib.h> |
15041 | 2 #include <stdlib.h> |
3 | |
15044
603960420450
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15043
diff
changeset
|
4 #include "../core.h" |
603960420450
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15043
diff
changeset
|
5 #include "../eventloop.h" |
603960420450
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15043
diff
changeset
|
6 |
603960420450
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15043
diff
changeset
|
7 #include "tests.h" |
603960420450
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15043
diff
changeset
|
8 |
603960420450
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15043
diff
changeset
|
9 /****************************************************************************** |
603960420450
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15043
diff
changeset
|
10 * libgaim goodies |
603960420450
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15043
diff
changeset
|
11 *****************************************************************************/ |
603960420450
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15043
diff
changeset
|
12 static guint |
603960420450
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15043
diff
changeset
|
13 gaim_check_input_add(gint fd, GaimInputCondition condition, |
603960420450
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15043
diff
changeset
|
14 GaimInputFunction function, gpointer data) |
603960420450
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15043
diff
changeset
|
15 { |
603960420450
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15043
diff
changeset
|
16 /* this is a no-op for now, feel free to implement it */ |
603960420450
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15043
diff
changeset
|
17 return 0; |
603960420450
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15043
diff
changeset
|
18 } |
603960420450
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15043
diff
changeset
|
19 |
603960420450
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15043
diff
changeset
|
20 static GaimEventLoopUiOps eventloop_ui_ops = { |
603960420450
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15043
diff
changeset
|
21 g_timeout_add, |
603960420450
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15043
diff
changeset
|
22 (guint (*)(guint))g_source_remove, |
603960420450
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15043
diff
changeset
|
23 gaim_check_input_add, |
603960420450
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15043
diff
changeset
|
24 (guint (*)(guint))g_source_remove, |
603960420450
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15043
diff
changeset
|
25 }; |
603960420450
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15043
diff
changeset
|
26 |
603960420450
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15043
diff
changeset
|
27 static void |
603960420450
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15043
diff
changeset
|
28 gaim_check_init(void) { |
603960420450
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15043
diff
changeset
|
29 gchar *home_dir; |
603960420450
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15043
diff
changeset
|
30 |
603960420450
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15043
diff
changeset
|
31 gaim_eventloop_set_ui_ops(&eventloop_ui_ops); |
603960420450
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15043
diff
changeset
|
32 |
603960420450
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15043
diff
changeset
|
33 /* build our fake home directory */ |
603960420450
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15043
diff
changeset
|
34 home_dir = g_build_path(BUILDDIR, "libgaim", "tests", "home", NULL); |
603960420450
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15043
diff
changeset
|
35 gaim_util_set_user_dir(home_dir); |
603960420450
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15043
diff
changeset
|
36 g_free(home_dir); |
603960420450
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15043
diff
changeset
|
37 |
603960420450
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15043
diff
changeset
|
38 gaim_core_init("check"); |
603960420450
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15043
diff
changeset
|
39 } |
603960420450
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15043
diff
changeset
|
40 |
603960420450
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15043
diff
changeset
|
41 /****************************************************************************** |
603960420450
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15043
diff
changeset
|
42 * Check meat and potatoes |
603960420450
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15043
diff
changeset
|
43 *****************************************************************************/ |
15043 | 44 Suite* |
45 master_suite(void) | |
15041 | 46 { |
15043 | 47 Suite *s = suite_create("Master Suite"); |
15041 | 48 |
49 return s; | |
50 } | |
51 | |
52 int main(void) | |
53 { | |
54 int number_failed; | |
15043 | 55 SRunner *sr = srunner_create (master_suite()); |
56 | |
15093 | 57 srunner_add_suite(sr, cipher_suite()); |
58 srunner_add_suite(sr, jabber_jutil_suite()); | |
15043 | 59 srunner_add_suite(sr, util_suite()); |
15044
603960420450
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15043
diff
changeset
|
60 |
603960420450
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15043
diff
changeset
|
61 /* make this a libgaim "ui" */ |
603960420450
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15043
diff
changeset
|
62 gaim_check_init(); |
15043 | 63 |
15041 | 64 srunner_run_all (sr, CK_NORMAL); |
65 number_failed = srunner_ntests_failed (sr); | |
66 srunner_free (sr); | |
15044
603960420450
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15043
diff
changeset
|
67 |
603960420450
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15043
diff
changeset
|
68 gaim_core_quit(); |
603960420450
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15043
diff
changeset
|
69 |
15041 | 70 return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; |
71 } |