Remove useless comparison
[pidgin-git.git] / libpurple / tests / test_oscar_util.c
blob380c9ec4f0f1eed2135924bedb8898b1d0bdf599
1 #include <string.h>
3 #include "tests.h"
4 #include "../protocols/oscar/oscar.h"
6 START_TEST(test_oscar_util_name_compare)
8 size_t i;
9 const char *good[] = {
10 "test",
11 "TEST",
12 "Test",
13 "teSt",
14 " TesT",
15 "test ",
16 " T E s T "
18 const char *bad[] = {
19 "toast",
20 "test@example.com",
21 "test@aim.com"
24 for (i = 0; i < G_N_ELEMENTS(good); i++) {
25 ck_assert_int_eq(0, oscar_util_name_compare("test", good[i]));
26 ck_assert_int_eq(0, oscar_util_name_compare(good[i], "test"));
28 for (i = 0; i < G_N_ELEMENTS(bad); i++) {
29 ck_assert_int_ne(0, oscar_util_name_compare("test", bad[i]));
30 ck_assert_int_ne(0, oscar_util_name_compare(bad[i], "test"));
33 END_TEST
35 Suite *oscar_util_suite(void)
37 Suite *s;
38 TCase *tc;
40 s = suite_create("OSCAR Utility Functions");
42 tc = tcase_create("Convert IM from network format to HTML");
43 tcase_add_test(tc, test_oscar_util_name_compare);
44 suite_add_tcase(s, tc);
46 return s;