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

introduce real checks for carray types

Signed-off-by: default avatarJean-Paul Saman <jpsaman@videolan.org>
parent 8fd0468c
...@@ -305,10 +305,12 @@ ...@@ -305,10 +305,12 @@
s_decoded.i_event_name_length = 0; s_decoded.i_event_name_length = 0;
</begin> </begin>
</insert> </insert>
<carray name="i_iso_639_code" />
<array name="i_text" len_name="i_text_length" min_size="0" max_size="248" /> <array name="i_text" len_name="i_text_length" min_size="0" max_size="248" />
</descriptor> </descriptor>
<descriptor name="short event (both)" sname="short_event" fname="ShortEvent" msuffix="2"> <descriptor name="short event (both)" sname="short_event" fname="ShortEvent" msuffix="2">
<carray name="i_iso_639_code" />
<array name="i_text" len_name="i_text_length" min_size="0" max_size="124" /> <array name="i_text" len_name="i_text_length" min_size="0" max_size="124" />
<array name="i_event_name" len_name="i_event_name_length" min_size="0" max_size="124" /> <array name="i_event_name" len_name="i_event_name_length" min_size="0" max_size="124" />
</descriptor> </descriptor>
......
...@@ -169,6 +169,17 @@ static int main_<xsl:value-of select="@sname" />_<xsl:value-of select="@msuffix" ...@@ -169,6 +169,17 @@ static int main_<xsl:value-of select="@sname" />_<xsl:value-of select="@msuffix"
BOZO_end_array BOZO_end_array
</xsl:template> </xsl:template>
<xsl:template match="carray" mode="check">
/* check <xsl:value-of select="@name" /> */<xsl:apply-templates select=".." mode="init" />
i_loop_count = 0;
BOZO_begin_array(<xsl:value-of select="@name" />)
BOZO_DOJOB(<xsl:value-of select="../@fname" />);
i_err = memcmp(s_decoded.<xsl:value-of select="@name" />,
p_new_decoded-><xsl:value-of select="@name" />,
sizeof(s_decoded.<xsl:value-of select="@name" />));
BOZO_end_array
</xsl:template>
<xsl:template match="insert" mode="check"> <xsl:template match="insert" mode="check">
<xsl:value-of select="check" /> <xsl:value-of select="check" />
</xsl:template> </xsl:template>
......
...@@ -1911,6 +1911,19 @@ static int main_short_event_0(void) ...@@ -1911,6 +1911,19 @@ static int main_short_event_0(void)
BOZO_START(short event (event_name)); BOZO_START(short event (event_name));
/* check i_iso_639_code */
s_decoded.i_text_length = 0;
BOZO_fill_array(s_decoded.i_iso_639_code, sizeof(s_decoded.i_iso_639_code));
BOZO_init_array(i_event_name_length);
i_loop_count = 0;
BOZO_begin_array(i_iso_639_code)
BOZO_DOJOB(ShortEvent);
i_err = memcmp(s_decoded.i_iso_639_code,
p_new_decoded->i_iso_639_code,
sizeof(s_decoded.i_iso_639_code));
BOZO_end_array
/* check i_event_name */ /* check i_event_name */
s_decoded.i_text_length = 0; s_decoded.i_text_length = 0;
...@@ -1938,9 +1951,23 @@ static int main_short_event_1(void) ...@@ -1938,9 +1951,23 @@ static int main_short_event_1(void)
BOZO_START(short event (i_text)); BOZO_START(short event (i_text));
/* check i_iso_639_code */
s_decoded.i_event_name_length = 0;
BOZO_fill_array(s_decoded.i_iso_639_code, sizeof(s_decoded.i_iso_639_code));
BOZO_init_array(i_text_length);
i_loop_count = 0;
BOZO_begin_array(i_iso_639_code)
BOZO_DOJOB(ShortEvent);
i_err = memcmp(s_decoded.i_iso_639_code,
p_new_decoded->i_iso_639_code,
sizeof(s_decoded.i_iso_639_code));
BOZO_end_array
/* check i_text */ /* check i_text */
s_decoded.i_event_name_length = 0; s_decoded.i_event_name_length = 0;
BOZO_fill_array(s_decoded.i_iso_639_code, sizeof(s_decoded.i_iso_639_code));
BOZO_init_array(i_text_length); BOZO_init_array(i_text_length);
BOZO_begin_array(i_text) BOZO_begin_array(i_text)
BOZO_loop_array_begin(i_text, i_text_length, 0) BOZO_loop_array_begin(i_text, i_text_length, 0)
...@@ -1964,7 +1991,20 @@ static int main_short_event_2(void) ...@@ -1964,7 +1991,20 @@ static int main_short_event_2(void)
BOZO_START(short event (both)); BOZO_START(short event (both));
/* check i_iso_639_code */
BOZO_fill_array(s_decoded.i_iso_639_code, sizeof(s_decoded.i_iso_639_code));
BOZO_init_array(i_text_length);
BOZO_init_array(i_event_name_length);
i_loop_count = 0;
BOZO_begin_array(i_iso_639_code)
BOZO_DOJOB(ShortEvent);
i_err = memcmp(s_decoded.i_iso_639_code,
p_new_decoded->i_iso_639_code,
sizeof(s_decoded.i_iso_639_code));
BOZO_end_array
/* check i_text */ /* check i_text */
BOZO_fill_array(s_decoded.i_iso_639_code, sizeof(s_decoded.i_iso_639_code));
BOZO_init_array(i_text_length); BOZO_init_array(i_text_length);
BOZO_init_array(i_event_name_length); BOZO_init_array(i_event_name_length);
BOZO_begin_array(i_text) BOZO_begin_array(i_text)
...@@ -1977,6 +2017,7 @@ static int main_short_event_2(void) ...@@ -1977,6 +2017,7 @@ static int main_short_event_2(void)
BOZO_end_array BOZO_end_array
/* check i_event_name */ /* check i_event_name */
BOZO_fill_array(s_decoded.i_iso_639_code, sizeof(s_decoded.i_iso_639_code));
BOZO_init_array(i_text_length); BOZO_init_array(i_text_length);
BOZO_init_array(i_event_name_length); BOZO_init_array(i_event_name_length);
BOZO_begin_array(i_event_name) BOZO_begin_array(i_event_name)
......
...@@ -148,10 +148,10 @@ static void BOZO_fill_array(void *a, size_t len) ...@@ -148,10 +148,10 @@ static void BOZO_fill_array(void *a, size_t len)
s_decoded.len_name = i_loop_count; s_decoded.len_name = i_loop_count;
#define BOZO_loop_array_end(name, max_len) \ #define BOZO_loop_array_end(name, max_len) \
} while(!i_err && i_loop_count < max_len); \ } while(!i_err && i_loop_count < max_len);
fprintf(stdout, "\r iteration count: %22"PRI64d, i_loop_count);
#define BOZO_end_array \ #define BOZO_end_array \
fprintf(stdout, "\r iteration count: %22"PRI64d, i_loop_count); \
if(i_err) \ if(i_err) \
fprintf(stdout, " FAILED !!!\n"); \ fprintf(stdout, " FAILED !!!\n"); \
else \ else \
......
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