Changeset 5ebff60 for tests/check.c


Ignore:
Timestamp:
2015-02-20T22:50:54Z (9 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
0b9daac, 3d45471, 7733b8c
Parents:
af359b4
git-author:
Indent <please@…> (19-02-15 05:47:20)
git-committer:
dequis <dx@…> (20-02-15 22:50:54)
Message:

Reindent everything to K&R style with tabs

Used uncrustify, with the configuration file in ./doc/uncrustify.cfg

Commit author set to "Indent <please@…>" so that it's easier to
skip while doing git blame.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/check.c

    raf359b4 r5ebff60  
    88#include "testsuite.h"
    99
    10 global_t global;        /* Against global namespace pollution */
     10global_t global;        /* Against global namespace pollution */
    1111
    1212gboolean g_io_channel_pair(GIOChannel **ch1, GIOChannel **ch2)
    1313{
    1414        int sock[2];
     15
    1516        if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNIX, sock) < 0) {
    1617                perror("socketpair");
     
    2728        irc_t *irc;
    2829        GIOChannel *ch1, *ch2;
    29         if (!g_io_channel_pair(&ch1, &ch2))
     30
     31        if (!g_io_channel_pair(&ch1, &ch2)) {
    3032                return NULL;
     33        }
    3134        irc = irc_new(g_io_channel_unix_get_fd(ch1));
    3235        return irc;
     
    3740        struct timeval time[1];
    3841
    39         gettimeofday( time, 0 );
    40         return( (double) time->tv_sec + (double) time->tv_usec / 1000000 );
     42        gettimeofday(time, 0);
     43        return((double) time->tv_sec + (double) time->tv_usec / 1000000);
    4144}
    4245
     
    7174Suite *jabber_util_suite(void);
    7275
    73 int main (int argc, char **argv)
     76int main(int argc, char **argv)
    7477{
    7578        int nf;
     
    7982        gboolean verbose = FALSE;
    8083        GOptionEntry options[] = {
    81                 {"no-fork", 'n', 0, G_OPTION_ARG_NONE, &no_fork, "Don't fork" },
    82                 {"verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose, "Be verbose", NULL },
     84                { "no-fork", 'n', 0, G_OPTION_ARG_NONE, &no_fork, "Don't fork" },
     85                { "verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose, "Be verbose", NULL },
    8386                { NULL }
    8487        };
     
    8790        g_option_context_add_main_entries(pc, options, NULL);
    8891
    89         if(!g_option_context_parse(pc, &argc, &argv, NULL))
     92        if (!g_option_context_parse(pc, &argc, &argv, NULL)) {
    9093                return 1;
     94        }
    9195
    9296        g_option_context_free(pc);
     
    97101
    98102        if (verbose) {
    99                 log_link( LOGLVL_ERROR, LOGOUTPUT_CONSOLE );
     103                log_link(LOGLVL_ERROR, LOGOUTPUT_CONSOLE);
    100104#ifdef DEBUG
    101                 log_link( LOGLVL_DEBUG, LOGOUTPUT_CONSOLE );
     105                log_link(LOGLVL_DEBUG, LOGOUTPUT_CONSOLE);
    102106#endif
    103                 log_link( LOGLVL_INFO, LOGOUTPUT_CONSOLE );
    104                 log_link( LOGLVL_WARNING, LOGOUTPUT_CONSOLE );
     107                log_link(LOGLVL_INFO, LOGOUTPUT_CONSOLE);
     108                log_link(LOGLVL_WARNING, LOGOUTPUT_CONSOLE);
    105109        }
    106110
    107         global.conf = conf_load( 0, NULL);
     111        global.conf = conf_load(0, NULL);
    108112        global.conf->runmode = RUNMODE_DAEMON;
    109113
     
    118122        srunner_add_suite(sr, jabber_sasl_suite());
    119123        srunner_add_suite(sr, jabber_util_suite());
    120         if (no_fork)
     124        if (no_fork) {
    121125                srunner_set_fork_status(sr, CK_NOFORK);
    122         srunner_run_all (sr, verbose?CK_VERBOSE:CK_NORMAL);
     126        }
     127        srunner_run_all(sr, verbose ? CK_VERBOSE : CK_NORMAL);
    123128        nf = srunner_ntests_failed(sr);
    124129        srunner_free(sr);
Note: See TracChangeset for help on using the changeset viewer.