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

add tests for the NVOD reference descriptor

Signed-off-by: Jean-Paul Saman's avatarJean-Paul Saman <jpsaman@videolan.org>
parent 7878a7aa
......@@ -281,4 +281,8 @@
<array name="i_private_data" len_name="i_private_data_length" min_size="0" max_size="242" />
</descriptor>
<descriptor name="Near Video On Demand reference" sname="nvod_ref" fname="NVODReference">
<array name="p_nvod_refs" len_name="i_references" min_size="1" type="dvbpsi_nvod_ref_t"/>
</descriptor>
</dr>
......@@ -1808,6 +1808,27 @@ static int main_linkage_5(void)
return i_err;
}
/* Near Video On Demand reference */
static int main_nvod_ref_(void)
{
BOZO_VARS(nvod_ref);
BOZO_START(Near Video On Demand reference);
/* check p_nvod_refs */
BOZO_init_array(i_references);
BOZO_begin_array(p_nvod_refs, i_references, 1)
BOZO_DOJOB(NVODReference);
BOZO_check_array_begin(p_nvod_refs, i_references)
BOZO_check_array_cmp(p_nvod_refs, i_references, dvbpsi_nvod_ref_t)
BOZO_CLEAN();
BOZO_end_array(p_nvod_refs, ARRAY_SIZE(s_decoded.p_nvod_refs))
BOZO_END(Near Video On Demand reference);
return i_err;
}
/* main function */
int main(void)
......@@ -1850,6 +1871,7 @@ int main(void)
i_err |= main_linkage_3();
i_err |= main_linkage_4();
i_err |= main_linkage_5();
i_err |= main_nvod_ref_();
if(i_err)
fprintf(stderr, "At least one test has FAILED !!!\n");
......
......@@ -18,3 +18,15 @@ static int compare_dvbpsi_service_list_service_s(const void *s1, const void *s2)
a->i_service_type > b->i_service_type) return 1;
else return 0;
}
static int compare_dvbpsi_nvod_ref_t(const void *s1, const void *s2)
{
const dvbpsi_nvod_ref_t *a = s1, *b = s2;
if(a->i_transport_stream_id < b->i_transport_stream_id ||
a->i_original_network_id < b->i_original_network_id ||
a->i_service_id < b->i_service_id) return -1;
else if(a->i_transport_stream_id > b->i_transport_stream_id ||
a->i_original_network_id > b->i_original_network_id ||
a->i_service_id > b->i_service_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