Sat, 18 Aug 2007 05:54:49 +0000
- Add purple_certificate_display_x509
|
15105
d90c07dc4d2b
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15104
diff
changeset
|
1 | #include <glib.h> |
| 15102 | 2 | #include <stdlib.h> |
| 3 | ||
|
15105
d90c07dc4d2b
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15104
diff
changeset
|
4 | #include "../core.h" |
|
d90c07dc4d2b
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15104
diff
changeset
|
5 | #include "../eventloop.h" |
|
15950
0f01bb61c5d3
Fix compiler warnings and errors in tests resulting from using DEBUG_CFLAGS
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15906
diff
changeset
|
6 | #include "../util.h" |
|
15105
d90c07dc4d2b
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15104
diff
changeset
|
7 | |
|
d90c07dc4d2b
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15104
diff
changeset
|
8 | #include "tests.h" |
|
d90c07dc4d2b
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15104
diff
changeset
|
9 | |
|
d90c07dc4d2b
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15104
diff
changeset
|
10 | /****************************************************************************** |
|
15867
27d45557637d
libpurplify the 'make check' tests so they work again
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15435
diff
changeset
|
11 | * libpurple goodies |
|
15105
d90c07dc4d2b
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15104
diff
changeset
|
12 | *****************************************************************************/ |
|
d90c07dc4d2b
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15104
diff
changeset
|
13 | static guint |
| 15884 | 14 | purple_check_input_add(gint fd, PurpleInputCondition condition, |
| 15 | PurpleInputFunction function, gpointer data) | |
|
15105
d90c07dc4d2b
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15104
diff
changeset
|
16 | { |
|
d90c07dc4d2b
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15104
diff
changeset
|
17 | /* this is a no-op for now, feel free to implement it */ |
|
d90c07dc4d2b
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15104
diff
changeset
|
18 | return 0; |
|
d90c07dc4d2b
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15104
diff
changeset
|
19 | } |
|
d90c07dc4d2b
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15104
diff
changeset
|
20 | |
| 15884 | 21 | static PurpleEventLoopUiOps eventloop_ui_ops = { |
|
15105
d90c07dc4d2b
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15104
diff
changeset
|
22 | g_timeout_add, |
|
18425
22c031a361b0
Fix warnings and add a call to g_timeout_add_seconds() just because.
Richard Laager <rlaager@pidgin.im>
parents:
16594
diff
changeset
|
23 | g_source_remove, |
| 15884 | 24 | purple_check_input_add, |
|
18425
22c031a361b0
Fix warnings and add a call to g_timeout_add_seconds() just because.
Richard Laager <rlaager@pidgin.im>
parents:
16594
diff
changeset
|
25 | g_source_remove, |
|
22c031a361b0
Fix warnings and add a call to g_timeout_add_seconds() just because.
Richard Laager <rlaager@pidgin.im>
parents:
16594
diff
changeset
|
26 | NULL, /* input_get_error */ |
|
22c031a361b0
Fix warnings and add a call to g_timeout_add_seconds() just because.
Richard Laager <rlaager@pidgin.im>
parents:
16594
diff
changeset
|
27 | #if GLIB_CHECK_VERSION(2,14,0) |
|
22c031a361b0
Fix warnings and add a call to g_timeout_add_seconds() just because.
Richard Laager <rlaager@pidgin.im>
parents:
16594
diff
changeset
|
28 | g_timeout_add_seconds, |
|
22c031a361b0
Fix warnings and add a call to g_timeout_add_seconds() just because.
Richard Laager <rlaager@pidgin.im>
parents:
16594
diff
changeset
|
29 | #else |
|
22c031a361b0
Fix warnings and add a call to g_timeout_add_seconds() just because.
Richard Laager <rlaager@pidgin.im>
parents:
16594
diff
changeset
|
30 | NULL, |
|
22c031a361b0
Fix warnings and add a call to g_timeout_add_seconds() just because.
Richard Laager <rlaager@pidgin.im>
parents:
16594
diff
changeset
|
31 | #endif |
|
22c031a361b0
Fix warnings and add a call to g_timeout_add_seconds() just because.
Richard Laager <rlaager@pidgin.im>
parents:
16594
diff
changeset
|
32 | NULL, |
|
22c031a361b0
Fix warnings and add a call to g_timeout_add_seconds() just because.
Richard Laager <rlaager@pidgin.im>
parents:
16594
diff
changeset
|
33 | NULL, |
|
15950
0f01bb61c5d3
Fix compiler warnings and errors in tests resulting from using DEBUG_CFLAGS
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15906
diff
changeset
|
34 | NULL |
|
15105
d90c07dc4d2b
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15104
diff
changeset
|
35 | }; |
|
d90c07dc4d2b
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15104
diff
changeset
|
36 | |
|
d90c07dc4d2b
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15104
diff
changeset
|
37 | static void |
| 15884 | 38 | purple_check_init(void) { |
|
15105
d90c07dc4d2b
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15104
diff
changeset
|
39 | gchar *home_dir; |
|
d90c07dc4d2b
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15104
diff
changeset
|
40 | |
| 15884 | 41 | purple_eventloop_set_ui_ops(&eventloop_ui_ops); |
|
15105
d90c07dc4d2b
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15104
diff
changeset
|
42 | |
|
d90c07dc4d2b
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15104
diff
changeset
|
43 | /* build our fake home directory */ |
|
15867
27d45557637d
libpurplify the 'make check' tests so they work again
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15435
diff
changeset
|
44 | home_dir = g_build_path(BUILDDIR, "libpurple", "tests", "home", NULL); |
| 15884 | 45 | purple_util_set_user_dir(home_dir); |
|
15105
d90c07dc4d2b
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15104
diff
changeset
|
46 | g_free(home_dir); |
|
d90c07dc4d2b
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15104
diff
changeset
|
47 | |
| 15884 | 48 | purple_core_init("check"); |
|
15105
d90c07dc4d2b
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15104
diff
changeset
|
49 | } |
|
d90c07dc4d2b
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15104
diff
changeset
|
50 | |
|
d90c07dc4d2b
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15104
diff
changeset
|
51 | /****************************************************************************** |
|
d90c07dc4d2b
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15104
diff
changeset
|
52 | * Check meat and potatoes |
|
d90c07dc4d2b
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15104
diff
changeset
|
53 | *****************************************************************************/ |
| 15104 | 54 | Suite* |
| 55 | master_suite(void) | |
| 15102 | 56 | { |
| 15104 | 57 | Suite *s = suite_create("Master Suite"); |
| 15102 | 58 | |
| 59 | return s; | |
| 60 | } | |
| 61 | ||
| 62 | int main(void) | |
| 63 | { | |
| 64 | int number_failed; | |
|
16594
d7ba74322ca4
Use fatal asserts unconditionally in the test code. Perhaps this could be better integrated in some way, but this works.
Richard Laager <rlaager@pidgin.im>
parents:
15950
diff
changeset
|
65 | SRunner *sr; |
|
d7ba74322ca4
Use fatal asserts unconditionally in the test code. Perhaps this could be better integrated in some way, but this works.
Richard Laager <rlaager@pidgin.im>
parents:
15950
diff
changeset
|
66 | |
|
d7ba74322ca4
Use fatal asserts unconditionally in the test code. Perhaps this could be better integrated in some way, but this works.
Richard Laager <rlaager@pidgin.im>
parents:
15950
diff
changeset
|
67 | /* Make g_return_... functions fatal, ALWAYS. |
|
d7ba74322ca4
Use fatal asserts unconditionally in the test code. Perhaps this could be better integrated in some way, but this works.
Richard Laager <rlaager@pidgin.im>
parents:
15950
diff
changeset
|
68 | * As this is the test code, this is NOT controlled |
|
d7ba74322ca4
Use fatal asserts unconditionally in the test code. Perhaps this could be better integrated in some way, but this works.
Richard Laager <rlaager@pidgin.im>
parents:
15950
diff
changeset
|
69 | * by PURPLE_FATAL_ASSERTS. */ |
|
d7ba74322ca4
Use fatal asserts unconditionally in the test code. Perhaps this could be better integrated in some way, but this works.
Richard Laager <rlaager@pidgin.im>
parents:
15950
diff
changeset
|
70 | g_log_set_always_fatal(G_LOG_LEVEL_CRITICAL); |
|
d7ba74322ca4
Use fatal asserts unconditionally in the test code. Perhaps this could be better integrated in some way, but this works.
Richard Laager <rlaager@pidgin.im>
parents:
15950
diff
changeset
|
71 | |
|
d7ba74322ca4
Use fatal asserts unconditionally in the test code. Perhaps this could be better integrated in some way, but this works.
Richard Laager <rlaager@pidgin.im>
parents:
15950
diff
changeset
|
72 | sr = srunner_create (master_suite()); |
| 15104 | 73 | |
| 15154 | 74 | srunner_add_suite(sr, cipher_suite()); |
| 75 | srunner_add_suite(sr, jabber_jutil_suite()); | |
| 15104 | 76 | srunner_add_suite(sr, util_suite()); |
|
15105
d90c07dc4d2b
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15104
diff
changeset
|
77 | |
|
15867
27d45557637d
libpurplify the 'make check' tests so they work again
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15435
diff
changeset
|
78 | /* make this a libpurple "ui" */ |
| 15884 | 79 | purple_check_init(); |
| 15104 | 80 | |
| 15102 | 81 | srunner_run_all (sr, CK_NORMAL); |
| 82 | number_failed = srunner_ntests_failed (sr); | |
| 83 | srunner_free (sr); | |
|
15105
d90c07dc4d2b
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15104
diff
changeset
|
84 | |
| 15884 | 85 | purple_core_quit(); |
|
15105
d90c07dc4d2b
[gaim-migrate @ 17827]
Gary Kramlich <grim@reaperworld.com>
parents:
15104
diff
changeset
|
86 | |
| 15102 | 87 | return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; |
| 88 | } |