From 66b9e86eafc3709c491f96c917069db8b6a0c895 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 7 Jul 2006 15:33:31 +0200 Subject: Add support for checking test suite coverage using gcov. --- protocols/Makefile | 3 +++ protocols/jabber/Makefile | 1 + protocols/msn/Makefile | 3 +++ protocols/oscar/Makefile | 3 +++ protocols/yahoo/Makefile | 3 +++ 5 files changed, 13 insertions(+) (limited to 'protocols') diff --git a/protocols/Makefile b/protocols/Makefile index b74212f4..8f58ecd6 100644 --- a/protocols/Makefile +++ b/protocols/Makefile @@ -25,6 +25,9 @@ LFLAGS += -r # [SH] Phony targets all: protocols.o +check: all +gcov: + gcov *.c .PHONY: all clean distclean $(subdirs) diff --git a/protocols/jabber/Makefile b/protocols/jabber/Makefile index 9b414dc8..abfc7478 100644 --- a/protocols/jabber/Makefile +++ b/protocols/jabber/Makefile @@ -16,6 +16,7 @@ LFLAGS += -r # [SH] Phony targets all: jabber_mod.o +check: all .PHONY: all clean distclean diff --git a/protocols/msn/Makefile b/protocols/msn/Makefile index 873c831c..f53b34ba 100644 --- a/protocols/msn/Makefile +++ b/protocols/msn/Makefile @@ -16,6 +16,9 @@ LFLAGS += -r # [SH] Phony targets all: msn_mod.o +check: all +gcov: + gcov *.c .PHONY: all clean distclean diff --git a/protocols/oscar/Makefile b/protocols/oscar/Makefile index 97a27299..ed2d7f83 100644 --- a/protocols/oscar/Makefile +++ b/protocols/oscar/Makefile @@ -16,6 +16,9 @@ LFLAGS += -r # [SH] Phony targets all: oscar_mod.o +check: all +gcov: + gcov *.c .PHONY: all clean distclean diff --git a/protocols/yahoo/Makefile b/protocols/yahoo/Makefile index b4014f8a..34c3551a 100644 --- a/protocols/yahoo/Makefile +++ b/protocols/yahoo/Makefile @@ -16,6 +16,9 @@ LFLAGS += -r # [SH] Phony targets all: yahoo_mod.o +check: all +gcov: + gcov *.c .PHONY: all clean distclean -- cgit v1.2.3 From bd28e6a2eec0333a866ef2e380d32b1e6ad0c80b Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Tue, 24 Oct 2006 12:40:28 +0200 Subject: MSN message packets are now sent at once instead of separately. Probably the MSN servers don't care, but it looks a bit prettier in wireshark. ;-) --- protocols/msn/sb.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'protocols') diff --git a/protocols/msn/sb.c b/protocols/msn/sb.c index 63744cd0..7ec340bd 100644 --- a/protocols/msn/sb.c +++ b/protocols/msn/sb.c @@ -121,9 +121,10 @@ int msn_sb_sendmessage( struct msn_switchboard *sb, char *text ) { if( sb->ready ) { - char cmd[1024], *buf; + char *packet, *buf; int i, j; + /* Build the message. Convert LF to CR-LF for normal messages. */ if( strcmp( text, TYPING_NOTIFICATION_MESSAGE ) != 0 ) { buf = g_new0( char, sizeof( MSN_MESSAGE_HEADERS ) + strlen( text ) * 2 ); @@ -141,19 +142,21 @@ int msn_sb_sendmessage( struct msn_switchboard *sb, char *text ) else { i = strlen( MSN_TYPING_HEADERS ) + strlen( sb->gc->username ); - buf = g_new0( char, strlen( MSN_TYPING_HEADERS ) + strlen( sb->gc->username ) ); + buf = g_new0( char, i ); i = g_snprintf( buf, i, MSN_TYPING_HEADERS, sb->gc->username ); } - g_snprintf( cmd, sizeof( cmd ), "MSG %d N %d\r\n", ++sb->trId, i ); - if( msn_sb_write( sb, cmd, strlen( cmd ) ) && msn_sb_write( sb, buf, i ) ) + /* Build the final packet (MSG command + the message). */ + packet = g_strdup_printf( "MSG %d N %d\r\n%s", ++sb->trId, i, buf ); + g_free( buf ); + if( msn_sb_write( sb, packet, strlen( packet ) ) ) { - g_free( buf ); + g_free( packet ); return( 1 ); } else { - g_free( buf ); + g_free( packet ); return( 0 ); } } -- cgit v1.2.3 From a51be6448b7a6aa100f27873ce40b835068a66a7 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 6 Dec 2006 15:16:56 +0100 Subject: Fix gcov. --- protocols/jabber/Makefile | 2 ++ 1 file changed, 2 insertions(+) (limited to 'protocols') diff --git a/protocols/jabber/Makefile b/protocols/jabber/Makefile index abfc7478..27a29be4 100644 --- a/protocols/jabber/Makefile +++ b/protocols/jabber/Makefile @@ -17,6 +17,8 @@ LFLAGS += -r # [SH] Phony targets all: jabber_mod.o check: all +gcov: + gcov *.c .PHONY: all clean distclean -- cgit v1.2.3