libpurple/tests/test_channel_join_details.c

Mon, 12 May 2025 20:25:16 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Mon, 12 May 2025 20:25:16 -0500
changeset 43246
0e9bbe9b4da8
parent 42799
8b06291db25c
permissions
-rw-r--r--

Handle formatting in server messages

Testing Done:
Used the default motd on my local ergo server to verify that formatting was working.

Reviewed at https://reviews.imfreedom.org/r/3991/

42326
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
1 /*
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
2 * Purple - Internet Messaging Library
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
3 * Copyright (C) Pidgin Developers <devel@pidgin.im>
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
4 *
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
5 * This library is free software; you can redistribute it and/or
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
6 * modify it under the terms of the GNU Lesser General Public
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
7 * License as published by the Free Software Foundation; either
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
8 * version 2 of the License, or (at your option) any later version.
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
9 *
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
10 * This library is distributed in the hope that it will be useful,
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
13 * Lesser General Public License for more details.
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
14 *
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
15 * You should have received a copy of the GNU Lesser General Public
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
16 * License along with this library; if not, see <https://www.gnu.org/licenses/>.
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
17 */
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
18
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
19 #include <glib.h>
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
20
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
21 #include <purple.h>
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
22
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
23 /******************************************************************************
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
24 * Tests
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
25 *****************************************************************************/
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
26 static void
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
27 test_purple_channel_join_details_new(void) {
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
28 PurpleChannelJoinDetails *details = NULL;
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
29
42799
8b06291db25c Add properties for the maximum length of properties to ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents: 42592
diff changeset
30 details = purple_channel_join_details_new(0, FALSE, 0, FALSE, 0);
42326
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
31
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
32 g_assert_true(PURPLE_IS_CHANNEL_JOIN_DETAILS(details));
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
33
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
34 g_clear_object(&details);
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
35 }
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
36
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
37 static void
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
38 test_purple_channel_join_details_properties(void) {
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
39 PurpleChannelJoinDetails *details;
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
40 char *name = NULL;
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
41 char *nickname = NULL;
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
42 char *password = NULL;
42799
8b06291db25c Add properties for the maximum length of properties to ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents: 42592
diff changeset
43 int name_max_length = 0;
8b06291db25c Add properties for the maximum length of properties to ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents: 42592
diff changeset
44 int nickname_max_length = 0;
8b06291db25c Add properties for the maximum length of properties to ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents: 42592
diff changeset
45 int password_max_length = 0;
42326
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
46 gboolean nickname_supported = FALSE;
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
47 gboolean password_supported = FALSE;
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
48
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
49 details = g_object_new(
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
50 PURPLE_TYPE_CHANNEL_JOIN_DETAILS,
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
51 "name", "name",
42799
8b06291db25c Add properties for the maximum length of properties to ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents: 42592
diff changeset
52 "name-max-length", 42,
42326
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
53 "nickname", "nickname",
42799
8b06291db25c Add properties for the maximum length of properties to ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents: 42592
diff changeset
54 "nickname-max-length", 1337,
42326
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
55 "nickname-supported", TRUE,
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
56 "password", "hunter2",
42799
8b06291db25c Add properties for the maximum length of properties to ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents: 42592
diff changeset
57 "password-max-length", 8,
42326
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
58 "password-supported", TRUE,
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
59 NULL);
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
60
42592
6b65c0e4ba15 Remove unnecessary casts for GObject methods
Gary Kramlich <grim@reaperworld.com>
parents: 42364
diff changeset
61 g_object_get(
6b65c0e4ba15 Remove unnecessary casts for GObject methods
Gary Kramlich <grim@reaperworld.com>
parents: 42364
diff changeset
62 details,
42326
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
63 "name", &name,
42799
8b06291db25c Add properties for the maximum length of properties to ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents: 42592
diff changeset
64 "name-max-length", &name_max_length,
42326
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
65 "nickname", &nickname,
42799
8b06291db25c Add properties for the maximum length of properties to ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents: 42592
diff changeset
66 "nickname-max-length", &nickname_max_length,
42326
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
67 "nickname-supported", &nickname_supported,
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
68 "password", &password,
42799
8b06291db25c Add properties for the maximum length of properties to ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents: 42592
diff changeset
69 "password-max-length", &password_max_length,
42326
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
70 "password-supported", &password_supported,
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
71 NULL);
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
72
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
73 g_assert_cmpstr(name, ==, "name");
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
74 g_clear_pointer(&name, g_free);
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
75
42799
8b06291db25c Add properties for the maximum length of properties to ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents: 42592
diff changeset
76 g_assert_cmpint(name_max_length, ==, 42);
8b06291db25c Add properties for the maximum length of properties to ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents: 42592
diff changeset
77
42326
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
78 g_assert_cmpstr(nickname, ==, "nickname");
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
79 g_clear_pointer(&nickname, g_free);
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
80
42799
8b06291db25c Add properties for the maximum length of properties to ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents: 42592
diff changeset
81 g_assert_cmpint(nickname_max_length, ==, 1337);
8b06291db25c Add properties for the maximum length of properties to ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents: 42592
diff changeset
82
42326
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
83 g_assert_true(nickname_supported);
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
84
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
85 g_assert_cmpstr(password, ==, "hunter2");
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
86 g_clear_pointer(&password, g_free);
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
87
42799
8b06291db25c Add properties for the maximum length of properties to ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents: 42592
diff changeset
88 g_assert_cmpint(password_max_length, ==, 8);
8b06291db25c Add properties for the maximum length of properties to ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents: 42592
diff changeset
89
42326
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
90 g_assert_true(password_supported);
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
91
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
92 g_clear_object(&details);
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
93 }
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
94
42364
b739bb0811f7 Merge whether nickname and password are supported when merging ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents: 42326
diff changeset
95 static void
b739bb0811f7 Merge whether nickname and password are supported when merging ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents: 42326
diff changeset
96 test_purple_channel_join_details_merge(void) {
b739bb0811f7 Merge whether nickname and password are supported when merging ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents: 42326
diff changeset
97 PurpleChannelJoinDetails *destination = NULL;
b739bb0811f7 Merge whether nickname and password are supported when merging ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents: 42326
diff changeset
98 PurpleChannelJoinDetails *source = NULL;
b739bb0811f7 Merge whether nickname and password are supported when merging ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents: 42326
diff changeset
99 const char *str = NULL;
b739bb0811f7 Merge whether nickname and password are supported when merging ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents: 42326
diff changeset
100 gboolean supported = FALSE;
b739bb0811f7 Merge whether nickname and password are supported when merging ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents: 42326
diff changeset
101
42799
8b06291db25c Add properties for the maximum length of properties to ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents: 42592
diff changeset
102 source = purple_channel_join_details_new(16, TRUE, 16, TRUE, 0);
42364
b739bb0811f7 Merge whether nickname and password are supported when merging ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents: 42326
diff changeset
103 purple_channel_join_details_set_name(source, "name");
b739bb0811f7 Merge whether nickname and password are supported when merging ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents: 42326
diff changeset
104 purple_channel_join_details_set_nickname(source, "nickname");
b739bb0811f7 Merge whether nickname and password are supported when merging ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents: 42326
diff changeset
105 purple_channel_join_details_set_password(source, "password");
b739bb0811f7 Merge whether nickname and password are supported when merging ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents: 42326
diff changeset
106
42799
8b06291db25c Add properties for the maximum length of properties to ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents: 42592
diff changeset
107 destination = purple_channel_join_details_new(0, FALSE, 0, FALSE, 0);
42364
b739bb0811f7 Merge whether nickname and password are supported when merging ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents: 42326
diff changeset
108
b739bb0811f7 Merge whether nickname and password are supported when merging ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents: 42326
diff changeset
109 purple_channel_join_details_merge(source, destination);
b739bb0811f7 Merge whether nickname and password are supported when merging ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents: 42326
diff changeset
110
b739bb0811f7 Merge whether nickname and password are supported when merging ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents: 42326
diff changeset
111 str = purple_channel_join_details_get_name(destination);
b739bb0811f7 Merge whether nickname and password are supported when merging ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents: 42326
diff changeset
112 g_assert_cmpstr(str, ==, purple_channel_join_details_get_name(source));
b739bb0811f7 Merge whether nickname and password are supported when merging ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents: 42326
diff changeset
113
b739bb0811f7 Merge whether nickname and password are supported when merging ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents: 42326
diff changeset
114 supported = purple_channel_join_details_get_nickname_supported(destination);
b739bb0811f7 Merge whether nickname and password are supported when merging ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents: 42326
diff changeset
115 g_assert_true(supported == purple_channel_join_details_get_nickname_supported(source));
b739bb0811f7 Merge whether nickname and password are supported when merging ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents: 42326
diff changeset
116
b739bb0811f7 Merge whether nickname and password are supported when merging ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents: 42326
diff changeset
117 str = purple_channel_join_details_get_nickname(destination);
b739bb0811f7 Merge whether nickname and password are supported when merging ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents: 42326
diff changeset
118 g_assert_cmpstr(str, ==, purple_channel_join_details_get_nickname(source));
b739bb0811f7 Merge whether nickname and password are supported when merging ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents: 42326
diff changeset
119
b739bb0811f7 Merge whether nickname and password are supported when merging ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents: 42326
diff changeset
120 supported = purple_channel_join_details_get_password_supported(destination);
b739bb0811f7 Merge whether nickname and password are supported when merging ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents: 42326
diff changeset
121 g_assert_true(supported == purple_channel_join_details_get_password_supported(source));
b739bb0811f7 Merge whether nickname and password are supported when merging ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents: 42326
diff changeset
122
b739bb0811f7 Merge whether nickname and password are supported when merging ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents: 42326
diff changeset
123 str = purple_channel_join_details_get_password(destination);
b739bb0811f7 Merge whether nickname and password are supported when merging ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents: 42326
diff changeset
124 g_assert_cmpstr(str, ==, purple_channel_join_details_get_password(source));
b739bb0811f7 Merge whether nickname and password are supported when merging ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents: 42326
diff changeset
125
b739bb0811f7 Merge whether nickname and password are supported when merging ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents: 42326
diff changeset
126 g_clear_object(&source);
b739bb0811f7 Merge whether nickname and password are supported when merging ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents: 42326
diff changeset
127 g_clear_object(&destination);
b739bb0811f7 Merge whether nickname and password are supported when merging ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents: 42326
diff changeset
128 }
b739bb0811f7 Merge whether nickname and password are supported when merging ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents: 42326
diff changeset
129
42326
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
130 /******************************************************************************
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
131 * Main
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
132 *****************************************************************************/
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
133 gint
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
134 main(gint argc, gchar *argv[]) {
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
135 g_test_init(&argc, &argv, NULL);
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
136
42799
8b06291db25c Add properties for the maximum length of properties to ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents: 42592
diff changeset
137 g_test_set_nonfatal_assertions();
8b06291db25c Add properties for the maximum length of properties to ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents: 42592
diff changeset
138
42326
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
139 g_test_add_func("/channel-join-details/new",
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
140 test_purple_channel_join_details_new);
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
141 g_test_add_func("/channel-join-details/properties",
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
142 test_purple_channel_join_details_properties);
42364
b739bb0811f7 Merge whether nickname and password are supported when merging ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents: 42326
diff changeset
143 g_test_add_func("/channel-join-details/merge",
b739bb0811f7 Merge whether nickname and password are supported when merging ChannelJoinDetails
Gary Kramlich <grim@reaperworld.com>
parents: 42326
diff changeset
144 test_purple_channel_join_details_merge);
42326
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
145
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
146 return g_test_run();
3fc3dd614b4e Create PurpleChannelJoinDetails to replace the components for join chats
Gary Kramlich <grim@reaperworld.com>
parents:
diff changeset
147 }

mercurial