Fix an incorrect call to soup_message_set_request.
[pidgin-git.git] / libpurple / tests.h
blob57f4bdb3da1bd482453078d768a307740bf7a6ab
1 /* purple
3 * Purple is the legal property of its developers, whose names are too numerous
4 * to list here. Please refer to the COPYRIGHT file distributed with this
5 * source distribution.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
21 #ifndef PURPLE_TESTS_H
22 #define PURPLE_TESTS_H
24 #include <glib.h>
26 G_BEGIN_DECLS
28 typedef struct {
29 const gchar *input;
30 const gchar *output;
31 } PurpleTestStringData;
33 typedef const gchar *(*PurpleTestStringFunc)(const gchar *str);
34 typedef gchar *(*PurpleTestStringFreeFunc)(const gchar *str);
36 static inline void
37 purple_test_string_compare(PurpleTestStringFunc func,
38 PurpleTestStringData data[])
40 gint i;
42 for(i = 0; data[i].input; i++)
43 g_assert_cmpstr(data[i].output, ==, func(data[i].input));
46 static inline void
47 purple_test_string_compare_free(PurpleTestStringFreeFunc func,
48 PurpleTestStringData data[])
50 gint i;
52 for(i = 0; data[i].input; i++) {
53 gchar *got = func(data[i].input);
55 g_assert_cmpstr(data[i].output, ==, got);
57 g_free(got);
62 G_END_DECLS
64 #endif /* PURPLE_TESTS_H */