source: tests/check_user.c @ 15a8c94

Last change on this file since 15a8c94 was e88fe7da, checked in by Veres Lajos <vlajos@…>, at 2015-08-07T21:53:25Z

typofix - https://github.com/vlajos/misspell_fixer

  • Property mode set to 100644
File size: 1.8 KB
Line 
1#include <stdlib.h>
2#include <glib.h>
3#include <gmodule.h>
4#include <check.h>
5#include <string.h>
6#include "bitlbee.h"
7#include "testsuite.h"
8
9#if 0
10START_TEST(test_user_add)
11irc_t * irc = torture_irc();
12user_t *user;
13user = user_add(irc, "foo");
14fail_if(user == NULL);
15fail_if(strcmp(user->nick, "foo") != 0);
16fail_unless(user_find(irc, "foo") == user);
17END_TEST
18
19START_TEST(test_user_add_exists)
20irc_t * irc = torture_irc();
21user_t *user;
22user = user_add(irc, "foo");
23fail_if(user == NULL);
24user = user_add(irc, "foo");
25fail_unless(user == NULL);
26END_TEST
27
28START_TEST(test_user_add_invalid)
29irc_t * irc = torture_irc();
30user_t *user;
31user = user_add(irc, ":foo");
32fail_unless(user == NULL);
33END_TEST
34
35START_TEST(test_user_del_invalid)
36irc_t * irc = torture_irc();
37fail_unless(user_del(irc, ":foo") == 0);
38END_TEST
39
40START_TEST(test_user_del)
41irc_t * irc = torture_irc();
42user_t *user;
43user = user_add(irc, "foo");
44fail_unless(user_del(irc, "foo") == 1);
45fail_unless(user_find(irc, "foo") == NULL);
46END_TEST
47
48START_TEST(test_user_del_nonexistent)
49irc_t * irc = torture_irc();
50fail_unless(user_del(irc, "foo") == 0);
51END_TEST
52
53START_TEST(test_user_rename)
54irc_t * irc = torture_irc();
55user_t *user;
56user = user_add(irc, "foo");
57user_rename(irc, "foo", "bar");
58fail_unless(user_find(irc, "foo") == NULL);
59fail_if(user_find(irc, "bar") == NULL);
60END_TEST
61#endif
62Suite *user_suite(void)
63{
64        Suite *s = suite_create("User");
65        TCase *tc_core = tcase_create("Core");
66
67        suite_add_tcase(s, tc_core);
68#if 0
69        tcase_add_test(tc_core, test_user_add);
70        tcase_add_test(tc_core, test_user_add_invalid);
71        tcase_add_test(tc_core, test_user_add_exists);
72        tcase_add_test(tc_core, test_user_del_invalid);
73        tcase_add_test(tc_core, test_user_del_nonexistent);
74        tcase_add_test(tc_core, test_user_del);
75        tcase_add_test(tc_core, test_user_rename);
76#endif
77        return s;
78}
Note: See TracBrowser for help on using the repository browser.