Thu, 02 Sep 2021 21:28:40 -0500
Create PurpleWhiteboardManager for managing whiteboards
Testing Done:
Compiled only. Tried to create a silc account, but it dies deep in libsilc.
Reviewed at https://reviews.imfreedom.org/r/886/
|
38860
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
1 | /* |
|
40579
882884b9bc97
Split PurpleAttentionType and PurpleProtocolAttention into their own files
Gary Kramlich <grim@reaperworld.com>
parents:
38974
diff
changeset
|
2 | * purple |
|
882884b9bc97
Split PurpleAttentionType and PurpleProtocolAttention into their own files
Gary Kramlich <grim@reaperworld.com>
parents:
38974
diff
changeset
|
3 | * Copyright (C) Pidgin Developers <devel@pidgin.im> |
|
38860
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
4 | * |
|
40579
882884b9bc97
Split PurpleAttentionType and PurpleProtocolAttention into their own files
Gary Kramlich <grim@reaperworld.com>
parents:
38974
diff
changeset
|
5 | * Purple is the legal property of its developers, whose names are too numerous |
|
882884b9bc97
Split PurpleAttentionType and PurpleProtocolAttention into their own files
Gary Kramlich <grim@reaperworld.com>
parents:
38974
diff
changeset
|
6 | * to list here. Please refer to the COPYRIGHT file distributed with this |
|
882884b9bc97
Split PurpleAttentionType and PurpleProtocolAttention into their own files
Gary Kramlich <grim@reaperworld.com>
parents:
38974
diff
changeset
|
7 | * source distribution. |
|
38860
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
8 | * |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
9 | * This program is free software; you can redistribute it and/or modify |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
10 | * it under the terms of the GNU General Public License as published by |
|
40579
882884b9bc97
Split PurpleAttentionType and PurpleProtocolAttention into their own files
Gary Kramlich <grim@reaperworld.com>
parents:
38974
diff
changeset
|
11 | * the Free Software Foundation; either version 2 of the License, or |
|
882884b9bc97
Split PurpleAttentionType and PurpleProtocolAttention into their own files
Gary Kramlich <grim@reaperworld.com>
parents:
38974
diff
changeset
|
12 | * (at your option) any later version. |
|
38860
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
13 | * |
|
40579
882884b9bc97
Split PurpleAttentionType and PurpleProtocolAttention into their own files
Gary Kramlich <grim@reaperworld.com>
parents:
38974
diff
changeset
|
14 | * This program is distributed in the hope that it will be useful, |
|
882884b9bc97
Split PurpleAttentionType and PurpleProtocolAttention into their own files
Gary Kramlich <grim@reaperworld.com>
parents:
38974
diff
changeset
|
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
882884b9bc97
Split PurpleAttentionType and PurpleProtocolAttention into their own files
Gary Kramlich <grim@reaperworld.com>
parents:
38974
diff
changeset
|
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
882884b9bc97
Split PurpleAttentionType and PurpleProtocolAttention into their own files
Gary Kramlich <grim@reaperworld.com>
parents:
38974
diff
changeset
|
17 | * GNU General Public License for more details. |
|
38860
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
18 | * |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
19 | * You should have received a copy of the GNU General Public License |
|
40579
882884b9bc97
Split PurpleAttentionType and PurpleProtocolAttention into their own files
Gary Kramlich <grim@reaperworld.com>
parents:
38974
diff
changeset
|
20 | * along with this program; if not, see <https://www.gnu.org/licenses/>. |
|
38860
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
21 | */ |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
22 | |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
23 | #include <glib.h> |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
24 | #include <string.h> |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
25 | |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
26 | #include <purple.h> |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
27 | |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
28 | #include "test_ui.h" |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
29 | |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
30 | /****************************************************************************** |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
31 | * PurpleProtcolAttention Implementations |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
32 | *****************************************************************************/ |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
33 | static GType test_purple_protocol_attention_get_type(void); |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
34 | |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
35 | typedef struct { |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
36 | PurpleProtocol parent; |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
37 | |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
38 | gboolean send_called; |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
39 | } TestPurpleProtocolAttention; |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
40 | |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
41 | typedef struct { |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
42 | PurpleProtocolClass parent; |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
43 | } TestPurpleProtocolAttentionClass; |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
44 | |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
45 | |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
46 | static gboolean |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
47 | test_purple_protocol_attention_send(PurpleProtocolAttention *attn, PurpleConnection *c, const gchar *username, guint type) { |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
48 | TestPurpleProtocolAttention *test_attn = (TestPurpleProtocolAttention *)attn; |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
49 | |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
50 | test_attn->send_called = TRUE; |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
51 | |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
52 | return TRUE; |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
53 | } |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
54 | |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
55 | static GList * |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
56 | test_purple_protocol_attention_get_types(PurpleProtocolAttention *attn, PurpleAccount *acct) { |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
57 | GList *types = NULL; |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
58 | |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
59 | types = g_list_append(types, purple_attention_type_new("id", "name", "incoming", "outgoing")); |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
60 | |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
61 | return types; |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
62 | } |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
63 | |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
64 | static void |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
65 | test_purple_protocol_attention_iface_init(PurpleProtocolAttentionInterface *iface) { |
|
40579
882884b9bc97
Split PurpleAttentionType and PurpleProtocolAttention into their own files
Gary Kramlich <grim@reaperworld.com>
parents:
38974
diff
changeset
|
66 | iface->send_attention = test_purple_protocol_attention_send; |
|
38860
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
67 | iface->get_types = test_purple_protocol_attention_get_types; |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
68 | } |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
69 | |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
70 | G_DEFINE_TYPE_WITH_CODE( |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
71 | TestPurpleProtocolAttention, |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
72 | test_purple_protocol_attention, |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
73 | PURPLE_TYPE_PROTOCOL, |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
74 | G_IMPLEMENT_INTERFACE( |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
75 | PURPLE_TYPE_PROTOCOL_ATTENTION, |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
76 | test_purple_protocol_attention_iface_init |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
77 | ) |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
78 | ); |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
79 | |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
80 | static void |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
81 | test_purple_protocol_attention_init(TestPurpleProtocolAttention *prplattn) { |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
82 | } |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
83 | |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
84 | static void |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
85 | test_purple_protocol_attention_class_init(TestPurpleProtocolAttentionClass *klass) { |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
86 | } |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
87 | |
|
40813
71305a7d7423
Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents:
40579
diff
changeset
|
88 | static TestPurpleProtocolAttention * |
|
71305a7d7423
Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents:
40579
diff
changeset
|
89 | test_purple_protocol_attention_new(void) { |
|
71305a7d7423
Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents:
40579
diff
changeset
|
90 | return (TestPurpleProtocolAttention *)g_object_new( |
|
71305a7d7423
Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents:
40579
diff
changeset
|
91 | test_purple_protocol_attention_get_type(), |
|
71305a7d7423
Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents:
40579
diff
changeset
|
92 | "id", "prpl-attention", |
|
71305a7d7423
Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents:
40579
diff
changeset
|
93 | NULL); |
|
71305a7d7423
Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents:
40579
diff
changeset
|
94 | } |
|
71305a7d7423
Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents:
40579
diff
changeset
|
95 | |
|
38860
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
96 | /****************************************************************************** |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
97 | * Tests |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
98 | *****************************************************************************/ |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
99 | static void |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
100 | test_purple_protocol_attention_can_send(void) { |
|
40813
71305a7d7423
Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents:
40579
diff
changeset
|
101 | TestPurpleProtocolAttention *attn = test_purple_protocol_attention_new(); |
|
38860
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
102 | PurpleAccount *a = purple_account_new("prpl-attn-can-send", "prpl-attn"); |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
103 | PurpleConnection *c = g_object_new(PURPLE_TYPE_CONNECTION, "account", a, NULL); |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
104 | gboolean actual = FALSE; |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
105 | |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
106 | attn->send_called = FALSE; |
|
40579
882884b9bc97
Split PurpleAttentionType and PurpleProtocolAttention into their own files
Gary Kramlich <grim@reaperworld.com>
parents:
38974
diff
changeset
|
107 | actual = purple_protocol_attention_send_attention(PURPLE_PROTOCOL_ATTENTION(attn), c, "someguy", 0); |
|
38860
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
108 | g_assert_true(actual); |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
109 | |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
110 | g_assert_true(attn->send_called); |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
111 | } |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
112 | |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
113 | static void |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
114 | test_purple_protocol_attention_can_get_types(void) { |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
115 | TestPurpleProtocolAttention *attn = g_object_new(test_purple_protocol_attention_get_type(), NULL); |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
116 | PurpleAccount *a = purple_account_new("prpl-attn-can-get-types", "prpl-attn"); |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
117 | GList *types = NULL; |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
118 | PurpleAttentionType *type = NULL; |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
119 | |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
120 | types = purple_protocol_attention_get_types(PURPLE_PROTOCOL_ATTENTION(attn), a); |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
121 | g_assert_true(g_list_length(types) == 1); |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
122 | |
|
38861
21858f98040c
Address the issues that Qulogic found
Gary Kramlich <grim@reaperworld.com>
parents:
38860
diff
changeset
|
123 | /* take the first item and cast it into type */ |
|
38860
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
124 | type = (PurpleAttentionType *)(types->data); |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
125 | g_assert(type); |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
126 | |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
127 | g_assert_cmpstr(purple_attention_type_get_unlocalized_name(type), ==, "id"); |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
128 | g_assert_cmpstr(purple_attention_type_get_name(type), ==, "name"); |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
129 | g_assert_cmpstr(purple_attention_type_get_incoming_desc(type), ==, "incoming"); |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
130 | g_assert_cmpstr(purple_attention_type_get_outgoing_desc(type), ==, "outgoing"); |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
131 | } |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
132 | |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
133 | /****************************************************************************** |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
134 | * Main |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
135 | *****************************************************************************/ |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
136 | gint |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
137 | main(gint argc, gchar **argv) { |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
138 | gint res = 0; |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
139 | |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
140 | g_test_init(&argc, &argv, NULL); |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
141 | |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
142 | g_test_set_nonfatal_assertions(); |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
143 | |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
144 | test_ui_purple_init(); |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
145 | |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
146 | g_test_add_func( |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
147 | "/protocol-attention/send", |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
148 | test_purple_protocol_attention_can_send |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
149 | ); |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
150 | |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
151 | g_test_add_func( |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
152 | "/protocol-attention/get-types", |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
153 | test_purple_protocol_attention_can_get_types |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
154 | ); |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
155 | |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
156 | res = g_test_run(); |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
157 | |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
158 | return res; |
|
4af13de1fee2
Finish up the unit tests for the attention cleanup
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
159 | } |