rename accountopt.[ch] to purpleaccountoption.[ch]
[pidgin-git.git] / libpurple / protocols / oscar / tests / test_oscar_util.c
blob50f3738d41dca31205b81094d1ef1f6a2de1f024
1 #include <glib.h>
3 #include "../oscar.h"
5 static void
6 test_oscar_util_name_compare(void) {
7 gsize i;
8 const gchar *good[] = {
9 "test",
10 "TEST",
11 "Test",
12 "teSt",
13 " TesT",
14 "test ",
15 " T E s T "
17 const gchar *bad[] = {
18 "toast",
19 "test@example.com",
20 "test@aim.com"
23 for(i = 0; i < G_N_ELEMENTS(good); i++) {
24 g_assert_cmpint(0, ==, oscar_util_name_compare("test", good[i]));
25 g_assert_cmpint(0, ==, oscar_util_name_compare(good[i], "test"));
28 for(i = 0; i < G_N_ELEMENTS(bad); i++) {
29 g_assert_cmpint(0, !=, oscar_util_name_compare("test", bad[i]));
30 g_assert_cmpint(0, !=, oscar_util_name_compare(bad[i], "test"));
34 gint
35 main(gint argc, gchar **argv) {
36 g_test_init(&argc, &argv, NULL);
38 g_test_add_func("/oscar/util/name compare",
39 test_oscar_util_name_compare);
41 return g_test_run();