Commit dcfd2c70 authored by Daniel Kamil Kozar's avatar Daniel Kamil Kozar Committed by Jean-Paul Saman

add tests for the CA identifier descriptor

Signed-off-by: default avatarJean-Paul Saman <jpsaman@videolan.org>
parent 975725f8
...@@ -324,4 +324,8 @@ ...@@ -324,4 +324,8 @@
<integer name="i_component_tag" bitcount="8" default="0"/> <integer name="i_component_tag" bitcount="8" default="0"/>
</descriptor> </descriptor>
<descriptor name="CA identifier" sname="ca_identifier" fname="CAIdentifier">
<array name="p_system" len_name="i_number" min_size="1" type="dvbpsi_ca_system_t"/>
</descriptor>
</dr> </dr>
...@@ -2081,6 +2081,30 @@ static int main_stream_identifier_(void) ...@@ -2081,6 +2081,30 @@ static int main_stream_identifier_(void)
return i_err; return i_err;
} }
/* CA identifier */
static int main_ca_identifier_(void)
{
BOZO_VARS(ca_identifier);
BOZO_START(CA identifier);
/* check p_system */
BOZO_init_array(i_number);
BOZO_begin_array(p_system)
BOZO_loop_array_begin(p_system, i_number, 1)
BOZO_DOJOB(CAIdentifier);
BOZO_check_array_begin(p_system, i_number)
BOZO_check_array_cmp(p_system, i_number, dvbpsi_ca_system_t)
BOZO_CLEAN();
BOZO_loop_array_end(p_system, ARRAY_SIZE(s_decoded.p_system))
BOZO_end_array
BOZO_END(CA identifier);
return i_err;
}
/* main function */ /* main function */
int main(void) int main(void)
...@@ -2130,6 +2154,7 @@ int main(void) ...@@ -2130,6 +2154,7 @@ int main(void)
i_err |= main_short_event_2(); i_err |= main_short_event_2();
i_err |= main_tshifted_ev_(); i_err |= main_tshifted_ev_();
i_err |= main_stream_identifier_(); i_err |= main_stream_identifier_();
i_err |= main_ca_identifier_();
if(i_err) if(i_err)
fprintf(stderr, "At least one test has FAILED !!!\n"); fprintf(stderr, "At least one test has FAILED !!!\n");
......
...@@ -30,3 +30,11 @@ static int compare_dvbpsi_nvod_ref_t(const void *s1, const void *s2) ...@@ -30,3 +30,11 @@ static int compare_dvbpsi_nvod_ref_t(const void *s1, const void *s2)
a->i_service_id > b->i_service_id) return 1; a->i_service_id > b->i_service_id) return 1;
else return 0; else return 0;
} }
static int compare_dvbpsi_ca_system_t(const void *s1, const void *s2)
{
const dvbpsi_ca_system_t *a = s1, *b = s2;
if(a->i_ca_system_id < b->i_ca_system_id) return -1;
else if(a->i_ca_system_id < b->i_ca_system_id) return 1;
else return 0;
}
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