Wed, 14 Aug 2024 19:26:26 -0500
Remove uri handling from libpurple
Testing Done:
Called in the turtles.
Reviewed at https://reviews.imfreedom.org/r/3387/
|
38057
41f47eb1aa19
Add our license spiel to a bunch of files
Gary Kramlich <grim@reaperworld.com>
parents:
37601
diff
changeset
|
1 | /* |
|
41f47eb1aa19
Add our license spiel to a bunch of files
Gary Kramlich <grim@reaperworld.com>
parents:
37601
diff
changeset
|
2 | * purple |
|
41f47eb1aa19
Add our license spiel to a bunch of files
Gary Kramlich <grim@reaperworld.com>
parents:
37601
diff
changeset
|
3 | * |
|
41f47eb1aa19
Add our license spiel to a bunch of files
Gary Kramlich <grim@reaperworld.com>
parents:
37601
diff
changeset
|
4 | * Purple is the legal property of its developers, whose names are too numerous |
|
41f47eb1aa19
Add our license spiel to a bunch of files
Gary Kramlich <grim@reaperworld.com>
parents:
37601
diff
changeset
|
5 | * to list here. Please refer to the COPYRIGHT file distributed with this |
|
41f47eb1aa19
Add our license spiel to a bunch of files
Gary Kramlich <grim@reaperworld.com>
parents:
37601
diff
changeset
|
6 | * source distribution. |
|
41f47eb1aa19
Add our license spiel to a bunch of files
Gary Kramlich <grim@reaperworld.com>
parents:
37601
diff
changeset
|
7 | * |
|
41f47eb1aa19
Add our license spiel to a bunch of files
Gary Kramlich <grim@reaperworld.com>
parents:
37601
diff
changeset
|
8 | * This program is free software; you can redistribute it and/or modify |
|
41f47eb1aa19
Add our license spiel to a bunch of files
Gary Kramlich <grim@reaperworld.com>
parents:
37601
diff
changeset
|
9 | * it under the terms of the GNU General Public License as published by |
|
41f47eb1aa19
Add our license spiel to a bunch of files
Gary Kramlich <grim@reaperworld.com>
parents:
37601
diff
changeset
|
10 | * the Free Software Foundation; either version 2 of the License, or |
|
41f47eb1aa19
Add our license spiel to a bunch of files
Gary Kramlich <grim@reaperworld.com>
parents:
37601
diff
changeset
|
11 | * (at your option) any later version. |
|
41f47eb1aa19
Add our license spiel to a bunch of files
Gary Kramlich <grim@reaperworld.com>
parents:
37601
diff
changeset
|
12 | * |
|
41f47eb1aa19
Add our license spiel to a bunch of files
Gary Kramlich <grim@reaperworld.com>
parents:
37601
diff
changeset
|
13 | * This program is distributed in the hope that it will be useful, |
|
41f47eb1aa19
Add our license spiel to a bunch of files
Gary Kramlich <grim@reaperworld.com>
parents:
37601
diff
changeset
|
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
41f47eb1aa19
Add our license spiel to a bunch of files
Gary Kramlich <grim@reaperworld.com>
parents:
37601
diff
changeset
|
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
41f47eb1aa19
Add our license spiel to a bunch of files
Gary Kramlich <grim@reaperworld.com>
parents:
37601
diff
changeset
|
16 | * GNU General Public License for more details. |
|
41f47eb1aa19
Add our license spiel to a bunch of files
Gary Kramlich <grim@reaperworld.com>
parents:
37601
diff
changeset
|
17 | * |
|
41f47eb1aa19
Add our license spiel to a bunch of files
Gary Kramlich <grim@reaperworld.com>
parents:
37601
diff
changeset
|
18 | * You should have received a copy of the GNU General Public License |
|
41f47eb1aa19
Add our license spiel to a bunch of files
Gary Kramlich <grim@reaperworld.com>
parents:
37601
diff
changeset
|
19 | * along with this program; if not, write to the Free Software |
|
41f47eb1aa19
Add our license spiel to a bunch of files
Gary Kramlich <grim@reaperworld.com>
parents:
37601
diff
changeset
|
20 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
|
41f47eb1aa19
Add our license spiel to a bunch of files
Gary Kramlich <grim@reaperworld.com>
parents:
37601
diff
changeset
|
21 | * |
|
41f47eb1aa19
Add our license spiel to a bunch of files
Gary Kramlich <grim@reaperworld.com>
parents:
37601
diff
changeset
|
22 | */ |
|
37600
fce4d896285e
Add a bunch of util tests
Gary Kramlich <grim@reaperworld.com>
parents:
36049
diff
changeset
|
23 | #include <glib.h> |
|
15950
0f01bb61c5d3
Fix compiler warnings and errors in tests resulting from using DEBUG_CFLAGS
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
15884
diff
changeset
|
24 | |
|
40358
e6fe6fc1f516
move all protocols, purple plugins, and purple tests to use purple.h instead of including files individually
Gary Kramlich <grim@reaperworld.com>
parents:
39987
diff
changeset
|
25 | #include <purple.h> |
| 15104 | 26 | |
|
37600
fce4d896285e
Add a bunch of util tests
Gary Kramlich <grim@reaperworld.com>
parents:
36049
diff
changeset
|
27 | /****************************************************************************** |
|
fce4d896285e
Add a bunch of util tests
Gary Kramlich <grim@reaperworld.com>
parents:
36049
diff
changeset
|
28 | * filename escape tests |
|
fce4d896285e
Add a bunch of util tests
Gary Kramlich <grim@reaperworld.com>
parents:
36049
diff
changeset
|
29 | *****************************************************************************/ |
|
fce4d896285e
Add a bunch of util tests
Gary Kramlich <grim@reaperworld.com>
parents:
36049
diff
changeset
|
30 | static void |
|
fce4d896285e
Add a bunch of util tests
Gary Kramlich <grim@reaperworld.com>
parents:
36049
diff
changeset
|
31 | test_util_filename_escape(void) { |
|
fce4d896285e
Add a bunch of util tests
Gary Kramlich <grim@reaperworld.com>
parents:
36049
diff
changeset
|
32 | g_assert_cmpstr("foo", ==, purple_escape_filename("foo")); |
|
fce4d896285e
Add a bunch of util tests
Gary Kramlich <grim@reaperworld.com>
parents:
36049
diff
changeset
|
33 | g_assert_cmpstr("@oo", ==, purple_escape_filename("@oo")); |
|
fce4d896285e
Add a bunch of util tests
Gary Kramlich <grim@reaperworld.com>
parents:
36049
diff
changeset
|
34 | g_assert_cmpstr("#oo", ==, purple_escape_filename("#oo")); |
|
fce4d896285e
Add a bunch of util tests
Gary Kramlich <grim@reaperworld.com>
parents:
36049
diff
changeset
|
35 | g_assert_cmpstr("-oo", ==, purple_escape_filename("-oo")); |
|
fce4d896285e
Add a bunch of util tests
Gary Kramlich <grim@reaperworld.com>
parents:
36049
diff
changeset
|
36 | g_assert_cmpstr("_oo", ==, purple_escape_filename("_oo")); |
|
fce4d896285e
Add a bunch of util tests
Gary Kramlich <grim@reaperworld.com>
parents:
36049
diff
changeset
|
37 | g_assert_cmpstr(".oo", ==, purple_escape_filename(".oo")); |
|
fce4d896285e
Add a bunch of util tests
Gary Kramlich <grim@reaperworld.com>
parents:
36049
diff
changeset
|
38 | g_assert_cmpstr("%25oo", ==, purple_escape_filename("%oo")); |
|
fce4d896285e
Add a bunch of util tests
Gary Kramlich <grim@reaperworld.com>
parents:
36049
diff
changeset
|
39 | g_assert_cmpstr("%21oo", ==, purple_escape_filename("!oo")); |
| 15104 | 40 | } |
| 41 | ||
|
37600
fce4d896285e
Add a bunch of util tests
Gary Kramlich <grim@reaperworld.com>
parents:
36049
diff
changeset
|
42 | /****************************************************************************** |
|
fce4d896285e
Add a bunch of util tests
Gary Kramlich <grim@reaperworld.com>
parents:
36049
diff
changeset
|
43 | * email tests |
|
fce4d896285e
Add a bunch of util tests
Gary Kramlich <grim@reaperworld.com>
parents:
36049
diff
changeset
|
44 | *****************************************************************************/ |
|
30440
4ec59d547bff
Expand our test for purple_email_is_valid(). I stumbled across a large list
Mark Doliner <markdoliner@pidgin.im>
parents:
30149
diff
changeset
|
45 | /* |
|
30442
a4f304b33d50
Oh, let's put our original test cases in the two arrays, to make things
Mark Doliner <markdoliner@pidgin.im>
parents:
30440
diff
changeset
|
46 | * Many of the valid and invalid email addresses lised below are from |
|
30440
4ec59d547bff
Expand our test for purple_email_is_valid(). I stumbled across a large list
Mark Doliner <markdoliner@pidgin.im>
parents:
30149
diff
changeset
|
47 | * http://fightingforalostcause.net/misc/2006/compare-email-regex.php |
|
4ec59d547bff
Expand our test for purple_email_is_valid(). I stumbled across a large list
Mark Doliner <markdoliner@pidgin.im>
parents:
30149
diff
changeset
|
48 | */ |
|
42866
4b201e18638f
Modernize most of the unit tests
Gary Kramlich <grim@reaperworld.com>
parents:
42842
diff
changeset
|
49 | const char *valid_emails[] = { |
|
30442
a4f304b33d50
Oh, let's put our original test cases in the two arrays, to make things
Mark Doliner <markdoliner@pidgin.im>
parents:
30440
diff
changeset
|
50 | "purple-devel@lists.sf.net", |
|
30440
4ec59d547bff
Expand our test for purple_email_is_valid(). I stumbled across a large list
Mark Doliner <markdoliner@pidgin.im>
parents:
30149
diff
changeset
|
51 | "l3tt3rsAndNumb3rs@domain.com", |
|
4ec59d547bff
Expand our test for purple_email_is_valid(). I stumbled across a large list
Mark Doliner <markdoliner@pidgin.im>
parents:
30149
diff
changeset
|
52 | "has-dash@domain.com", |
|
4ec59d547bff
Expand our test for purple_email_is_valid(). I stumbled across a large list
Mark Doliner <markdoliner@pidgin.im>
parents:
30149
diff
changeset
|
53 | "hasApostrophe.o'leary@domain.org", |
|
4ec59d547bff
Expand our test for purple_email_is_valid(). I stumbled across a large list
Mark Doliner <markdoliner@pidgin.im>
parents:
30149
diff
changeset
|
54 | "uncommonTLD@domain.museum", |
|
4ec59d547bff
Expand our test for purple_email_is_valid(). I stumbled across a large list
Mark Doliner <markdoliner@pidgin.im>
parents:
30149
diff
changeset
|
55 | "uncommonTLD@domain.travel", |
|
4ec59d547bff
Expand our test for purple_email_is_valid(). I stumbled across a large list
Mark Doliner <markdoliner@pidgin.im>
parents:
30149
diff
changeset
|
56 | "uncommonTLD@domain.mobi", |
|
4ec59d547bff
Expand our test for purple_email_is_valid(). I stumbled across a large list
Mark Doliner <markdoliner@pidgin.im>
parents:
30149
diff
changeset
|
57 | "countryCodeTLD@domain.uk", |
|
4ec59d547bff
Expand our test for purple_email_is_valid(). I stumbled across a large list
Mark Doliner <markdoliner@pidgin.im>
parents:
30149
diff
changeset
|
58 | "countryCodeTLD@domain.rw", |
|
4ec59d547bff
Expand our test for purple_email_is_valid(). I stumbled across a large list
Mark Doliner <markdoliner@pidgin.im>
parents:
30149
diff
changeset
|
59 | "lettersInDomain@911.com", |
|
4ec59d547bff
Expand our test for purple_email_is_valid(). I stumbled across a large list
Mark Doliner <markdoliner@pidgin.im>
parents:
30149
diff
changeset
|
60 | "underscore_inLocal@domain.net", |
|
4ec59d547bff
Expand our test for purple_email_is_valid(). I stumbled across a large list
Mark Doliner <markdoliner@pidgin.im>
parents:
30149
diff
changeset
|
61 | "IPInsteadOfDomain@127.0.0.1", |
|
4ec59d547bff
Expand our test for purple_email_is_valid(). I stumbled across a large list
Mark Doliner <markdoliner@pidgin.im>
parents:
30149
diff
changeset
|
62 | /* "IPAndPort@127.0.0.1:25", */ |
|
4ec59d547bff
Expand our test for purple_email_is_valid(). I stumbled across a large list
Mark Doliner <markdoliner@pidgin.im>
parents:
30149
diff
changeset
|
63 | "subdomain@sub.domain.com", |
|
4ec59d547bff
Expand our test for purple_email_is_valid(). I stumbled across a large list
Mark Doliner <markdoliner@pidgin.im>
parents:
30149
diff
changeset
|
64 | "local@dash-inDomain.com", |
|
4ec59d547bff
Expand our test for purple_email_is_valid(). I stumbled across a large list
Mark Doliner <markdoliner@pidgin.im>
parents:
30149
diff
changeset
|
65 | "dot.inLocal@foo.com", |
|
4ec59d547bff
Expand our test for purple_email_is_valid(). I stumbled across a large list
Mark Doliner <markdoliner@pidgin.im>
parents:
30149
diff
changeset
|
66 | "a@singleLetterLocal.org", |
|
4ec59d547bff
Expand our test for purple_email_is_valid(). I stumbled across a large list
Mark Doliner <markdoliner@pidgin.im>
parents:
30149
diff
changeset
|
67 | "singleLetterDomain@x.org", |
|
4ec59d547bff
Expand our test for purple_email_is_valid(). I stumbled across a large list
Mark Doliner <markdoliner@pidgin.im>
parents:
30149
diff
changeset
|
68 | "&*=?^+{}'~@validCharsInLocal.net", |
|
31484
b7cfae50e10c
Add two valid email addresses to this list
Mark Doliner <markdoliner@pidgin.im>
parents:
31232
diff
changeset
|
69 | "foor@bar.newTLD", |
|
b7cfae50e10c
Add two valid email addresses to this list
Mark Doliner <markdoliner@pidgin.im>
parents:
31232
diff
changeset
|
70 | "HenryTheGreatWhiteCricket@live.ca", |
|
b7cfae50e10c
Add two valid email addresses to this list
Mark Doliner <markdoliner@pidgin.im>
parents:
31232
diff
changeset
|
71 | "HenryThe__WhiteCricket@hotmail.com" |
|
30440
4ec59d547bff
Expand our test for purple_email_is_valid(). I stumbled across a large list
Mark Doliner <markdoliner@pidgin.im>
parents:
30149
diff
changeset
|
72 | }; |
|
4ec59d547bff
Expand our test for purple_email_is_valid(). I stumbled across a large list
Mark Doliner <markdoliner@pidgin.im>
parents:
30149
diff
changeset
|
73 | |
|
37600
fce4d896285e
Add a bunch of util tests
Gary Kramlich <grim@reaperworld.com>
parents:
36049
diff
changeset
|
74 | static void |
|
fce4d896285e
Add a bunch of util tests
Gary Kramlich <grim@reaperworld.com>
parents:
36049
diff
changeset
|
75 | test_util_email_is_valid(void) { |
|
fce4d896285e
Add a bunch of util tests
Gary Kramlich <grim@reaperworld.com>
parents:
36049
diff
changeset
|
76 | size_t i; |
|
fce4d896285e
Add a bunch of util tests
Gary Kramlich <grim@reaperworld.com>
parents:
36049
diff
changeset
|
77 | |
|
fce4d896285e
Add a bunch of util tests
Gary Kramlich <grim@reaperworld.com>
parents:
36049
diff
changeset
|
78 | for (i = 0; i < G_N_ELEMENTS(valid_emails); i++) |
|
fce4d896285e
Add a bunch of util tests
Gary Kramlich <grim@reaperworld.com>
parents:
36049
diff
changeset
|
79 | g_assert_true(purple_email_is_valid(valid_emails[i])); |
|
fce4d896285e
Add a bunch of util tests
Gary Kramlich <grim@reaperworld.com>
parents:
36049
diff
changeset
|
80 | } |
|
fce4d896285e
Add a bunch of util tests
Gary Kramlich <grim@reaperworld.com>
parents:
36049
diff
changeset
|
81 | |
|
42866
4b201e18638f
Modernize most of the unit tests
Gary Kramlich <grim@reaperworld.com>
parents:
42842
diff
changeset
|
82 | const char *invalid_emails[] = { |
|
30442
a4f304b33d50
Oh, let's put our original test cases in the two arrays, to make things
Mark Doliner <markdoliner@pidgin.im>
parents:
30440
diff
changeset
|
83 | "purple-devel@@lists.sf.net", |
|
a4f304b33d50
Oh, let's put our original test cases in the two arrays, to make things
Mark Doliner <markdoliner@pidgin.im>
parents:
30440
diff
changeset
|
84 | "purple@devel@lists.sf.net", |
|
a4f304b33d50
Oh, let's put our original test cases in the two arrays, to make things
Mark Doliner <markdoliner@pidgin.im>
parents:
30440
diff
changeset
|
85 | "purple-devel@list..sf.net", |
|
a4f304b33d50
Oh, let's put our original test cases in the two arrays, to make things
Mark Doliner <markdoliner@pidgin.im>
parents:
30440
diff
changeset
|
86 | "purple-devel", |
|
a4f304b33d50
Oh, let's put our original test cases in the two arrays, to make things
Mark Doliner <markdoliner@pidgin.im>
parents:
30440
diff
changeset
|
87 | "purple-devel@", |
|
a4f304b33d50
Oh, let's put our original test cases in the two arrays, to make things
Mark Doliner <markdoliner@pidgin.im>
parents:
30440
diff
changeset
|
88 | "@lists.sf.net", |
|
a4f304b33d50
Oh, let's put our original test cases in the two arrays, to make things
Mark Doliner <markdoliner@pidgin.im>
parents:
30440
diff
changeset
|
89 | "totally bogus", |
|
30440
4ec59d547bff
Expand our test for purple_email_is_valid(). I stumbled across a large list
Mark Doliner <markdoliner@pidgin.im>
parents:
30149
diff
changeset
|
90 | "missingDomain@.com", |
|
4ec59d547bff
Expand our test for purple_email_is_valid(). I stumbled across a large list
Mark Doliner <markdoliner@pidgin.im>
parents:
30149
diff
changeset
|
91 | "@missingLocal.org", |
|
4ec59d547bff
Expand our test for purple_email_is_valid(). I stumbled across a large list
Mark Doliner <markdoliner@pidgin.im>
parents:
30149
diff
changeset
|
92 | "missingatSign.net", |
|
4ec59d547bff
Expand our test for purple_email_is_valid(). I stumbled across a large list
Mark Doliner <markdoliner@pidgin.im>
parents:
30149
diff
changeset
|
93 | "missingDot@com", |
|
4ec59d547bff
Expand our test for purple_email_is_valid(). I stumbled across a large list
Mark Doliner <markdoliner@pidgin.im>
parents:
30149
diff
changeset
|
94 | "two@@signs.com", |
|
4ec59d547bff
Expand our test for purple_email_is_valid(). I stumbled across a large list
Mark Doliner <markdoliner@pidgin.im>
parents:
30149
diff
changeset
|
95 | "colonButNoPort@127.0.0.1:", |
|
36049
bffbd724134d
Fix CWE-252 coverity issues
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35297
diff
changeset
|
96 | "", |
|
30440
4ec59d547bff
Expand our test for purple_email_is_valid(). I stumbled across a large list
Mark Doliner <markdoliner@pidgin.im>
parents:
30149
diff
changeset
|
97 | /* "someone-else@127.0.0.1.26", */ |
|
30444
d871c3fd6637
Catch some more invalid email addresses, thanks to Mark for additional
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
30442
diff
changeset
|
98 | ".localStartsWithDot@domain.com", |
|
d871c3fd6637
Catch some more invalid email addresses, thanks to Mark for additional
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
30442
diff
changeset
|
99 | /* "localEndsWithDot.@domain.com", */ /* I don't think this is invalid -- Stu */ |
|
d871c3fd6637
Catch some more invalid email addresses, thanks to Mark for additional
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
30442
diff
changeset
|
100 | /* "two..consecutiveDots@domain.com", */ /* I don't think this is invalid -- Stu */ |
|
d871c3fd6637
Catch some more invalid email addresses, thanks to Mark for additional
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
30442
diff
changeset
|
101 | "domainStartsWithDash@-domain.com", |
|
30440
4ec59d547bff
Expand our test for purple_email_is_valid(). I stumbled across a large list
Mark Doliner <markdoliner@pidgin.im>
parents:
30149
diff
changeset
|
102 | "domainEndsWithDash@domain-.com", |
|
4ec59d547bff
Expand our test for purple_email_is_valid(). I stumbled across a large list
Mark Doliner <markdoliner@pidgin.im>
parents:
30149
diff
changeset
|
103 | /* "numbersInTLD@domain.c0m", */ |
|
30444
d871c3fd6637
Catch some more invalid email addresses, thanks to Mark for additional
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
30442
diff
changeset
|
104 | /* "missingTLD@domain.", */ /* This certainly isn't invalid -- Stu */ |
|
30440
4ec59d547bff
Expand our test for purple_email_is_valid(). I stumbled across a large list
Mark Doliner <markdoliner@pidgin.im>
parents:
30149
diff
changeset
|
105 | "! \"#$%(),/;<>[]`|@invalidCharsInLocal.org", |
|
4ec59d547bff
Expand our test for purple_email_is_valid(). I stumbled across a large list
Mark Doliner <markdoliner@pidgin.im>
parents:
30149
diff
changeset
|
106 | "invalidCharsInDomain@! \"#$%(),/;<>_[]`|.org", |
|
4ec59d547bff
Expand our test for purple_email_is_valid(). I stumbled across a large list
Mark Doliner <markdoliner@pidgin.im>
parents:
30149
diff
changeset
|
107 | /* "local@SecondLevelDomainNamesAreInvalidIfTheyAreLongerThan64Charactersss.org" */ |
|
4ec59d547bff
Expand our test for purple_email_is_valid(). I stumbled across a large list
Mark Doliner <markdoliner@pidgin.im>
parents:
30149
diff
changeset
|
108 | }; |
|
4ec59d547bff
Expand our test for purple_email_is_valid(). I stumbled across a large list
Mark Doliner <markdoliner@pidgin.im>
parents:
30149
diff
changeset
|
109 | |
|
37600
fce4d896285e
Add a bunch of util tests
Gary Kramlich <grim@reaperworld.com>
parents:
36049
diff
changeset
|
110 | static void |
|
fce4d896285e
Add a bunch of util tests
Gary Kramlich <grim@reaperworld.com>
parents:
36049
diff
changeset
|
111 | test_util_email_is_invalid(void) { |
|
30440
4ec59d547bff
Expand our test for purple_email_is_valid(). I stumbled across a large list
Mark Doliner <markdoliner@pidgin.im>
parents:
30149
diff
changeset
|
112 | size_t i; |
|
4ec59d547bff
Expand our test for purple_email_is_valid(). I stumbled across a large list
Mark Doliner <markdoliner@pidgin.im>
parents:
30149
diff
changeset
|
113 | |
|
4ec59d547bff
Expand our test for purple_email_is_valid(). I stumbled across a large list
Mark Doliner <markdoliner@pidgin.im>
parents:
30149
diff
changeset
|
114 | for (i = 0; i < G_N_ELEMENTS(invalid_emails); i++) |
|
37600
fce4d896285e
Add a bunch of util tests
Gary Kramlich <grim@reaperworld.com>
parents:
36049
diff
changeset
|
115 | g_assert_false(purple_email_is_valid(invalid_emails[i])); |
| 15104 | 116 | } |
|
37600
fce4d896285e
Add a bunch of util tests
Gary Kramlich <grim@reaperworld.com>
parents:
36049
diff
changeset
|
117 | |
|
fce4d896285e
Add a bunch of util tests
Gary Kramlich <grim@reaperworld.com>
parents:
36049
diff
changeset
|
118 | /****************************************************************************** |
|
42565
c035e2eba80d
Fix several minor typos
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
42184
diff
changeset
|
119 | * MAIN |
|
37601
bf18c71d8508
Finish up the util unit tests
Gary Kramlich <grim@reaperworld.com>
parents:
37600
diff
changeset
|
120 | *****************************************************************************/ |
|
42866
4b201e18638f
Modernize most of the unit tests
Gary Kramlich <grim@reaperworld.com>
parents:
42842
diff
changeset
|
121 | int |
|
4b201e18638f
Modernize most of the unit tests
Gary Kramlich <grim@reaperworld.com>
parents:
42842
diff
changeset
|
122 | main(int argc, char **argv) { |
|
37600
fce4d896285e
Add a bunch of util tests
Gary Kramlich <grim@reaperworld.com>
parents:
36049
diff
changeset
|
123 | g_test_init(&argc, &argv, NULL); |
|
42866
4b201e18638f
Modernize most of the unit tests
Gary Kramlich <grim@reaperworld.com>
parents:
42842
diff
changeset
|
124 | g_test_set_nonfatal_assertions(); |
| 15104 | 125 | |
|
37600
fce4d896285e
Add a bunch of util tests
Gary Kramlich <grim@reaperworld.com>
parents:
36049
diff
changeset
|
126 | g_test_add_func("/util/filename/escape", |
|
fce4d896285e
Add a bunch of util tests
Gary Kramlich <grim@reaperworld.com>
parents:
36049
diff
changeset
|
127 | test_util_filename_escape); |
| 15104 | 128 | |
|
37600
fce4d896285e
Add a bunch of util tests
Gary Kramlich <grim@reaperworld.com>
parents:
36049
diff
changeset
|
129 | g_test_add_func("/util/email/is valid", |
|
fce4d896285e
Add a bunch of util tests
Gary Kramlich <grim@reaperworld.com>
parents:
36049
diff
changeset
|
130 | test_util_email_is_valid); |
|
fce4d896285e
Add a bunch of util tests
Gary Kramlich <grim@reaperworld.com>
parents:
36049
diff
changeset
|
131 | g_test_add_func("/util/email/is invalid", |
|
fce4d896285e
Add a bunch of util tests
Gary Kramlich <grim@reaperworld.com>
parents:
36049
diff
changeset
|
132 | test_util_email_is_invalid); |
| 15104 | 133 | |
|
37600
fce4d896285e
Add a bunch of util tests
Gary Kramlich <grim@reaperworld.com>
parents:
36049
diff
changeset
|
134 | return g_test_run(); |
| 15104 | 135 | } |