tests: add client util make_local_person_oper()

This commit is contained in:
Simon Arlott 2017-08-05 14:14:53 +01:00
parent d2b5f4111b
commit 6af47466a8
No known key found for this signature in database
GPG key ID: C8975F2043CA5D24
3 changed files with 12 additions and 15 deletions

View file

@ -60,6 +60,13 @@ struct Client *make_local_person_full(const char *nick, const char *username, co
return client;
}
void make_local_person_oper(struct Client *client)
{
rb_dlinkAddAlloc(client, &local_oper_list);
rb_dlinkAddAlloc(client, &oper_list);
SetOper(client);
}
void remove_local_person(struct Client *client)
{
exit_client(NULL, client, &me, "Test client removed");

View file

@ -41,6 +41,7 @@ void client_util_free(void);
struct Client *make_local_person(void);
struct Client *make_local_person_nick(const char *nick);
struct Client *make_local_person_full(const char *nick, const char *username, const char *hostname, const char *ip, const char *realname);
void make_local_person_oper(struct Client *client);
void remove_local_person(struct Client *client);
char *get_client_sendq(const struct Client *client);

View file

@ -49,21 +49,10 @@ static void sendto_wallops_flags1(void)
struct Client *oper3 = make_local_person_nick("oper3");
struct Client *oper4 = make_local_person_nick("oper4");
rb_dlinkAddAlloc(oper1, &local_oper_list);
rb_dlinkAddAlloc(oper1, &oper_list);
SetOper(oper1);
rb_dlinkAddAlloc(oper2, &local_oper_list);
rb_dlinkAddAlloc(oper2, &oper_list);
SetOper(oper2);
rb_dlinkAddAlloc(oper3, &local_oper_list);
rb_dlinkAddAlloc(oper3, &oper_list);
SetOper(oper3);
rb_dlinkAddAlloc(oper4, &local_oper_list);
rb_dlinkAddAlloc(oper4, &oper_list);
SetOper(oper4);
make_local_person_oper(oper1);
make_local_person_oper(oper2);
make_local_person_oper(oper3);
make_local_person_oper(oper4);
user1->umodes |= UMODE_WALLOP;
oper1->umodes |= UMODE_WALLOP | UMODE_OPERWALL;