Commit cf96a82f authored by Ghislain MARY's avatar Ghislain MARY

Add unit test for "rtcp-fb ccm fir" attribute + fix crash on bad rtcp-fb attribute parsing.

parent 60eb6537
......@@ -330,7 +330,7 @@ rtcp_fb_trr_int_val:
};
rtcp_fb_ccm_val:
{IS_TOKEN(ccm)}? rtcp_fb_attribute_name /*'ccm'*/ SPACE rtcp_fb_ccm_param {
{IS_TOKEN(ccm)}? rtcp_fb_attribute_name /*'ccm'*/ (SPACE rtcp_fb_ccm_param)? { /* TODO: rtcp_fb_ccm_param should be mandatory */
belle_sdp_rtcp_fb_attribute_set_type($rtcp_fb_attribute::current,BELLE_SDP_RTCP_FB_CCM);
};
......@@ -393,7 +393,7 @@ scope { belle_sdp_media_description_t* current; }
(connection { belle_sdp_media_description_set_connection($media_description::current,$connection.ret);} CR LF)?
(bandwidth {belle_sdp_media_description_add_bandwidth($media_description::current,$bandwidth.ret);} CR LF)*
(key_field CR LF)?
(attribute {belle_sdp_media_description_add_attribute($media_description::current,$attribute.ret);} CR LF)*;
(attribute {if ($attribute.ret)belle_sdp_media_description_add_attribute($media_description::current,$attribute.ret);} CR LF)*;
catch [ANTLR3_MISMATCHED_TOKEN_EXCEPTION]
{
......
......@@ -93,6 +93,13 @@ static void test_rtcp_fb_attribute(void) {
CU_ASSERT_EQUAL(belle_sdp_rtcp_fb_attribute_get_type(lAttribute), BELLE_SDP_RTCP_FB_TRR_INT);
CU_ASSERT_EQUAL(belle_sdp_rtcp_fb_attribute_get_trr_int(lAttribute), 3);
belle_sip_object_unref(BELLE_SIP_OBJECT(lAttribute));
lAttribute = BELLE_SDP_RTCP_FB_ATTRIBUTE(attribute_parse_marshall_parse_clone("a=rtcp-fb:103 ccm fir"));
CU_ASSERT_STRING_EQUAL(belle_sdp_attribute_get_name(BELLE_SDP_ATTRIBUTE(lAttribute)), "rtcp-fb");
CU_ASSERT_EQUAL(belle_sdp_rtcp_fb_attribute_get_id(lAttribute), 103);
CU_ASSERT_EQUAL(belle_sdp_rtcp_fb_attribute_get_type(lAttribute), BELLE_SDP_RTCP_FB_CCM);
CU_ASSERT_EQUAL(belle_sdp_rtcp_fb_attribute_get_param(lAttribute), BELLE_SDP_RTCP_FB_FIR);
belle_sip_object_unref(BELLE_SIP_OBJECT(lAttribute));
}
static void test_rtcp_xr_attribute(void) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment