Changeset 890:19a261c9a2e1 in freeDiameter for tests
- Timestamp:
- Nov 18, 2012, 6:54:24 AM (11 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/testmesg.c
r740 r890 186 186 } 187 187 188 { 189 struct dict_avp_data avp_data = { 139103, 0, "AVP Test - no vendor - f64", 0, 0, AVP_TYPE_FLOAT64 }; 190 CHECK( 0, fd_dict_new ( fd_g_config->cnf_dict, DICT_AVP, &avp_data , NULL, NULL ) ); 191 } 192 188 193 { 189 194 struct dict_object * type = NULL; … … 269 274 ADD_RULE(command, 73565, "AVP Test - enumos", RULE_OPTIONAL, -1, -1, 0); 270 275 ADD_RULE(command, 73565, "AVP Test - grouped", RULE_OPTIONAL, -1, -1, 0); 276 } 277 278 { 279 struct dict_object * application = NULL; 280 struct dict_object * command = NULL; 281 struct dict_cmd_data cmd_data = { 73573, "Test-Command-Answer", CMD_FLAG_REQUEST, 0 }; 282 283 CHECK( 0, fd_dict_search ( fd_g_config->cnf_dict, DICT_APPLICATION, APPLICATION_BY_NAME, "Application test", &application, ENOENT ) ); 284 CHECK( 0, fd_dict_new ( fd_g_config->cnf_dict, DICT_COMMAND, &cmd_data , application, &command ) ); 271 285 } 272 286 … … 725 739 CHECK( 0, fd_msg_free ( msg ) ); 726 740 } 741 742 /* Test with an invalid AVP (definition mismatch with the dictionary) */ 743 { 744 CPYBUF(); 745 746 buf_cpy[21] = 0x02; /* New AVP code = 0x00021F5F, f64 type in the dictionary */ 747 748 749 /* Check that we cannot support this message now */ 750 CHECK( 0, fd_msg_parse_buffer( &buf_cpy, 344, &msg) ); 751 CHECK( EBADMSG, fd_msg_parse_dict( msg, fd_g_config->cnf_dict, NULL ) ); 752 753 /* reset */ 754 CHECK( 0, fd_msg_free ( msg ) ); 755 } 756 757 #if 1 758 { 759 /* Check the parse or error works as expected */ 760 CPYBUF(); 761 762 buf_cpy[21] = 0x02; /* New AVP code = 0x00021F5F, f64 type in the dictionary */ 763 764 /* Check that we cannot support this message now */ 765 CHECK( 0, fd_msg_init() ); 766 CHECK( 0, fd_msg_parse_buffer( &buf_cpy, 344, &msg) ); 767 CHECK( EBADMSG, fd_msg_parse_or_error( &msg ) ); 768 769 /* Check the Failed-AVP is as expected */ 770 771 fd_msg_dump_walk(0, msg); 772 773 /* reset */ 774 CHECK( 0, fd_msg_free ( msg ) ); 775 776 ASSERT(0); 777 } 778 #endif 779 727 780 728 781 CHECK( 0, fd_msg_parse_buffer( &buf, 344, &msg) );
Note: See TracChangeset
for help on using the changeset viewer.