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

add testcase for service_dr with two names

Signed-off-by: default avatarJean-Paul Saman <jpsaman@videolan.org>
parent 549a6515
...@@ -156,4 +156,14 @@ ...@@ -156,4 +156,14 @@
<array name="i_service_name" len_name="i_service_name_length" min_size="0" /> <array name="i_service_name" len_name="i_service_name_length" min_size="0" />
</descriptor> </descriptor>
<descriptor name="service (both names)" sname="service" fname="Service" msuffix="3">
<insert>
<begin>
s_decoded.i_service_provider_name_length = 0;</begin>
</insert>
<integer name="i_service_type" bitcount="8" default="0" />
<array name="i_service_name" len_name="i_service_name_length" min_size="0" max_size="126" />
<array name="i_service_provider_name" len_name="i_service_provider_name_length" min_size="0" max_size="126" />
</descriptor>
</dr> </dr>
...@@ -132,7 +132,15 @@ static int main_<xsl:value-of select="@sname" />_<xsl:value-of select="@msuffix" ...@@ -132,7 +132,15 @@ static int main_<xsl:value-of select="@sname" />_<xsl:value-of select="@msuffix"
BOZO_DOJOB(<xsl:value-of select="../@fname" />); BOZO_DOJOB(<xsl:value-of select="../@fname" />);
BOZO_check_array(<xsl:value-of select="@name" />, <xsl:value-of select="@len_name" />) BOZO_check_array(<xsl:value-of select="@name" />, <xsl:value-of select="@len_name" />)
BOZO_CLEAN(); BOZO_CLEAN();
BOZO_end_array(<xsl:value-of select="@name" />) <xsl:choose>
<xsl:when test="@max_size">
BOZO_end_array(<xsl:value-of select="@name" />, <xsl:value-of select="@max_size"/>)
</xsl:when>
<xsl:otherwise>
BOZO_end_array(<xsl:value-of select="@name" />, ARRAY_SIZE(s_decoded.<xsl:value-of select="@name"/>))
</xsl:otherwise>
</xsl:choose>
</xsl:template> </xsl:template>
<xsl:template match="insert" mode="check"> <xsl:template match="insert" mode="check">
......
...@@ -473,7 +473,8 @@ static int main_ca_(void) ...@@ -473,7 +473,8 @@ static int main_ca_(void)
BOZO_DOJOB(CA); BOZO_DOJOB(CA);
BOZO_check_array(i_private_data, i_private_length) BOZO_check_array(i_private_data, i_private_length)
BOZO_CLEAN(); BOZO_CLEAN();
BOZO_end_array(i_private_data)
BOZO_end_array(i_private_data, ARRAY_SIZE(s_decoded.i_private_data))
BOZO_END(conditional access); BOZO_END(conditional access);
...@@ -493,7 +494,8 @@ static int main_iso639_(void) ...@@ -493,7 +494,8 @@ static int main_iso639_(void)
BOZO_DOJOB(ISO639); BOZO_DOJOB(ISO639);
BOZO_check_array(code, i_code_count) BOZO_check_array(code, i_code_count)
BOZO_CLEAN(); BOZO_CLEAN();
BOZO_end_array(code)
BOZO_end_array(code, ARRAY_SIZE(s_decoded.code))
BOZO_END(ISO 639 language); BOZO_END(ISO 639 language);
...@@ -610,7 +612,8 @@ static int main_copyright_(void) ...@@ -610,7 +612,8 @@ static int main_copyright_(void)
BOZO_DOJOB(Copyright); BOZO_DOJOB(Copyright);
BOZO_check_array(i_additional_info, i_additional_length) BOZO_check_array(i_additional_info, i_additional_length)
BOZO_CLEAN(); BOZO_CLEAN();
BOZO_end_array(i_additional_info)
BOZO_end_array(i_additional_info, ARRAY_SIZE(s_decoded.i_additional_info))
BOZO_END(copyright); BOZO_END(copyright);
...@@ -824,7 +827,8 @@ static int main_stuffing_(void) ...@@ -824,7 +827,8 @@ static int main_stuffing_(void)
BOZO_DOJOB(Stuffing); BOZO_DOJOB(Stuffing);
BOZO_check_array(i_stuffing_byte, i_stuffing_length) BOZO_check_array(i_stuffing_byte, i_stuffing_length)
BOZO_CLEAN(); BOZO_CLEAN();
BOZO_end_array(i_stuffing_byte)
BOZO_end_array(i_stuffing_byte, ARRAY_SIZE(s_decoded.i_stuffing_byte))
BOZO_END(stuffing); BOZO_END(stuffing);
...@@ -844,7 +848,8 @@ static int main_bouquet_name_(void) ...@@ -844,7 +848,8 @@ static int main_bouquet_name_(void)
BOZO_DOJOB(BouquetName); BOZO_DOJOB(BouquetName);
BOZO_check_array(i_char, i_name_length) BOZO_check_array(i_char, i_name_length)
BOZO_CLEAN(); BOZO_CLEAN();
BOZO_end_array(i_char)
BOZO_end_array(i_char, ARRAY_SIZE(s_decoded.i_char))
BOZO_END(bouquet name); BOZO_END(bouquet name);
...@@ -875,7 +880,8 @@ static int main_service_1(void) ...@@ -875,7 +880,8 @@ static int main_service_1(void)
BOZO_DOJOB(Service); BOZO_DOJOB(Service);
BOZO_check_array(i_service_provider_name, i_service_provider_name_length) BOZO_check_array(i_service_provider_name, i_service_provider_name_length)
BOZO_CLEAN(); BOZO_CLEAN();
BOZO_end_array(i_service_provider_name)
BOZO_end_array(i_service_provider_name, ARRAY_SIZE(s_decoded.i_service_provider_name))
BOZO_END(service (i_service_provider_name)); BOZO_END(service (i_service_provider_name));
...@@ -906,7 +912,8 @@ static int main_service_2(void) ...@@ -906,7 +912,8 @@ static int main_service_2(void)
BOZO_DOJOB(Service); BOZO_DOJOB(Service);
BOZO_check_array(i_service_name, i_service_name_length) BOZO_check_array(i_service_name, i_service_name_length)
BOZO_CLEAN(); BOZO_CLEAN();
BOZO_end_array(i_service_name)
BOZO_end_array(i_service_name, ARRAY_SIZE(s_decoded.i_service_name))
BOZO_END(service (i_service_name)); BOZO_END(service (i_service_name));
...@@ -914,6 +921,48 @@ static int main_service_2(void) ...@@ -914,6 +921,48 @@ static int main_service_2(void)
return i_err; return i_err;
} }
/* service (both names) */
static int main_service_3(void)
{
BOZO_VARS(service);
BOZO_START(service (both names));
/* check i_service_type */
s_decoded.i_service_provider_name_length = 0;
BOZO_init_integer(i_service_type, 0);
BOZO_begin_integer(i_service_type, 8)
BOZO_DOJOB(Service);
BOZO_check_integer(i_service_type, 8)
BOZO_CLEAN();
BOZO_end_integer(i_service_type, 8)
/* check i_service_name */
s_decoded.i_service_provider_name_length = 0;
BOZO_init_integer(i_service_type, 0);
BOZO_begin_array(i_service_name, i_service_name_length, 0)
BOZO_DOJOB(Service);
BOZO_check_array(i_service_name, i_service_name_length)
BOZO_CLEAN();
BOZO_end_array(i_service_name, 126)
/* check i_service_provider_name */
s_decoded.i_service_provider_name_length = 0;
BOZO_init_integer(i_service_type, 0);
BOZO_begin_array(i_service_provider_name, i_service_provider_name_length, 0)
BOZO_DOJOB(Service);
BOZO_check_array(i_service_provider_name, i_service_provider_name_length)
BOZO_CLEAN();
BOZO_end_array(i_service_provider_name, 126)
BOZO_END(service (both names));
return i_err;
}
/* main function */ /* main function */
int main(void) int main(void)
...@@ -945,6 +994,7 @@ int main(void) ...@@ -945,6 +994,7 @@ int main(void)
i_err |= main_bouquet_name_(); i_err |= main_bouquet_name_();
i_err |= main_service_1(); i_err |= main_service_1();
i_err |= main_service_2(); i_err |= main_service_2();
i_err |= main_service_3();
if(i_err) if(i_err)
fprintf(stderr, "At least one test has FAILED !!!\n"); fprintf(stderr, "At least one test has FAILED !!!\n");
......
...@@ -135,8 +135,8 @@ ...@@ -135,8 +135,8 @@
((uint8_t*)s_decoded.name)[i] = rand(); \ ((uint8_t*)s_decoded.name)[i] = rand(); \
s_decoded.len_name = i_loop_count; s_decoded.len_name = i_loop_count;
#define BOZO_end_array(name) \ #define BOZO_end_array(name, max_len) \
} while(!i_err && i_loop_count < ARRAY_SIZE(s_decoded.name)); \ } while(!i_err && i_loop_count < max_len); \
fprintf(stdout, "\r iteration count: %22"PRI64d, i_loop_count); \ fprintf(stdout, "\r iteration count: %22"PRI64d, i_loop_count); \
if(i_err) \ if(i_err) \
fprintf(stdout, " FAILED !!!\n"); \ fprintf(stdout, " 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