4 * Purple is the legal property of its developers, whose names are too
5 * numerous to list here. Please refer to the COPYRIGHT file distributed
6 * with this source distribution
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or (at
11 * your option) any later version.
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
28 /******************************************************************************
30 *****************************************************************************/
32 test_purple_attention_type_new(void) {
33 PurpleAttentionType
*type
= NULL
;
35 type
= purple_attention_type_new("id", "name", "incoming", "outgoing");
37 /* check the values new sets */
38 g_assert_cmpstr(purple_attention_type_get_unlocalized_name(type
), ==, "id");
39 g_assert_cmpstr(purple_attention_type_get_name(type
), ==, "name");
40 g_assert_cmpstr(purple_attention_type_get_incoming_desc(type
), ==, "incoming");
41 g_assert_cmpstr(purple_attention_type_get_outgoing_desc(type
), ==, "outgoing");
43 /* check that default values are correct */
44 g_assert_cmpstr(purple_attention_type_get_icon_name(type
), ==, NULL
);
50 test_purple_attention_type_copy(void) {
51 PurpleAttentionType
*type1
= NULL
, *type2
= NULL
;
53 type1
= purple_attention_type_new("id", "name", "incoming", "outgoing");
55 type2
= purple_attention_type_copy(type1
);
57 /* check the values new sets */
58 g_assert_cmpstr(purple_attention_type_get_unlocalized_name(type2
), ==, "id");
59 g_assert_cmpstr(purple_attention_type_get_name(type2
), ==, "name");
60 g_assert_cmpstr(purple_attention_type_get_incoming_desc(type2
), ==, "incoming");
61 g_assert_cmpstr(purple_attention_type_get_outgoing_desc(type2
), ==, "outgoing");
63 /* check that default values are correct */
64 g_assert_cmpstr(purple_attention_type_get_icon_name(type2
), ==, NULL
);
71 test_purple_attention_type_set_unlocalized_name(void) {
72 PurpleAttentionType
*type
= NULL
;
74 type
= purple_attention_type_new("id", "name", "incoming", "outgoing");
76 purple_attention_type_set_unlocalized_name(type
, "this-is-my-id");
77 g_assert_cmpstr(purple_attention_type_get_unlocalized_name(type
), ==, "this-is-my-id");
83 test_purple_attention_type_set_name(void) {
84 PurpleAttentionType
*type
= NULL
;
86 type
= purple_attention_type_new("id", "name", "incoming", "outgoing");
88 purple_attention_type_set_name(type
, "this-is-my-name");
89 g_assert_cmpstr(purple_attention_type_get_name(type
), ==, "this-is-my-name");
95 test_purple_attention_type_set_incoming_desc(void) {
96 PurpleAttentionType
*type
= NULL
;
98 type
= purple_attention_type_new("id", "name", "incoming", "outgoing");
100 purple_attention_type_set_incoming_desc(type
, "this-is-my-incoming-desc");
101 g_assert_cmpstr(purple_attention_type_get_incoming_desc(type
), ==, "this-is-my-incoming-desc");
107 test_purple_attention_type_set_outgoing_desc(void) {
108 PurpleAttentionType
*type
= NULL
;
110 type
= purple_attention_type_new("id", "name", "incoming", "outgoing");
112 purple_attention_type_set_outgoing_desc(type
, "this-is-my-outgoing-desc");
113 g_assert_cmpstr(purple_attention_type_get_outgoing_desc(type
), ==, "this-is-my-outgoing-desc");
119 test_purple_attention_type_set_icon_name(void) {
120 PurpleAttentionType
*type
= NULL
;
122 type
= purple_attention_type_new("id", "name", "incoming", "outgoing");
124 purple_attention_type_set_icon_name(type
, "this-is-my-icon-name");
125 g_assert_cmpstr(purple_attention_type_get_icon_name(type
), ==, "this-is-my-icon-name");
130 /******************************************************************************
132 *****************************************************************************/
134 main(gint argc
, gchar
**argv
) {
137 g_test_init(&argc
, &argv
, NULL
);
139 g_test_set_nonfatal_assertions();
142 "/attention-type/new",
143 test_purple_attention_type_new
147 "/attention-type/copy",
148 test_purple_attention_type_copy
152 "/attention-type/set-unlocalized-name",
153 test_purple_attention_type_set_unlocalized_name
157 "/attention-type/set-name",
158 test_purple_attention_type_set_name
162 "/attention-type/set-incoming-desc",
163 test_purple_attention_type_set_incoming_desc
167 "/attention-type/set-outgoing-desc",
168 test_purple_attention_type_set_outgoing_desc
172 "/attention-type/set-icon-name",
173 test_purple_attention_type_set_icon_name