Changeset ed5df81


Ignore:
Timestamp:
2007-01-21T21:17:11Z (18 years ago)
Author:
Jelmer Vernooij <jelmer@…>
Branches:
master
Children:
8c073a6
Parents:
7bee5af
Message:

Add unit testing for user code

Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • tests/Makefile

    r7bee5af red5df81  
    1111main_objs = account.o bitlbee.o conf.o crypting.o help.o ipc.o irc.o irc_commands.o log.o nick.o query.o root_commands.o set.o storage.o storage_xml.o storage_text.o user.o
    1212
    13 test_objs = check.o check_util.o check_nick.o check_md5.o check_irc.o check_help.o
     13test_objs = check.o check_util.o check_nick.o check_md5.o check_irc.o check_help.o check_user.o
    1414
    1515check: $(test_objs) $(addprefix ../, $(main_objs)) ../protocols/protocols.o ../lib/lib.o
  • tests/check.c

    r7bee5af red5df81  
    1919        *ch2 = g_io_channel_unix_new(sock[1]);
    2020        return TRUE;
     21}
     22
     23irc_t *torture_irc(void)
     24{
     25        irc_t *irc;
     26        GIOChannel *ch1, *ch2;
     27        if (!g_io_channel_pair(&ch1, &ch2))
     28                return NULL;
     29        irc = irc_new(g_io_channel_unix_get_fd(ch1));
     30        return irc;
    2131}
    2232
     
    4353/* From check_help.c */
    4454Suite *help_suite(void);
     55
     56/* From check_user.c */
     57Suite *user_suite(void);
    4558
    4659int main (int argc, char **argv)
     
    8598        srunner_add_suite(sr, irc_suite());
    8699        srunner_add_suite(sr, help_suite());
     100        srunner_add_suite(sr, user_suite());
    87101        if (no_fork)
    88102                srunner_set_fork_status(sr, CK_NOFORK);
  • tests/testsuite.h

    r7bee5af red5df81  
    22#define __BITLBEE_CHECK_H__
    33
     4irc_t *torture_irc(void);
    45gboolean g_io_channel_pair(GIOChannel **ch1, GIOChannel **ch2);
    56
  • user.h

    r7bee5af red5df81  
    2323  Suite 330, Boston, MA  02111-1307  USA
    2424*/
     25#ifndef __USER_H__
     26#define __USER_H__
    2527
    2628typedef struct __USER
     
    5658G_MODULE_EXPORT user_t *user_findhandle( struct gaim_connection *gc, char *handle );
    5759void user_rename( irc_t *irc, char *oldnick, char *newnick );
     60
     61#endif /* __USER_H__ */
Note: See TracChangeset for help on using the changeset viewer.