Changeset 1423:67c263056d78 in freeDiameter for tests
- Timestamp:
- Feb 19, 2020, 8:20:20 AM (4 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/testmesg.c
r1414 r1423 681 681 struct dict_object * avp_model; 682 682 struct avp * found; 683 struct avp * grouped = NULL; 683 684 struct avp_hdr * avpdata = NULL; 684 685 … … 688 689 CPYBUF(); 689 690 CHECK( 0, fd_msg_parse_buffer( &buf_cpy, 344, &msg) ); 690 691 CHECK( 0, fd_msg_parse_dict( msg, fd_g_config->cnf_dict, NULL ) ); 692 #if 0 693 LOG_D("msg: %s", fd_msg_dump_treeview(FD_DUMP_TEST_PARAMS, msg, fd_g_config->cnf_dict, 0, 1)); 694 #endif 695 691 696 /* Search this AVP instance in the msg */ 692 697 CHECK( 0, fd_msg_search_avp( msg, avp_model, &found ) ); … … 695 700 CHECK( 0, fd_msg_avp_hdr ( found, &avpdata ) ); 696 701 CHECK( 3.1415F, avpdata->avp_value->f32 ); 697 702 703 /* Search for the first grouped message */ 704 { 705 struct dict_avp_request grouped_req = { 73565, 0, "AVP Test - grouped"}; 706 CHECK( 0, fd_dict_search ( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME_AND_VENDOR, &grouped_req, &avp_model, ENOENT ) ); 707 } 708 CHECK( 0, fd_msg_search_avp( msg, avp_model, &grouped ) ); 709 #if 0 710 LOG_D("grouped: %s", fd_msg_dump_treeview(FD_DUMP_TEST_PARAMS, grouped, fd_g_config->cnf_dict, 0, 1)); 711 #endif 712 713 /* Find the first item in the grouped */ 714 { 715 struct dict_avp_request avp_req = { 73565, 0, "AVP Test - os"}; 716 CHECK( 0, fd_dict_search ( fd_g_config->cnf_dict, DICT_AVP, AVP_BY_NAME_AND_VENDOR, &avp_req, &avp_model, ENOENT ) ); 717 } 718 719 CHECK( 0, fd_msg_search_avp( grouped, avp_model, &found ) ); 720 721 /* Check the AVP value is "1" */ 722 CHECK( 0, fd_msg_avp_hdr ( found, &avpdata ) ); 723 CHECK( 8, avpdata->avp_value->os.len ); 724 CHECK( 0, memcmp(avpdata->avp_value->os.data, "12345678", 8)); 725 698 726 /* reinit the msg */ 699 727 CHECK( 0, fd_msg_free ( msg ) );
Note: See TracChangeset
for help on using the changeset viewer.