Changes in / [ae3c4fa:f7b44f2]
- Files:
-
- 4 deleted
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
Makefile
rae3c4fa rf7b44f2 50 50 $(MAKE) -C tests 51 51 52 lcov:53 52 gcov: check 54 53 gcov *.c 55 56 lcov: check57 lcov --directory . --capture --output-file bitlbee.info58 genhtml -o coverage bitlbee.info59 54 60 55 install-doc: -
help.c
rae3c4fa rf7b44f2 31 31 #define BUFSIZE 1100 32 32 33 help_t *help_init( help_t **help , const char *helpfile)33 help_t *help_init( help_t **help ) 34 34 { 35 35 int i, buflen = 0; … … 41 41 *help = h = g_new0 ( help_t, 1 ); 42 42 43 h->fd = open( helpfile, O_RDONLY43 h->fd = open( global.helpfile, O_RDONLY 44 44 #ifdef _WIN32 45 45 | O_BINARY … … 109 109 help_t *h; 110 110 111 for( h = *help; h; h = h->next ) 111 h=*help; 112 113 while( h ) 112 114 { 113 if( h->string != NULL && 114 g_strcasecmp( h->string, string ) == 0 ) 115 break; 115 if( g_strcasecmp( h->string, string ) == 0 ) break; 116 h = h->next; 116 117 } 117 118 if( h && h->length > 0 ) -
help.h
rae3c4fa rf7b44f2 43 43 } help_t; 44 44 45 help_t *help_init( help_t **help , const char *helpfile);45 help_t *help_init( help_t **help ); 46 46 char *help_get( help_t **help, char *string ); 47 47 -
lib/Makefile
rae3c4fa rf7b44f2 18 18 all: lib.o 19 19 check: all 20 lcov:21 20 gcov: 22 21 gcov *.c -
protocols/Makefile
rae3c4fa rf7b44f2 27 27 all: protocols.o 28 28 check: all 29 lcov:30 29 gcov: 31 30 gcov *.c -
protocols/jabber/Makefile
rae3c4fa rf7b44f2 18 18 all: jabber_mod.o 19 19 check: all 20 lcov:21 20 gcov: 22 21 gcov *.c -
protocols/msn/Makefile
rae3c4fa rf7b44f2 18 18 all: msn_mod.o 19 19 check: all 20 lcov:21 20 gcov: 22 21 gcov *.c -
protocols/oscar/Makefile
rae3c4fa rf7b44f2 18 18 all: oscar_mod.o 19 19 check: all 20 lcov:21 20 gcov: 22 21 gcov *.c -
protocols/yahoo/Makefile
rae3c4fa rf7b44f2 18 18 all: yahoo_mod.o 19 19 check: all 20 lcov:21 20 gcov: 22 21 gcov *.c -
set.h
rae3c4fa rf7b44f2 23 23 Suite 330, Boston, MA 02111-1307 USA 24 24 */ 25 26 #ifndef __SET_H__27 #define __SET_H__28 29 struct set;30 25 31 26 /* This used to be specific to irc_t structures, but it's more generic now … … 97 92 char *set_eval_ops( set_t *set, char *value ); 98 93 char *set_eval_charset( set_t *set, char *value ); 99 100 #endif /* __SET_H__ */ -
tests/Makefile
rae3c4fa rf7b44f2 13 13 main_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 14 14 15 test_objs = check.o check_util.o check_nick.o check_md5.o check_irc.o check_help.o check_user.o check_crypting.o check_set.o15 test_objs = check.o check_util.o check_nick.o check_md5.o check_irc.o 16 16 17 17 check: $(test_objs) $(addprefix ../, $(main_objs)) ../protocols/protocols.o ../lib/lib.o -
tests/check.c
rae3c4fa rf7b44f2 21 21 } 22 22 23 irc_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;31 }32 33 23 double gettime() 34 24 { … … 50 40 /* From check_irc.c */ 51 41 Suite *irc_suite(void); 52 53 /* From check_help.c */54 Suite *help_suite(void);55 56 /* From check_user.c */57 Suite *user_suite(void);58 59 /* From check_crypting.c */60 Suite *crypting_suite(void);61 62 /* From check_set.c */63 Suite *set_suite(void);64 42 65 43 int main (int argc, char **argv) … … 89 67 if (verbose) { 90 68 log_link( LOGLVL_ERROR, LOGOUTPUT_CONSOLE ); 91 #ifdef DEBUG92 69 log_link( LOGLVL_DEBUG, LOGOUTPUT_CONSOLE ); 93 #endif94 70 log_link( LOGLVL_INFO, LOGOUTPUT_CONSOLE ); 95 71 log_link( LOGLVL_WARNING, LOGOUTPUT_CONSOLE ); … … 103 79 srunner_add_suite(sr, md5_suite()); 104 80 srunner_add_suite(sr, irc_suite()); 105 srunner_add_suite(sr, help_suite());106 srunner_add_suite(sr, user_suite());107 srunner_add_suite(sr, crypting_suite());108 srunner_add_suite(sr, set_suite());109 81 if (no_fork) 110 82 srunner_set_fork_status(sr, CK_NOFORK); -
tests/check_util.c
rae3c4fa rf7b44f2 7 7 #include "set.h" 8 8 #include "misc.h" 9 #include "url.h"10 9 11 10 START_TEST(test_strip_linefeed) … … 44 43 END_TEST 45 44 46 START_TEST(test_set_url_http)47 url_t url;48 49 fail_if (0 == url_set(&url, "http://host/"));50 fail_unless (!strcmp(url.host, "host"));51 fail_unless (!strcmp(url.file, "/"));52 fail_unless (!strcmp(url.user, ""));53 fail_unless (!strcmp(url.pass, ""));54 fail_unless (url.proto == PROTO_HTTP);55 fail_unless (url.port == 80);56 END_TEST57 58 START_TEST(test_set_url_https)59 url_t url;60 61 fail_if (0 == url_set(&url, "https://ahost/AimeeMann"));62 fail_unless (!strcmp(url.host, "ahost"));63 fail_unless (!strcmp(url.file, "/AimeeMann"));64 fail_unless (!strcmp(url.user, ""));65 fail_unless (!strcmp(url.pass, ""));66 fail_unless (url.proto == PROTO_HTTPS);67 fail_unless (url.port == 443);68 END_TEST69 70 START_TEST(test_set_url_port)71 url_t url;72 73 fail_if (0 == url_set(&url, "https://ahost:200/Lost/In/Space"));74 fail_unless (!strcmp(url.host, "ahost"));75 fail_unless (!strcmp(url.file, "/Lost/In/Space"));76 fail_unless (!strcmp(url.user, ""));77 fail_unless (!strcmp(url.pass, ""));78 fail_unless (url.proto == PROTO_HTTPS);79 fail_unless (url.port == 200);80 END_TEST81 82 START_TEST(test_set_url_username)83 url_t url;84 85 fail_if (0 == url_set(&url, "socks4://user@ahost/Space"));86 fail_unless (!strcmp(url.host, "ahost"));87 fail_unless (!strcmp(url.file, "/Space"));88 fail_unless (!strcmp(url.user, "user"));89 fail_unless (!strcmp(url.pass, ""));90 fail_unless (url.proto == PROTO_SOCKS4);91 fail_unless (url.port == 1080);92 END_TEST93 94 START_TEST(test_set_url_username_pwd)95 url_t url;96 97 fail_if (0 == url_set(&url, "socks5://user:pass@ahost/"));98 fail_unless (!strcmp(url.host, "ahost"));99 fail_unless (!strcmp(url.file, "/"));100 fail_unless (!strcmp(url.user, "user"));101 fail_unless (!strcmp(url.pass, "pass"));102 fail_unless (url.proto == PROTO_SOCKS5);103 fail_unless (url.port == 1080);104 END_TEST105 106 45 Suite *util_suite (void) 107 46 { … … 111 50 tcase_add_test (tc_core, test_strip_linefeed); 112 51 tcase_add_test (tc_core, test_strip_newlines); 113 tcase_add_test (tc_core, test_set_url_http);114 tcase_add_test (tc_core, test_set_url_https);115 tcase_add_test (tc_core, test_set_url_port);116 tcase_add_test (tc_core, test_set_url_username);117 tcase_add_test (tc_core, test_set_url_username_pwd);118 52 return s; 119 53 } -
tests/testsuite.h
rae3c4fa rf7b44f2 2 2 #define __BITLBEE_CHECK_H__ 3 3 4 #include "irc.h"5 6 irc_t *torture_irc(void);7 4 gboolean g_io_channel_pair(GIOChannel **ch1, GIOChannel **ch2); 8 5 -
unix.c
rae3c4fa rf7b44f2 112 112 if( !getuid() || !geteuid() ) 113 113 log_message( LOGLVL_WARNING, "BitlBee is running with root privileges. Why?" ); 114 if( help_init( &(global.help) , global.helpfile) == NULL )114 if( help_init( &(global.help) ) == NULL ) 115 115 log_message( LOGLVL_WARNING, "Error opening helpfile %s.", HELP_FILE ); 116 116 -
user.h
rae3c4fa rf7b44f2 23 23 Suite 330, Boston, MA 02111-1307 USA 24 24 */ 25 #ifndef __USER_H__26 #define __USER_H__27 25 28 26 typedef struct __USER … … 58 56 G_MODULE_EXPORT user_t *user_findhandle( struct im_connection *ic, char *handle ); 59 57 void user_rename( irc_t *irc, char *oldnick, char *newnick ); 60 61 #endif /* __USER_H__ */
Note: See TracChangeset
for help on using the changeset viewer.