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
27 /******************************************************************************
29 *****************************************************************************/
31 _test_purple_protocol_action_callback(PurpleProtocolAction
*action
) {
34 /******************************************************************************
36 *****************************************************************************/
38 test_purple_protocol_action_new(void) {
39 PurpleProtocolAction
*action
= NULL
;
41 action
= purple_protocol_action_new(
43 _test_purple_protocol_action_callback
45 g_assert_nonnull(action
);
47 g_assert_cmpstr(action
->label
, ==, "label");
48 g_assert(action
->callback
== _test_purple_protocol_action_callback
);
50 purple_protocol_action_free(action
);
54 test_purple_protocol_action_copy(void) {
55 PurpleProtocolAction
*orig
= NULL
, *copy
= NULL
;
57 orig
= purple_protocol_action_new(
59 _test_purple_protocol_action_callback
61 g_assert_nonnull(orig
);
63 copy
= purple_protocol_action_copy(orig
);
64 purple_protocol_action_free(orig
);
66 g_assert_cmpstr(copy
->label
, ==, "label");
67 g_assert(copy
->callback
== _test_purple_protocol_action_callback
);
69 purple_protocol_action_free(copy
);
72 /******************************************************************************
74 *****************************************************************************/
76 main(gint argc
, gchar
**argv
) {
79 g_test_init(&argc
, &argv
, NULL
);
81 g_test_set_nonfatal_assertions();
84 "/protocol-action/new",
85 test_purple_protocol_action_new
89 "/protocol-action/copy",
90 test_purple_protocol_action_copy