Thu, 22 Feb 2024 06:03:16 -0600
Add a favorite property to PurpleContactInfo
This will be used in the future for toggling whether or not contacts are
favorited or starred.
Testing Done:
Ran the unit tests under valgrind.
Reviewed at https://reviews.imfreedom.org/r/2965/
|
42594
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
38745
diff
changeset
|
1 | /* |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
38745
diff
changeset
|
2 | * Purple - Internet Messaging Library |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
38745
diff
changeset
|
3 | * Copyright (C) Pidgin Developers <devel@pidgin.im> |
|
37609
a265dfe49fcb
Add a header file with some utils for testing
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
4 | * |
|
a265dfe49fcb
Add a header file with some utils for testing
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
5 | * Purple is the legal property of its developers, whose names are too numerous |
|
42594
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
38745
diff
changeset
|
6 | * to list here. Please refer to the COPYRIGHT file distributed with this |
|
37609
a265dfe49fcb
Add a header file with some utils for testing
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
7 | * source distribution. |
|
a265dfe49fcb
Add a header file with some utils for testing
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
8 | * |
|
42594
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
38745
diff
changeset
|
9 | * This library is free software; you can redistribute it and/or modify it |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
38745
diff
changeset
|
10 | * under the terms of the GNU General Public License as published by the Free |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
38745
diff
changeset
|
11 | * Software Foundation; either version 2 of the License, or (at your option) |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
38745
diff
changeset
|
12 | * any later version. |
|
37609
a265dfe49fcb
Add a header file with some utils for testing
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
13 | * |
|
42594
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
38745
diff
changeset
|
14 | * This library is distributed in the hope that it will be useful, but WITHOUT |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
38745
diff
changeset
|
15 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
38745
diff
changeset
|
16 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
38745
diff
changeset
|
17 | * more details. |
|
37609
a265dfe49fcb
Add a header file with some utils for testing
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
18 | * |
|
42594
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
38745
diff
changeset
|
19 | * You should have received a copy of the GNU General Public License along with |
|
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
38745
diff
changeset
|
20 | * this library; if not, see <https://www.gnu.org/licenses/>. |
|
37609
a265dfe49fcb
Add a header file with some utils for testing
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
21 | */ |
|
42594
eddde70cedd8
Create a test for verifying license headers and correct the ones that were wrong
Gary Kramlich <grim@reaperworld.com>
parents:
38745
diff
changeset
|
22 | |
|
37609
a265dfe49fcb
Add a header file with some utils for testing
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
23 | #ifndef PURPLE_TESTS_H |
|
a265dfe49fcb
Add a header file with some utils for testing
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
24 | #define PURPLE_TESTS_H |
|
a265dfe49fcb
Add a header file with some utils for testing
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
25 | |
|
a265dfe49fcb
Add a header file with some utils for testing
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
26 | #include <glib.h> |
|
a265dfe49fcb
Add a header file with some utils for testing
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
27 | |
|
a265dfe49fcb
Add a header file with some utils for testing
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
28 | G_BEGIN_DECLS |
|
a265dfe49fcb
Add a header file with some utils for testing
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
29 | |
|
a265dfe49fcb
Add a header file with some utils for testing
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
30 | typedef struct { |
|
a265dfe49fcb
Add a header file with some utils for testing
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
31 | const gchar *input; |
|
a265dfe49fcb
Add a header file with some utils for testing
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
32 | const gchar *output; |
|
a265dfe49fcb
Add a header file with some utils for testing
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
33 | } PurpleTestStringData; |
|
a265dfe49fcb
Add a header file with some utils for testing
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
34 | |
|
38745
f4376b1f4682
A ton more of introspection cleanups
Gary Kramlich <grim@reaperworld.com>
parents:
38530
diff
changeset
|
35 | typedef const gchar *(*PurpleTestStringFunc)(const gchar *str); |
|
f4376b1f4682
A ton more of introspection cleanups
Gary Kramlich <grim@reaperworld.com>
parents:
38530
diff
changeset
|
36 | typedef gchar *(*PurpleTestStringFreeFunc)(const gchar *str); |
|
37609
a265dfe49fcb
Add a header file with some utils for testing
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
37 | |
|
38530
40f7a9d57b11
Fix jutil test building.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37609
diff
changeset
|
38 | static inline void |
|
37609
a265dfe49fcb
Add a header file with some utils for testing
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
39 | purple_test_string_compare(PurpleTestStringFunc func, |
|
a265dfe49fcb
Add a header file with some utils for testing
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
40 | PurpleTestStringData data[]) |
|
a265dfe49fcb
Add a header file with some utils for testing
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
41 | { |
|
a265dfe49fcb
Add a header file with some utils for testing
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
42 | gint i; |
|
a265dfe49fcb
Add a header file with some utils for testing
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
43 | |
|
a265dfe49fcb
Add a header file with some utils for testing
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
44 | for(i = 0; data[i].input; i++) |
|
a265dfe49fcb
Add a header file with some utils for testing
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
45 | g_assert_cmpstr(data[i].output, ==, func(data[i].input)); |
|
a265dfe49fcb
Add a header file with some utils for testing
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
46 | } |
|
a265dfe49fcb
Add a header file with some utils for testing
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
47 | |
|
38530
40f7a9d57b11
Fix jutil test building.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37609
diff
changeset
|
48 | static inline void |
|
37609
a265dfe49fcb
Add a header file with some utils for testing
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
49 | purple_test_string_compare_free(PurpleTestStringFreeFunc func, |
|
a265dfe49fcb
Add a header file with some utils for testing
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
50 | PurpleTestStringData data[]) |
|
a265dfe49fcb
Add a header file with some utils for testing
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
51 | { |
|
a265dfe49fcb
Add a header file with some utils for testing
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
52 | gint i; |
|
a265dfe49fcb
Add a header file with some utils for testing
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
53 | |
|
a265dfe49fcb
Add a header file with some utils for testing
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
54 | for(i = 0; data[i].input; i++) { |
|
a265dfe49fcb
Add a header file with some utils for testing
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
55 | gchar *got = func(data[i].input); |
|
a265dfe49fcb
Add a header file with some utils for testing
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
56 | |
|
a265dfe49fcb
Add a header file with some utils for testing
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
57 | g_assert_cmpstr(data[i].output, ==, got); |
|
a265dfe49fcb
Add a header file with some utils for testing
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
58 | |
|
a265dfe49fcb
Add a header file with some utils for testing
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
59 | g_free(got); |
|
a265dfe49fcb
Add a header file with some utils for testing
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
60 | } |
|
a265dfe49fcb
Add a header file with some utils for testing
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
61 | } |
|
a265dfe49fcb
Add a header file with some utils for testing
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
62 | |
|
a265dfe49fcb
Add a header file with some utils for testing
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
63 | |
|
a265dfe49fcb
Add a header file with some utils for testing
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
64 | G_END_DECLS |
|
a265dfe49fcb
Add a header file with some utils for testing
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
65 | |
|
a265dfe49fcb
Add a header file with some utils for testing
Gary Kramlich <grim@reaperworld.com>
parents:
diff
changeset
|
66 | #endif /* PURPLE_TESTS_H */ |