comparison tests/testmesg.c @ 892:b2e8f1a3ef76

Allow the content of the Failed-AVP to be parseable to bufferize the message. The content is only padded currently
author Sebastien Decugis <sdecugis@freediameter.net>
date Mon, 19 Nov 2012 08:58:40 +0100
parents 9432ac55823c
children 5053f1abcf5d
comparison
equal deleted inserted replaced
891:9432ac55823c 892:b2e8f1a3ef76
754 CHECK( 0, fd_msg_free ( msg ) ); 754 CHECK( 0, fd_msg_free ( msg ) );
755 } 755 }
756 756
757 #if 1 757 #if 1
758 { 758 {
759 unsigned char * buftmp = NULL;
759 /* Check the parse or error works as expected */ 760 /* Check the parse or error works as expected */
760 CPYBUF(); 761 CPYBUF();
761 762
762 buf_cpy[21] = 0x02; /* New AVP code = 0x00021F5F, f64 type in the dictionary */ 763 buf_cpy[21] = 0x02; /* New AVP code = 0x00021F5F, f64 type in the dictionary */
763 764
764 /* Check that we cannot support this message now */ 765 /* Check that we cannot support this message now */
765 CHECK( 0, fd_msg_init() ); 766 CHECK( 0, fd_msg_init() );
766 CHECK( 0, fd_msg_parse_buffer( &buf_cpy, 344, &msg) ); 767 CHECK( 0, fd_msg_parse_buffer( &buf_cpy, 344, &msg) );
767 CHECK( EBADMSG, fd_msg_parse_or_error( &msg ) ); 768 CHECK( EBADMSG, fd_msg_parse_or_error( &msg ) );
768 769
770 CHECK( 0, fd_msg_bufferize( msg, &buftmp, NULL ) );
771
772 fd_msg_dump_walk(0, msg);
773
769 TODO("Check the Failed-AVP is as expected"); 774 TODO("Check the Failed-AVP is as expected");
770 775
771 fd_msg_dump_walk(0, msg);
772 776
773 /* reset */ 777 /* reset */
774 CHECK( 0, fd_msg_free ( msg ) ); 778 CHECK( 0, fd_msg_free ( msg ) );
779 free(buftmp);
775 } 780 }
776 #endif 781 #endif
777 782
778 783
779 CHECK( 0, fd_msg_parse_buffer( &buf, 344, &msg) ); 784 CHECK( 0, fd_msg_parse_buffer( &buf, 344, &msg) );
"Welcome to our mercurial repository"