Changes in / [bd28e6a:a3a3778]


Ignore:
Files:
3 added
19 edited

Legend:

Unmodified
Added
Removed
  • .bzrignore

    rbd28e6a ra3a3778  
    1313.gdb_history
    1414tests/check
     15*.gcda
     16*.gcov
     17*.gcno
     18*.o
  • Makefile

    rbd28e6a ra3a3778  
    4040clean: $(subdirs)
    4141        rm -f *.o $(OUTFILE) core utils/bitlbeed encode decode
     42        $(MAKE) -C tests clean
    4243
    4344distclean: clean $(subdirs)
    4445        rm -f Makefile.settings config.h bitlbee.pc
    4546        find . -name 'DEADJOE' -o -name '*.orig' -o -name '*.rej' -o -name '*~' -exec rm -f {} \;
     47        $(MAKE) -C test distclean
    4648
    47 check:
     49check: all
    4850        $(MAKE) -C tests
     51
     52gcov: check
     53        gcov *.c
    4954
    5055install-doc:
  • configure

    rbd28e6a ra3a3778  
    2828debug=0
    2929strip=1
     30gcov=0
    3031ipv6=1
    3132
     
    6768--debug=0/1     Disable/enable debugging                $debug
    6869--strip=0/1     Disable/enable binary stripping         $strip
     70--gcov=0/1      Disable/enable test coverage reporting  $gcov
    6971
    7072--ipv6=0/1      IPv6 socket support                     $ipv6
     
    366368fi
    367369
     370if [ "$gcov" = "1" ]; then
     371        echo "CFLAGS+=-ftest-coverage -fprofile-arcs" >> Makefile.settings
     372        echo "EFLAGS+=-lgcov" >> Makefile.settings
     373fi
     374
    368375echo
    369376if [ -z "$BITLBEE_VERSION" -a -d .bzr ] && type bzr > /dev/null 2> /dev/null; then
  • doc/user-guide/docbook.xsl

    rbd28e6a ra3a3778  
    8383
    8484        <xsl:template name="cmd">
     85                <xsl:param name="prefix"/>
    8586                <xsl:variable name="thiscmd"><xsl:value-of select="$prefix"/><xsl:value-of select="@name"/></xsl:variable>
    8687                <xsl:attribute name="id">
  • doc/user-guide/help.xsl

    rbd28e6a ra3a3778  
    3131
    3232        <xsl:template name="subject">
     33                <xsl:param name="id"/>
    3334                <xsl:message><xsl:text>Processing: </xsl:text><xsl:value-of select="$id"/></xsl:message>
    3435                <xsl:text>?</xsl:text><xsl:value-of select="$id"/><xsl:text>&#10;</xsl:text>
     
    122123
    123124        <xsl:template name="cmd">
     125                <xsl:param name="prefix"/>
    124126                <xsl:variable name="thiscmd"><xsl:value-of select="$prefix"/><xsl:value-of select="@name"/></xsl:variable>
    125127                <xsl:message><xsl:text>Processing command '</xsl:text><xsl:value-of select="$thiscmd"/><xsl:text>'</xsl:text></xsl:message>
  • ipc.c

    rbd28e6a ra3a3778  
    9999        { "die",        0, ipc_master_cmd_die,        0 },
    100100        { "wallops",    1, NULL,                      IPC_CMD_TO_CHILDREN },
    101         { "lilo",       1, NULL,                      IPC_CMD_TO_CHILDREN },
     101        { "wall",       1, NULL,                      IPC_CMD_TO_CHILDREN },
    102102        { "opermsg",    1, NULL,                      IPC_CMD_TO_CHILDREN },
    103103        { "rehash",     0, ipc_master_cmd_rehash,     0 },
     
    122122}
    123123
    124 static void ipc_child_cmd_lilo( irc_t *irc, char **cmd )
     124static void ipc_child_cmd_wall( irc_t *irc, char **cmd )
    125125{
    126126        if( !( irc->status & USTATUS_LOGGED_IN ) )
     
    175175        { "die",        0, ipc_child_cmd_die,         0 },
    176176        { "wallops",    1, ipc_child_cmd_wallops,     0 },
    177         { "lilo",       1, ipc_child_cmd_lilo,        0 },
     177        { "wall",       1, ipc_child_cmd_wall,        0 },
    178178        { "opermsg",    1, ipc_child_cmd_opermsg,     0 },
    179179        { "rehash",     0, ipc_child_cmd_rehash,      0 },
  • irc.c

    rbd28e6a ra3a3778  
    585585                   the queue. If it's FALSE, we emptied the buffer and saved ourselves some work
    586586                   in the event queue. */
    587                 if( bitlbee_io_current_client_write( irc, irc->fd, GAIM_INPUT_WRITE ) )
    588                         irc->w_watch_source_id = b_input_add( irc->fd, GAIM_INPUT_WRITE, bitlbee_io_current_client_write, irc );
     587                /* Really can't be done as long as the code doesn't do error checking very well:
     588                if( bitlbee_io_current_client_write( irc, irc->fd, GAIM_INPUT_WRITE ) ) */
     589               
     590                /* So just always do it via the event handler. */
     591                irc->w_watch_source_id = b_input_add( irc->fd, GAIM_INPUT_WRITE, bitlbee_io_current_client_write, irc );
    589592        }
    590593       
  • irc_commands.c

    rbd28e6a ra3a3778  
    593593        { "die",         0, NULL,                IRC_CMD_OPER_ONLY | IRC_CMD_TO_MASTER },
    594594        { "wallops",     1, NULL,                IRC_CMD_OPER_ONLY | IRC_CMD_TO_MASTER },
    595         { "lilo",        1, NULL,                IRC_CMD_OPER_ONLY | IRC_CMD_TO_MASTER },
     595        { "wall",        1, NULL,                IRC_CMD_OPER_ONLY | IRC_CMD_TO_MASTER },
    596596        { "rehash",      0, irc_cmd_rehash,      IRC_CMD_OPER_ONLY },
    597597        { "restart",     0, NULL,                IRC_CMD_OPER_ONLY | IRC_CMD_TO_MASTER },
  • lib/Makefile

    rbd28e6a ra3a3778  
    1717# [SH] Phony targets
    1818all: lib.o
     19check: all
     20gcov:
     21        gcov *.c
    1922
    2023.PHONY: all clean distclean
  • protocols/Makefile

    rbd28e6a ra3a3778  
    2626# [SH] Phony targets
    2727all: protocols.o
     28check: all
     29gcov:
     30        gcov *.c
    2831
    2932.PHONY: all clean distclean $(subdirs)
  • protocols/jabber/Makefile

    rbd28e6a ra3a3778  
    1717# [SH] Phony targets
    1818all: jabber_mod.o
     19check: all
     20gcov:
     21        gcov *.c
    1922
    2023.PHONY: all clean distclean
  • protocols/msn/Makefile

    rbd28e6a ra3a3778  
    1717# [SH] Phony targets
    1818all: msn_mod.o
     19check: all
     20gcov:
     21        gcov *.c
    1922       
    2023.PHONY: all clean distclean
  • protocols/oscar/Makefile

    rbd28e6a ra3a3778  
    1717# [SH] Phony targets
    1818all: oscar_mod.o
     19check: all
     20gcov:
     21        gcov *.c
    1922
    2023.PHONY: all clean distclean
  • protocols/yahoo/Makefile

    rbd28e6a ra3a3778  
    1717# [SH] Phony targets
    1818all: yahoo_mod.o
     19check: all
     20gcov:
     21        gcov *.c
    1922
    2023.PHONY: all clean distclean
  • storage_xml.c

    rbd28e6a ra3a3778  
    395395       
    396396        strcat( path, "~" );
    397         if( ( fd = open( path, O_WRONLY | O_CREAT, 0600 ) ) < 0 )
     397        if( ( fd = open( path, O_WRONLY | O_CREAT | O_TRUNC, 0600 ) ) < 0 )
    398398        {
    399399                irc_usermsg( irc, "Error while opening configuration file." );
  • tests/Makefile

    rbd28e6a ra3a3778  
    33LFLAGS +=-lcheck
    44
    5 all: check
    6         ./check
     5all: check 
     6        ./check $(CHECKFLAGS)
    77
    8 main_objs = account.o bitlbee.o conf.o crypting.o help.o ini.o ipc.o irc.o irc_commands.o log.o nick.o query.o root_commands.o set.o storage.o storage_text.o url.o user.o util.o
     8clean:
     9        rm -f check *.o
    910
    10 check: check.o check_util.o check_nick.o $(addprefix ../, $(main_objs)) ../protocols/protocols.o
     11main_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
     12
     13test_objs = check.o check_util.o check_nick.o check_md5.o check_irc.o
     14
     15check: $(test_objs) $(addprefix ../, $(main_objs)) ../protocols/protocols.o ../lib/lib.o
    1116        @echo '*' Linking $@
    1217        @$(CC) $(CFLAGS) -o $@ $^ $(LFLAGS) $(EFLAGS)
  • tests/check.c

    rbd28e6a ra3a3778  
    44#include <check.h>
    55#include "bitlbee.h"
     6#include "testsuite.h"
    67
    78global_t global;        /* Against global namespace pollution */
     9
     10gboolean g_io_channel_pair(GIOChannel **ch1, GIOChannel **ch2)
     11{
     12        int sock[2];
     13        if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNIX, sock) < 0) {
     14                perror("socketpair");
     15                return FALSE;
     16        }
     17
     18        *ch1 = g_io_channel_unix_new(sock[0]);
     19        *ch2 = g_io_channel_unix_new(sock[1]);
     20        return TRUE;
     21}
    822
    923double gettime()
     
    2135Suite *nick_suite(void);
    2236
    23 int main (void)
     37/* From check_md5.c */
     38Suite *md5_suite(void);
     39
     40/* From check_irc.c */
     41Suite *irc_suite(void);
     42
     43int main (int argc, char **argv)
    2444{
    2545        int nf;
    26         SRunner *sr = srunner_create(util_suite());
     46        SRunner *sr;
     47        GOptionContext *pc;
     48        gboolean no_fork = FALSE;
     49        gboolean verbose = FALSE;
     50        GOptionEntry options[] = {
     51                {"no-fork", 'n', 0, G_OPTION_ARG_NONE, &no_fork, "Don't fork" },
     52                {"verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose, "Be verbose", NULL },
     53                { NULL }
     54        };
     55        int i;
     56
     57        pc = g_option_context_new("");
     58        g_option_context_add_main_entries(pc, options, NULL);
     59
     60        if(!g_option_context_parse(pc, &argc, &argv, NULL))
     61                return 1;
     62
     63        g_option_context_free(pc);
     64
     65        log_init();
     66
     67        if (verbose) {
     68                log_link( LOGLVL_ERROR, LOGOUTPUT_CONSOLE );
     69                log_link( LOGLVL_DEBUG, LOGOUTPUT_CONSOLE );
     70                log_link( LOGLVL_INFO, LOGOUTPUT_CONSOLE );
     71                log_link( LOGLVL_WARNING, LOGOUTPUT_CONSOLE );
     72        }
     73
     74        global.conf = conf_load( 0, NULL);
     75        global.conf->runmode = RUNMODE_DAEMON;
     76
     77        sr = srunner_create(util_suite());
    2778        srunner_add_suite(sr, nick_suite());
    28         srunner_run_all (sr, CK_NORMAL);
     79        srunner_add_suite(sr, md5_suite());
     80        srunner_add_suite(sr, irc_suite());
     81        if (no_fork)
     82                srunner_set_fork_status(sr, CK_NOFORK);
     83        srunner_run_all (sr, verbose?CK_VERBOSE:CK_NORMAL);
    2984        nf = srunner_ntests_failed(sr);
    3085        srunner_free(sr);
  • tests/check_nick.c

    rbd28e6a ra3a3778  
    66#include "irc.h"
    77#include "set.h"
    8 #include "util.h"
     8#include "misc.h"
    99
    1010START_TEST(test_nick_strip)
     
    2323
    2424        for (i = 0; get[i]; i++) {
    25                 char copy[30];
     25                char copy[60];
    2626                strcpy(copy, get[i]);
    2727                nick_strip(copy);
  • tests/check_util.c

    rbd28e6a ra3a3778  
    66#include "irc.h"
    77#include "set.h"
    8 #include "util.h"
     8#include "misc.h"
    99
    1010START_TEST(test_strip_linefeed)
Note: See TracChangeset for help on using the changeset viewer.