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

add tests for linkage descriptor

Signed-off-by: default avatarJean-Paul Saman <jpsaman@videolan.org>
parent a57440e1
......@@ -194,4 +194,16 @@
<array name="i_service_provider_name" len_name="i_service_provider_name_length" min_size="0" max_size="126" />
</descriptor>
<descriptor name="linkage (information service)" sname="linkage" fname="Linkage" msuffix="0">
<insert>
<begin>
s_decoded.i_linkage_type = 1;
</begin>
</insert>
<integer name="i_transport_stream_id" bitcount="16" default="0" />
<integer name="i_original_network_id" bitcount="16" default="0" />
<integer name="i_service_id" bitcount="16" default="0" />
<array name="i_private_data" len_name="i_private_data_length" min_size="0" />
</descriptor>
</dr>
......@@ -1224,6 +1224,67 @@ static int main_service_3(void)
return i_err;
}
/* linkage (information service) */
static int main_linkage_0(void)
{
BOZO_VARS(linkage);
BOZO_START(linkage (information service));
/* check i_transport_stream_id */
s_decoded.i_linkage_type = 1;
BOZO_init_integer(i_transport_stream_id, 0);
BOZO_init_integer(i_original_network_id, 0);
BOZO_init_integer(i_service_id, 0);
BOZO_begin_integer(i_transport_stream_id, 16)
BOZO_DOJOB(Linkage);
BOZO_check_integer(i_transport_stream_id, 16)
BOZO_CLEAN();
BOZO_end_integer(i_transport_stream_id, 16)
/* check i_original_network_id */
s_decoded.i_linkage_type = 1;
BOZO_init_integer(i_transport_stream_id, 0);
BOZO_init_integer(i_original_network_id, 0);
BOZO_init_integer(i_service_id, 0);
BOZO_begin_integer(i_original_network_id, 16)
BOZO_DOJOB(Linkage);
BOZO_check_integer(i_original_network_id, 16)
BOZO_CLEAN();
BOZO_end_integer(i_original_network_id, 16)
/* check i_service_id */
s_decoded.i_linkage_type = 1;
BOZO_init_integer(i_transport_stream_id, 0);
BOZO_init_integer(i_original_network_id, 0);
BOZO_init_integer(i_service_id, 0);
BOZO_begin_integer(i_service_id, 16)
BOZO_DOJOB(Linkage);
BOZO_check_integer(i_service_id, 16)
BOZO_CLEAN();
BOZO_end_integer(i_service_id, 16)
/* check i_private_data */
s_decoded.i_linkage_type = 1;
BOZO_init_integer(i_transport_stream_id, 0);
BOZO_init_integer(i_original_network_id, 0);
BOZO_init_integer(i_service_id, 0);
BOZO_begin_array(i_private_data, i_private_data_length, 0)
BOZO_DOJOB(Linkage);
BOZO_check_array_begin(i_private_data, i_private_data_length)
BOZO_check_array_gen(i_private_data, i_private_data_length)
BOZO_CLEAN();
BOZO_end_array(i_private_data, ARRAY_SIZE(s_decoded.i_private_data))
BOZO_END(linkage (information service));
return i_err;
}
/* main function */
int main(void)
......@@ -1260,6 +1321,7 @@ int main(void)
i_err |= main_service_1();
i_err |= main_service_2();
i_err |= main_service_3();
i_err |= main_linkage_0();
if(i_err)
fprintf(stderr, "At least one test has FAILED !!!\n");
......
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