* misc/dr.dtd, misc/dr.xml, misc/dr.xsl, misc/test_dr.h, misc/test_dr.c:...

  * misc/dr.dtd, misc/dr.xml, misc/dr.xsl, misc/test_dr.h, misc/test_dr.c: modified the way tests are performed (avoid stupid iterations).
parent d5412905
...@@ -12,13 +12,17 @@ ...@@ -12,13 +12,17 @@
<!ELEMENT check (#PCDATA)> <!ELEMENT check (#PCDATA)>
<!ELEMENT end (#PCDATA)>
<!ATTLIST descriptor name CDATA #IMPLIED> <!ATTLIST descriptor name CDATA #IMPLIED>
<!ATTLIST descriptor sname CDATA #IMPLIED> <!ATTLIST descriptor sname CDATA #IMPLIED>
<!ATTLIST descriptor fname CDATA #IMPLIED> <!ATTLIST descriptor fname CDATA #IMPLIED>
<!ATTLIST descriptor msuffix CDATA #IMPLIED>
<!ATTLIST integer name CDATA #IMPLIED> <!ATTLIST integer name CDATA #IMPLIED>
<!ATTLIST integer bitcount CDATA #IMPLIED> <!ATTLIST integer bitcount CDATA #IMPLIED>
<!ATTLIST integer default CDATA #IMPLIED>
<!ATTLIST integer min CDATA #IMPLIED>
<!ATTLIST integer max CDATA #IMPLIED>
<!ATTLIST integer step CDATA #IMPLIED>
<!ATTLIST boolean name CDATA #IMPLIED> <!ATTLIST boolean name CDATA #IMPLIED>
<!ATTLIST boolean default CDATA #IMPLIED>
...@@ -2,37 +2,42 @@ ...@@ -2,37 +2,42 @@
<!DOCTYPE dr SYSTEM "dr.dtd"> <!DOCTYPE dr SYSTEM "dr.dtd">
<dr> <dr>
<descriptor name="video stream" sname="vstream" fname="VStream"> <descriptor name="video stream (b_mpeg2 = false)" sname="vstream" fname="VStream" msuffix="1" >
<boolean name="b_multiple_frame_rate" /> <boolean name="b_multiple_frame_rate" default="0" />
<integer name="i_frame_rate_code" bitcount="4" /> <integer name="i_frame_rate_code" bitcount="4" default="0" />
<boolean name="b_mpeg2" />
<boolean name="b_constrained_parameter" />
<boolean name="b_still_picture" />
<insert> <insert>
<check> <begin>
if(s_decoded.b_mpeg2) s_decoded.b_mpeg2 = 0;</begin>
{</check>
</insert> </insert>
<integer name="i_profile_level_indication" bitcount="8" /> <boolean name="b_constrained_parameter" default="0" />
<integer name="i_chroma_format" bitcount="2" /> <boolean name="b_still_picture" default="0" />
<boolean name="b_frame_rate_extension" /> </descriptor>
<descriptor name="video stream (b_mpeg2 = true)" sname="vstream" fname="VStream" msuffix="2" >
<boolean name="b_multiple_frame_rate" default="0" />
<integer name="i_frame_rate_code" bitcount="4" default="0" />
<insert> <insert>
<check> <begin>
}</check> s_decoded.b_mpeg2 = 12;</begin>
</insert> </insert>
<boolean name="b_constrained_parameter" default="0" />
<boolean name="b_still_picture" default="0" />
<integer name="i_profile_level_indication" bitcount="8" default="0" max="0xff - 1" />
<integer name="i_chroma_format" bitcount="2" default="0" />
<boolean name="b_frame_rate_extension" default="0" />
</descriptor> </descriptor>
<descriptor name="audio stream" sname="astream" fname="AStream"> <descriptor name="audio stream" sname="astream" fname="AStream">
<boolean name="b_free_format" /> <boolean name="b_free_format" default="0" />
<integer name="i_id" bitcount="1" /> <integer name="i_id" bitcount="1" default="0" />
<integer name="i_layer" bitcount="2" /> <integer name="i_layer" bitcount="2" default="0" />
</descriptor> </descriptor>
<descriptor name="hierarchy" sname="hierarchy" fname="Hierarchy"> <descriptor name="hierarchy" sname="hierarchy" fname="Hierarchy">
<integer name="i_h_type" bitcount="4" /> <integer name="i_h_type" bitcount="4" default="0" />
<integer name="i_h_layer_index" bitcount="6" /> <integer name="i_h_layer_index" bitcount="6" default="0" />
<integer name="i_h_embedded_layer" bitcount="6" /> <integer name="i_h_embedded_layer" bitcount="6" default="0" />
<integer name="i_h_priority" bitcount="6" /> <integer name="i_h_priority" bitcount="6" default="0" />
</descriptor> </descriptor>
<descriptor name="registration" sname="registration" fname="Registration"> <descriptor name="registration" sname="registration" fname="Registration">
...@@ -40,23 +45,24 @@ ...@@ -40,23 +45,24 @@
<begin> <begin>
s_decoded.i_additional_length = 0;</begin> s_decoded.i_additional_length = 0;</begin>
</insert> </insert>
<integer name="i_format_identifier" bitcount="32" /> <integer name="i_format_identifier" bitcount="32" default="0" max="0xffff" />
<integer name="i_format_identifier" bitcount="32" default="0" max="0xffff0000" step="0x10000" />
</descriptor> </descriptor>
<descriptor name="data stream alignment" sname="ds_alignment" fname="DSAlignment"> <descriptor name="data stream alignment" sname="ds_alignment" fname="DSAlignment">
<integer name="i_alignment_type" bitcount="8" /> <integer name="i_alignment_type" bitcount="8" default="0" max="0xff - 1" />
</descriptor> </descriptor>
<descriptor name="target background grid" sname="target_bg_grid" fname="TargetBgGrid"> <descriptor name="target background grid" sname="target_bg_grid" fname="TargetBgGrid">
<integer name="i_horizontal_size" bitcount="14" /> <integer name="i_horizontal_size" bitcount="14" default="0" />
<integer name="i_vertical_size" bitcount="14" /> <integer name="i_vertical_size" bitcount="14" default="0" />
<integer name="i_pel_aspect_ratio" bitcount="4" /> <integer name="i_pel_aspect_ratio" bitcount="4" default="0" />
</descriptor> </descriptor>
<descriptor name="video window" sname="vwindow" fname="VWindow"> <descriptor name="video window" sname="vwindow" fname="VWindow">
<integer name="i_horizontal_offset" bitcount="14" /> <integer name="i_horizontal_offset" bitcount="14" default="0" />
<integer name="i_vertical_offset" bitcount="14" /> <integer name="i_vertical_offset" bitcount="14" default="0" />
<integer name="i_window_priority" bitcount="4" /> <integer name="i_window_priority" bitcount="4" default="0" />
</descriptor> </descriptor>
<descriptor name="conditional access" sname="ca" fname="CA"> <descriptor name="conditional access" sname="ca" fname="CA">
...@@ -64,8 +70,8 @@ ...@@ -64,8 +70,8 @@
<begin> <begin>
s_decoded.i_private_length = 0;</begin> s_decoded.i_private_length = 0;</begin>
</insert> </insert>
<integer name="i_ca_system_id" bitcount="16" /> <integer name="i_ca_system_id" bitcount="16" default="0" max="0xffff - 1" />
<integer name="i_ca_pid" bitcount="13" /> <integer name="i_ca_pid" bitcount="13" default="0" />
</descriptor> </descriptor>
<descriptor name="ISO 639 language" sname="iso639" fname="ISO639"> <descriptor name="ISO 639 language" sname="iso639" fname="ISO639">
...@@ -73,6 +79,7 @@ ...@@ -73,6 +79,7 @@
<begin> <begin>
s_decoded.i_code_count = 0;</begin> s_decoded.i_code_count = 0;</begin>
</insert> </insert>
<integer name="i_audio_type" bitcount="8" /> <integer name="i_audio_type" bitcount="8" default="0" max="0xff - 1" />
</descriptor> </descriptor>
</dr> </dr>
...@@ -49,25 +49,12 @@ int main() ...@@ -49,25 +49,12 @@ int main()
<xsl:template match="descriptor" mode="code"> <xsl:template match="descriptor" mode="code">
/* <xsl:value-of select="@name" /> */ /* <xsl:value-of select="@name" /> */
int main_<xsl:value-of select="@sname" />() int main_<xsl:value-of select="@sname" />_<xsl:value-of select="@msuffix" />()
{ {
BOZO_VARS(<xsl:value-of select="@sname" />); BOZO_VARS(<xsl:value-of select="@sname" />);
BOZO_START(<xsl:value-of select="@name" />); BOZO_START(<xsl:value-of select="@name" />);
/* BEGIN start */<xsl:apply-templates mode="begin" /> <xsl:apply-templates mode="check" />
/* BEGIN end */
BOZO_DOJOB(<xsl:value-of select="@fname" />);
/* CHECK start */<xsl:apply-templates mode="check" />
/* CHECK end */
BOZO_CLEAN();
/* END start */<xsl:apply-templates mode="end" >
<xsl:sort select="position()" data-type="number" order="descending" />
</xsl:apply-templates>
/* END end */
BOZO_END(<xsl:value-of select="@name" />); BOZO_END(<xsl:value-of select="@name" />);
...@@ -77,31 +64,43 @@ int main_<xsl:value-of select="@sname" />() ...@@ -77,31 +64,43 @@ int main_<xsl:value-of select="@sname" />()
<xsl:template match="text()" mode="code" priority="-1"/> <xsl:template match="text()" mode="code" priority="-1"/>
<!-- --> <!-- -->
<!-- begin templates --> <!-- init templates -->
<!-- --> <!-- -->
<xsl:template match="integer" mode="begin"> <xsl:template match="integer" mode="init">
BOZO_begin_integer(<xsl:value-of select="@name" />, <xsl:value-of select="@bitcount" />)</xsl:template> BOZO_init_integer(<xsl:value-of select="@name" />, <xsl:value-of select="@default" />);</xsl:template>
<xsl:template match="boolean" mode="begin"> <xsl:template match="boolean" mode="init">
BOZO_begin_boolean(<xsl:value-of select="@name" />)</xsl:template> BOZO_init_boolean(<xsl:value-of select="@name" />, <xsl:value-of select="@default" />);</xsl:template>
<xsl:template match="insert" mode="begin"> <xsl:template match="insert" mode="init">
<xsl:value-of select="begin" /> <xsl:value-of select="begin" />
</xsl:template> </xsl:template>
<xsl:template match="text()" mode="begin" priority="-1"/> <xsl:template match="text()" mode="init" priority="-1"/>
<!-- --> <!-- -->
<!-- check templates --> <!-- check templates -->
<!-- --> <!-- -->
<xsl:template match="integer" mode="check"> <xsl:template match="integer" mode="check">
BOZO_check_integer<xsl:if test="@bitcount='32' or @bitcount='64'" ><xsl:value-of select="@bitcount" /></xsl:if>(<xsl:value-of select="@name" />, <xsl:value-of select="@bitcount" />)</xsl:template> /* check <xsl:value-of select="@name" /> */<xsl:apply-templates select=".." mode="init" />
BOZO_begin_integer(<xsl:value-of select="@name" />, <xsl:value-of select="@bitcount" />, <xsl:choose><xsl:when test="@min != ''"><xsl:value-of select="@min" /></xsl:when><xsl:otherwise>0</xsl:otherwise></xsl:choose>)
BOZO_DOJOB(<xsl:value-of select="../@fname" />);
BOZO_check_integer<xsl:if test="@bitcount='32' or @bitcount='64'" ><xsl:value-of select="@bitcount" /></xsl:if>(<xsl:value-of select="@name" />, <xsl:value-of select="@bitcount" />)
BOZO_CLEAN();
BOZO_end_integer(<xsl:value-of select="@name" />, <xsl:value-of select="@bitcount" />, <xsl:choose><xsl:when test="@max != ''"><xsl:value-of select="@max" /></xsl:when><xsl:otherwise>(1 &lt;&lt; <xsl:value-of select="@bitcount" />) - 1</xsl:otherwise></xsl:choose>, <xsl:choose><xsl:when test="@step != ''"><xsl:value-of select="@step" /></xsl:when><xsl:otherwise>1</xsl:otherwise></xsl:choose>)
</xsl:template>
<xsl:template match="boolean" mode="check"> <xsl:template match="boolean" mode="check">
BOZO_check_boolean(<xsl:value-of select="@name" />)</xsl:template> /* check <xsl:value-of select="@name" /> */<xsl:apply-templates select=".." mode="init" />
BOZO_begin_boolean(<xsl:value-of select="@name" />)
BOZO_DOJOB(<xsl:value-of select="../@fname" />);
BOZO_check_boolean(<xsl:value-of select="@name" />)
BOZO_CLEAN();
BOZO_end_boolean(<xsl:value-of select="@name" />)
</xsl:template>
<xsl:template match="insert" mode="check"> <xsl:template match="insert" mode="check">
<xsl:value-of select="check" /> <xsl:value-of select="check" />
...@@ -109,28 +108,12 @@ int main_<xsl:value-of select="@sname" />() ...@@ -109,28 +108,12 @@ int main_<xsl:value-of select="@sname" />()
<xsl:template match="text()" mode="check" priority="-1"/> <xsl:template match="text()" mode="check" priority="-1"/>
<!-- -->
<!-- end templates -->
<!-- -->
<xsl:template match="integer" mode="end">
BOZO_end_integer<xsl:if test="@bitcount='32' or @bitcount='64'" ><xsl:value-of select="@bitcount" /></xsl:if>(<xsl:value-of select="@name" />, <xsl:value-of select="@bitcount" />)</xsl:template>
<xsl:template match="boolean" mode="end">
BOZO_end_boolean(<xsl:value-of select="@name" />)</xsl:template>
<xsl:template match="insert" mode="end">
<xsl:value-of select="end" />
</xsl:template>
<xsl:template match="text()" mode="end" priority="-1"/>
<!-- --> <!-- -->
<!-- main templates --> <!-- main templates -->
<!-- --> <!-- -->
<xsl:template match="descriptor" mode="main"> <xsl:template match="descriptor" mode="main">
i_err |= main_<xsl:value-of select="@sname" />();</xsl:template> i_err |= main_<xsl:value-of select="@sname" />_<xsl:value-of select="@msuffix" />();</xsl:template>
<xsl:template match="text()" mode="main" priority="-1"/> <xsl:template match="text()" mode="main" priority="-1"/>
......
...@@ -20,84 +20,222 @@ ...@@ -20,84 +20,222 @@
#include "test_dr.h" #include "test_dr.h"
/* video stream */ /* video stream (b_mpeg2 = false) */
int main_vstream() int main_vstream_1()
{ {
BOZO_VARS(vstream); BOZO_VARS(vstream);
BOZO_START(video stream); BOZO_START(video stream (b_mpeg2 = false));
/* BEGIN start */
/* check b_multiple_frame_rate */
BOZO_init_boolean(b_multiple_frame_rate, 0);
BOZO_init_integer(i_frame_rate_code, 0);
s_decoded.b_mpeg2 = 0;
BOZO_init_boolean(b_constrained_parameter, 0);
BOZO_init_boolean(b_still_picture, 0);
BOZO_begin_boolean(b_multiple_frame_rate) BOZO_begin_boolean(b_multiple_frame_rate)
BOZO_begin_integer(i_frame_rate_code, 4) BOZO_DOJOB(VStream);
BOZO_begin_boolean(b_mpeg2) BOZO_check_boolean(b_multiple_frame_rate)
BOZO_CLEAN();
BOZO_end_boolean(b_multiple_frame_rate)
/* check i_frame_rate_code */
BOZO_init_boolean(b_multiple_frame_rate, 0);
BOZO_init_integer(i_frame_rate_code, 0);
s_decoded.b_mpeg2 = 0;
BOZO_init_boolean(b_constrained_parameter, 0);
BOZO_init_boolean(b_still_picture, 0);
BOZO_begin_integer(i_frame_rate_code, 4, 0)
BOZO_DOJOB(VStream);
BOZO_check_integer(i_frame_rate_code, 4)
BOZO_CLEAN();
BOZO_end_integer(i_frame_rate_code, 4, (1 << 4) - 1, 1)
/* check b_constrained_parameter */
BOZO_init_boolean(b_multiple_frame_rate, 0);
BOZO_init_integer(i_frame_rate_code, 0);
s_decoded.b_mpeg2 = 0;
BOZO_init_boolean(b_constrained_parameter, 0);
BOZO_init_boolean(b_still_picture, 0);
BOZO_begin_boolean(b_constrained_parameter) BOZO_begin_boolean(b_constrained_parameter)
BOZO_begin_boolean(b_still_picture) BOZO_DOJOB(VStream);
BOZO_begin_integer(i_profile_level_indication, 8) BOZO_check_boolean(b_constrained_parameter)
BOZO_begin_integer(i_chroma_format, 2) BOZO_CLEAN();
BOZO_begin_boolean(b_frame_rate_extension) BOZO_end_boolean(b_constrained_parameter)
/* BEGIN end */
/* check b_still_picture */
BOZO_init_boolean(b_multiple_frame_rate, 0);
BOZO_init_integer(i_frame_rate_code, 0);
s_decoded.b_mpeg2 = 0;
BOZO_init_boolean(b_constrained_parameter, 0);
BOZO_init_boolean(b_still_picture, 0);
BOZO_begin_boolean(b_still_picture)
BOZO_DOJOB(VStream); BOZO_DOJOB(VStream);
BOZO_check_boolean(b_still_picture)
BOZO_CLEAN();
BOZO_end_boolean(b_still_picture)
BOZO_END(video stream (b_mpeg2 = false));
return i_err;
}
/* CHECK start */ /* video stream (b_mpeg2 = true) */
int main_vstream_2()
{
BOZO_VARS(vstream);
BOZO_START(video stream (b_mpeg2 = true));
/* check b_multiple_frame_rate */
BOZO_init_boolean(b_multiple_frame_rate, 0);
BOZO_init_integer(i_frame_rate_code, 0);
s_decoded.b_mpeg2 = 12;
BOZO_init_boolean(b_constrained_parameter, 0);
BOZO_init_boolean(b_still_picture, 0);
BOZO_init_integer(i_profile_level_indication, 0);
BOZO_init_integer(i_chroma_format, 0);
BOZO_init_boolean(b_frame_rate_extension, 0);
BOZO_begin_boolean(b_multiple_frame_rate)
BOZO_DOJOB(VStream);
BOZO_check_boolean(b_multiple_frame_rate) BOZO_check_boolean(b_multiple_frame_rate)
BOZO_CLEAN();
BOZO_end_boolean(b_multiple_frame_rate)
/* check i_frame_rate_code */
BOZO_init_boolean(b_multiple_frame_rate, 0);
BOZO_init_integer(i_frame_rate_code, 0);
s_decoded.b_mpeg2 = 12;
BOZO_init_boolean(b_constrained_parameter, 0);
BOZO_init_boolean(b_still_picture, 0);
BOZO_init_integer(i_profile_level_indication, 0);
BOZO_init_integer(i_chroma_format, 0);
BOZO_init_boolean(b_frame_rate_extension, 0);
BOZO_begin_integer(i_frame_rate_code, 4, 0)
BOZO_DOJOB(VStream);
BOZO_check_integer(i_frame_rate_code, 4) BOZO_check_integer(i_frame_rate_code, 4)
BOZO_check_boolean(b_mpeg2) BOZO_CLEAN();
BOZO_end_integer(i_frame_rate_code, 4, (1 << 4) - 1, 1)
/* check b_constrained_parameter */
BOZO_init_boolean(b_multiple_frame_rate, 0);
BOZO_init_integer(i_frame_rate_code, 0);
s_decoded.b_mpeg2 = 12;
BOZO_init_boolean(b_constrained_parameter, 0);
BOZO_init_boolean(b_still_picture, 0);
BOZO_init_integer(i_profile_level_indication, 0);
BOZO_init_integer(i_chroma_format, 0);
BOZO_init_boolean(b_frame_rate_extension, 0);
BOZO_begin_boolean(b_constrained_parameter)
BOZO_DOJOB(VStream);
BOZO_check_boolean(b_constrained_parameter) BOZO_check_boolean(b_constrained_parameter)
BOZO_CLEAN();
BOZO_end_boolean(b_constrained_parameter)
/* check b_still_picture */
BOZO_init_boolean(b_multiple_frame_rate, 0);
BOZO_init_integer(i_frame_rate_code, 0);
s_decoded.b_mpeg2 = 12;
BOZO_init_boolean(b_constrained_parameter, 0);
BOZO_init_boolean(b_still_picture, 0);
BOZO_init_integer(i_profile_level_indication, 0);
BOZO_init_integer(i_chroma_format, 0);
BOZO_init_boolean(b_frame_rate_extension, 0);
BOZO_begin_boolean(b_still_picture)
BOZO_DOJOB(VStream);
BOZO_check_boolean(b_still_picture) BOZO_check_boolean(b_still_picture)
if(s_decoded.b_mpeg2) BOZO_CLEAN();
{ BOZO_end_boolean(b_still_picture)
/* check i_profile_level_indication */
BOZO_init_boolean(b_multiple_frame_rate, 0);
BOZO_init_integer(i_frame_rate_code, 0);
s_decoded.b_mpeg2 = 12;
BOZO_init_boolean(b_constrained_parameter, 0);
BOZO_init_boolean(b_still_picture, 0);
BOZO_init_integer(i_profile_level_indication, 0);
BOZO_init_integer(i_chroma_format, 0);
BOZO_init_boolean(b_frame_rate_extension, 0);
BOZO_begin_integer(i_profile_level_indication, 8, 0)
BOZO_DOJOB(VStream);
BOZO_check_integer(i_profile_level_indication, 8) BOZO_check_integer(i_profile_level_indication, 8)
BOZO_CLEAN();
BOZO_end_integer(i_profile_level_indication, 8, 0xff - 1, 1)
/* check i_chroma_format */
BOZO_init_boolean(b_multiple_frame_rate, 0);
BOZO_init_integer(i_frame_rate_code, 0);
s_decoded.b_mpeg2 = 12;
BOZO_init_boolean(b_constrained_parameter, 0);
BOZO_init_boolean(b_still_picture, 0);
BOZO_init_integer(i_profile_level_indication, 0);
BOZO_init_integer(i_chroma_format, 0);
BOZO_init_boolean(b_frame_rate_extension, 0);
BOZO_begin_integer(i_chroma_format, 2, 0)
BOZO_DOJOB(VStream);
BOZO_check_integer(i_chroma_format, 2) BOZO_check_integer(i_chroma_format, 2)
BOZO_CLEAN();
BOZO_end_integer(i_chroma_format, 2, (1 << 2) - 1, 1)
/* check b_frame_rate_extension */
BOZO_init_boolean(b_multiple_frame_rate, 0);
BOZO_init_integer(i_frame_rate_code, 0);
s_decoded.b_mpeg2 = 12;
BOZO_init_boolean(b_constrained_parameter, 0);
BOZO_init_boolean(b_still_picture, 0);
BOZO_init_integer(i_profile_level_indication, 0);
BOZO_init_integer(i_chroma_format, 0);
BOZO_init_boolean(b_frame_rate_extension, 0);
BOZO_begin_boolean(b_frame_rate_extension)
BOZO_DOJOB(VStream);
BOZO_check_boolean(b_frame_rate_extension) BOZO_check_boolean(b_frame_rate_extension)
}
/* CHECK end */
BOZO_CLEAN(); BOZO_CLEAN();
/* END start */
BOZO_end_boolean(b_frame_rate_extension) BOZO_end_boolean(b_frame_rate_extension)
BOZO_end_integer(i_chroma_format, 2)
BOZO_end_integer(i_profile_level_indication, 8)
BOZO_end_boolean(b_still_picture)
BOZO_end_boolean(b_constrained_parameter)
BOZO_end_boolean(b_mpeg2)
BOZO_end_integer(i_frame_rate_code, 4)
BOZO_end_boolean(b_multiple_frame_rate)
/* END end */
BOZO_END(video stream);
BOZO_END(video stream (b_mpeg2 = true));
return i_err; return i_err;
} }
/* audio stream */ /* audio stream */
int main_astream() int main_astream_()
{ {
BOZO_VARS(astream); BOZO_VARS(astream);
BOZO_START(audio stream); BOZO_START(audio stream);
/* BEGIN start */
/* check b_free_format */
BOZO_init_boolean(b_free_format, 0);
BOZO_init_integer(i_id, 0);
BOZO_init_integer(i_layer, 0);
BOZO_begin_boolean(b_free_format) BOZO_begin_boolean(b_free_format)
BOZO_begin_integer(i_id, 1)
BOZO_begin_integer(i_layer, 2)
/* BEGIN end */
BOZO_DOJOB(AStream); BOZO_DOJOB(AStream);
/* CHECK start */
BOZO_check_boolean(b_free_format) BOZO_check_boolean(b_free_format)
BOZO_CLEAN();
BOZO_end_boolean(b_free_format)
/* check i_id */
BOZO_init_boolean(b_free_format, 0);
BOZO_init_integer(i_id, 0);
BOZO_init_integer(i_layer, 0);
BOZO_begin_integer(i_id, 1, 0)
BOZO_DOJOB(AStream);
BOZO_check_integer(i_id, 1) BOZO_check_integer(i_id, 1)
BOZO_check_integer(i_layer, 2) BOZO_CLEAN();
/* CHECK end */ BOZO_end_integer(i_id, 1, (1 << 1) - 1, 1)
/* check i_layer */
BOZO_init_boolean(b_free_format, 0);
BOZO_init_integer(i_id, 0);
BOZO_init_integer(i_layer, 0);
BOZO_begin_integer(i_layer, 2, 0)
BOZO_DOJOB(AStream);
BOZO_check_integer(i_layer, 2)
BOZO_CLEAN(); BOZO_CLEAN();
BOZO_end_integer(i_layer, 2, (1 << 2) - 1, 1)
/* END start */
BOZO_end_integer(i_layer, 2)
BOZO_end_integer(i_id, 1)
BOZO_end_boolean(b_free_format)
/* END end */
BOZO_END(audio stream); BOZO_END(audio stream);
...@@ -105,35 +243,56 @@ int main_astream() ...@@ -105,35 +243,56 @@ int main_astream()
} }
/* hierarchy */ /* hierarchy */
int main_hierarchy() int main_hierarchy_()
{ {
BOZO_VARS(hierarchy); BOZO_VARS(hierarchy);
BOZO_START(hierarchy); BOZO_START(hierarchy);
/* BEGIN start */
BOZO_begin_integer(i_h_type, 4) /* check i_h_type */
BOZO_begin_integer(i_h_layer_index, 6) BOZO_init_integer(i_h_type, 0);
BOZO_begin_integer(i_h_embedded_layer, 6) BOZO_init_integer(i_h_layer_index, 0);
BOZO_begin_integer(i_h_priority, 6) BOZO_init_integer(i_h_embedded_layer, 0);
/* BEGIN end */ BOZO_init_integer(i_h_priority, 0);
BOZO_begin_integer(i_h_type, 4, 0)
BOZO_DOJOB(Hierarchy); BOZO_DOJOB(Hierarchy);
/* CHECK start */
BOZO_check_integer(i_h_type, 4) BOZO_check_integer(i_h_type, 4)
BOZO_CLEAN();
BOZO_end_integer(i_h_type, 4, (1 << 4) - 1, 1)
/* check i_h_layer_index */
BOZO_init_integer(i_h_type, 0);
BOZO_init_integer(i_h_layer_index, 0);
BOZO_init_integer(i_h_embedded_layer, 0);
BOZO_init_integer(i_h_priority, 0);
BOZO_begin_integer(i_h_layer_index, 6, 0)
BOZO_DOJOB(Hierarchy);
BOZO_check_integer(i_h_layer_index, 6) BOZO_check_integer(i_h_layer_index, 6)
BOZO_CLEAN();
BOZO_end_integer(i_h_layer_index, 6, (1 << 6) - 1, 1)
/* check i_h_embedded_layer */
BOZO_init_integer(i_h_type, 0);
BOZO_init_integer(i_h_layer_index, 0);
BOZO_init_integer(i_h_embedded_layer, 0);
BOZO_init_integer(i_h_priority, 0);
BOZO_begin_integer(i_h_embedded_layer, 6, 0)
BOZO_DOJOB(Hierarchy);
BOZO_check_integer(i_h_embedded_layer, 6) BOZO_check_integer(i_h_embedded_layer, 6)
BOZO_CLEAN();
BOZO_end_integer(i_h_embedded_layer, 6, (1 << 6) - 1, 1)
/* check i_h_priority */
BOZO_init_integer(i_h_type, 0);
BOZO_init_integer(i_h_layer_index, 0);
BOZO_init_integer(i_h_embedded_layer, 0);
BOZO_init_integer(i_h_priority, 0);
BOZO_begin_integer(i_h_priority, 6, 0)
BOZO_DOJOB(Hierarchy);
BOZO_check_integer(i_h_priority, 6) BOZO_check_integer(i_h_priority, 6)
/* CHECK end */
BOZO_CLEAN(); BOZO_CLEAN();
BOZO_end_integer(i_h_priority, 6, (1 << 6) - 1, 1)
/* END start */
BOZO_end_integer(i_h_priority, 6)
BOZO_end_integer(i_h_embedded_layer, 6)
BOZO_end_integer(i_h_layer_index, 6)
BOZO_end_integer(i_h_type, 4)
/* END end */
BOZO_END(hierarchy); BOZO_END(hierarchy);
...@@ -141,27 +300,32 @@ int main_hierarchy() ...@@ -141,27 +300,32 @@ int main_hierarchy()
} }
/* registration */ /* registration */
int main_registration() int main_registration_()
{ {
BOZO_VARS(registration); BOZO_VARS(registration);
BOZO_START(registration); BOZO_START(registration);
/* BEGIN start */
/* check i_format_identifier */
s_decoded.i_additional_length = 0; s_decoded.i_additional_length = 0;
BOZO_begin_integer(i_format_identifier, 32) BOZO_init_integer(i_format_identifier, 0);
/* BEGIN end */ BOZO_init_integer(i_format_identifier, 0);
BOZO_begin_integer(i_format_identifier, 32, 0)
BOZO_DOJOB(Registration); BOZO_DOJOB(Registration);
/* CHECK start */
BOZO_check_integer32(i_format_identifier, 32) BOZO_check_integer32(i_format_identifier, 32)
/* CHECK end */ BOZO_CLEAN();
BOZO_end_integer(i_format_identifier, 32, 0xffff, 1)
/* check i_format_identifier */
s_decoded.i_additional_length = 0;
BOZO_init_integer(i_format_identifier, 0);
BOZO_init_integer(i_format_identifier, 0);
BOZO_begin_integer(i_format_identifier, 32, 0)
BOZO_DOJOB(Registration);
BOZO_check_integer32(i_format_identifier, 32)
BOZO_CLEAN(); BOZO_CLEAN();
BOZO_end_integer(i_format_identifier, 32, 0xffff0000, 0x10000)
/* END start */
BOZO_end_integer32(i_format_identifier, 32)
/* END end */
BOZO_END(registration); BOZO_END(registration);
...@@ -169,26 +333,20 @@ int main_registration() ...@@ -169,26 +333,20 @@ int main_registration()
} }
/* data stream alignment */ /* data stream alignment */
int main_ds_alignment() int main_ds_alignment_()
{ {
BOZO_VARS(ds_alignment); BOZO_VARS(ds_alignment);
BOZO_START(data stream alignment); BOZO_START(data stream alignment);
/* BEGIN start */
BOZO_begin_integer(i_alignment_type, 8) /* check i_alignment_type */
/* BEGIN end */ BOZO_init_integer(i_alignment_type, 0);
BOZO_begin_integer(i_alignment_type, 8, 0)
BOZO_DOJOB(DSAlignment); BOZO_DOJOB(DSAlignment);
/* CHECK start */
BOZO_check_integer(i_alignment_type, 8) BOZO_check_integer(i_alignment_type, 8)
/* CHECK end */
BOZO_CLEAN(); BOZO_CLEAN();
BOZO_end_integer(i_alignment_type, 8, 0xff - 1, 1)
/* END start */
BOZO_end_integer(i_alignment_type, 8)
/* END end */
BOZO_END(data stream alignment); BOZO_END(data stream alignment);
...@@ -196,32 +354,42 @@ int main_ds_alignment() ...@@ -196,32 +354,42 @@ int main_ds_alignment()
} }
/* target background grid */ /* target background grid */
int main_target_bg_grid() int main_target_bg_grid_()
{ {
BOZO_VARS(target_bg_grid); BOZO_VARS(target_bg_grid);
BOZO_START(target background grid); BOZO_START(target background grid);
/* BEGIN start */
BOZO_begin_integer(i_horizontal_size, 14) /* check i_horizontal_size */
BOZO_begin_integer(i_vertical_size, 14) BOZO_init_integer(i_horizontal_size, 0);
BOZO_begin_integer(i_pel_aspect_ratio, 4) BOZO_init_integer(i_vertical_size, 0);
/* BEGIN end */ BOZO_init_integer(i_pel_aspect_ratio, 0);
BOZO_begin_integer(i_horizontal_size, 14, 0)
BOZO_DOJOB(TargetBgGrid); BOZO_DOJOB(TargetBgGrid);
/* CHECK start */
BOZO_check_integer(i_horizontal_size, 14) BOZO_check_integer(i_horizontal_size, 14)
BOZO_CLEAN();
BOZO_end_integer(i_horizontal_size, 14, (1 << 14) - 1, 1)
/* check i_vertical_size */
BOZO_init_integer(i_horizontal_size, 0);
BOZO_init_integer(i_vertical_size, 0);
BOZO_init_integer(i_pel_aspect_ratio, 0);
BOZO_begin_integer(i_vertical_size, 14, 0)
BOZO_DOJOB(TargetBgGrid);
BOZO_check_integer(i_vertical_size, 14) BOZO_check_integer(i_vertical_size, 14)
BOZO_check_integer(i_pel_aspect_ratio, 4) BOZO_CLEAN();
/* CHECK end */ BOZO_end_integer(i_vertical_size, 14, (1 << 14) - 1, 1)
/* check i_pel_aspect_ratio */
BOZO_init_integer(i_horizontal_size, 0);
BOZO_init_integer(i_vertical_size, 0);
BOZO_init_integer(i_pel_aspect_ratio, 0);
BOZO_begin_integer(i_pel_aspect_ratio, 4, 0)
BOZO_DOJOB(TargetBgGrid);
BOZO_check_integer(i_pel_aspect_ratio, 4)
BOZO_CLEAN(); BOZO_CLEAN();
BOZO_end_integer(i_pel_aspect_ratio, 4, (1 << 4) - 1, 1)
/* END start */
BOZO_end_integer(i_pel_aspect_ratio, 4)
BOZO_end_integer(i_vertical_size, 14)
BOZO_end_integer(i_horizontal_size, 14)
/* END end */
BOZO_END(target background grid); BOZO_END(target background grid);
...@@ -229,32 +397,42 @@ int main_target_bg_grid() ...@@ -229,32 +397,42 @@ int main_target_bg_grid()
} }
/* video window */ /* video window */
int main_vwindow() int main_vwindow_()
{ {
BOZO_VARS(vwindow); BOZO_VARS(vwindow);
BOZO_START(video window); BOZO_START(video window);
/* BEGIN start */
BOZO_begin_integer(i_horizontal_offset, 14) /* check i_horizontal_offset */
BOZO_begin_integer(i_vertical_offset, 14) BOZO_init_integer(i_horizontal_offset, 0);
BOZO_begin_integer(i_window_priority, 4) BOZO_init_integer(i_vertical_offset, 0);
/* BEGIN end */ BOZO_init_integer(i_window_priority, 0);
BOZO_begin_integer(i_horizontal_offset, 14, 0)
BOZO_DOJOB(VWindow); BOZO_DOJOB(VWindow);
/* CHECK start */
BOZO_check_integer(i_horizontal_offset, 14) BOZO_check_integer(i_horizontal_offset, 14)
BOZO_CLEAN();
BOZO_end_integer(i_horizontal_offset, 14, (1 << 14) - 1, 1)
/* check i_vertical_offset */
BOZO_init_integer(i_horizontal_offset, 0);
BOZO_init_integer(i_vertical_offset, 0);
BOZO_init_integer(i_window_priority, 0);
BOZO_begin_integer(i_vertical_offset, 14, 0)
BOZO_DOJOB(VWindow);
BOZO_check_integer(i_vertical_offset, 14) BOZO_check_integer(i_vertical_offset, 14)
BOZO_check_integer(i_window_priority, 4) BOZO_CLEAN();
/* CHECK end */ BOZO_end_integer(i_vertical_offset, 14, (1 << 14) - 1, 1)
/* check i_window_priority */
BOZO_init_integer(i_horizontal_offset, 0);
BOZO_init_integer(i_vertical_offset, 0);
BOZO_init_integer(i_window_priority, 0);
BOZO_begin_integer(i_window_priority, 4, 0)
BOZO_DOJOB(VWindow);
BOZO_check_integer(i_window_priority, 4)
BOZO_CLEAN(); BOZO_CLEAN();
BOZO_end_integer(i_window_priority, 4, (1 << 4) - 1, 1)
/* END start */
BOZO_end_integer(i_window_priority, 4)
BOZO_end_integer(i_vertical_offset, 14)
BOZO_end_integer(i_horizontal_offset, 14)
/* END end */
BOZO_END(video window); BOZO_END(video window);
...@@ -262,30 +440,32 @@ int main_vwindow() ...@@ -262,30 +440,32 @@ int main_vwindow()
} }
/* conditional access */ /* conditional access */
int main_ca() int main_ca_()
{ {
BOZO_VARS(ca); BOZO_VARS(ca);
BOZO_START(conditional access); BOZO_START(conditional access);
/* BEGIN start */
/* check i_ca_system_id */
s_decoded.i_private_length = 0; s_decoded.i_private_length = 0;
BOZO_begin_integer(i_ca_system_id, 16) BOZO_init_integer(i_ca_system_id, 0);
BOZO_begin_integer(i_ca_pid, 13) BOZO_init_integer(i_ca_pid, 0);
/* BEGIN end */ BOZO_begin_integer(i_ca_system_id, 16, 0)
BOZO_DOJOB(CA); BOZO_DOJOB(CA);
/* CHECK start */
BOZO_check_integer(i_ca_system_id, 16) BOZO_check_integer(i_ca_system_id, 16)
BOZO_check_integer(i_ca_pid, 13) BOZO_CLEAN();
/* CHECK end */ BOZO_end_integer(i_ca_system_id, 16, 0xffff - 1, 1)
/* check i_ca_pid */
s_decoded.i_private_length = 0;
BOZO_init_integer(i_ca_system_id, 0);
BOZO_init_integer(i_ca_pid, 0);
BOZO_begin_integer(i_ca_pid, 13, 0)
BOZO_DOJOB(CA);
BOZO_check_integer(i_ca_pid, 13)
BOZO_CLEAN(); BOZO_CLEAN();
BOZO_end_integer(i_ca_pid, 13, (1 << 13) - 1, 1)
/* END start */
BOZO_end_integer(i_ca_pid, 13)
BOZO_end_integer(i_ca_system_id, 16)
/* END end */
BOZO_END(conditional access); BOZO_END(conditional access);
...@@ -293,27 +473,21 @@ int main_ca() ...@@ -293,27 +473,21 @@ int main_ca()
} }
/* ISO 639 language */ /* ISO 639 language */
int main_iso639() int main_iso639_()
{ {
BOZO_VARS(iso639); BOZO_VARS(iso639);
BOZO_START(ISO 639 language); BOZO_START(ISO 639 language);
/* BEGIN start */
/* check i_audio_type */
s_decoded.i_code_count = 0; s_decoded.i_code_count = 0;
BOZO_begin_integer(i_audio_type, 8) BOZO_init_integer(i_audio_type, 0);
/* BEGIN end */ BOZO_begin_integer(i_audio_type, 8, 0)
BOZO_DOJOB(ISO639); BOZO_DOJOB(ISO639);
/* CHECK start */
BOZO_check_integer(i_audio_type, 8) BOZO_check_integer(i_audio_type, 8)
/* CHECK end */
BOZO_CLEAN(); BOZO_CLEAN();
BOZO_end_integer(i_audio_type, 8, 0xff - 1, 1)
/* END start */
BOZO_end_integer(i_audio_type, 8)
/* END end */
BOZO_END(ISO 639 language); BOZO_END(ISO 639 language);
...@@ -326,15 +500,16 @@ int main() ...@@ -326,15 +500,16 @@ int main()
{ {
int i_err = 0; int i_err = 0;
i_err |= main_vstream(); i_err |= main_vstream_1();
i_err |= main_astream(); i_err |= main_vstream_2();
i_err |= main_hierarchy(); i_err |= main_astream_();
i_err |= main_registration(); i_err |= main_hierarchy_();
i_err |= main_ds_alignment(); i_err |= main_registration_();
i_err |= main_target_bg_grid(); i_err |= main_ds_alignment_();
i_err |= main_vwindow(); i_err |= main_target_bg_grid_();
i_err |= main_ca(); i_err |= main_vwindow_();
i_err |= main_iso639(); i_err |= main_ca_();
i_err |= main_iso639_();
return i_err; return i_err;
} }
......
/***************************************************************************** /*****************************************************************************
* test_dr.h * test_dr.h
* (c)2001-2002 VideoLAN * (c)2001-2002 VideoLAN
* $Id: test_dr.h,v 1.1 2002/05/09 17:00:03 bozo Exp $ * $Id: test_dr.h,v 1.2 2002/05/09 19:59:20 bozo Exp $
* *
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr> * Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
* *
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
#define BOZO_VARS(sname) \ #define BOZO_VARS(sname) \
int i_err = 0; \ int i_err = 0; \
long long unsigned int i_loop_count = 0; \ long long unsigned int i_loop_count; \
dvbpsi_##sname##_dr_t s_decoded, *p_new_decoded; \ dvbpsi_##sname##_dr_t s_decoded, *p_new_decoded; \
dvbpsi_descriptor_t * p_descriptor; dvbpsi_descriptor_t * p_descriptor;
...@@ -33,8 +33,7 @@ ...@@ -33,8 +33,7 @@
#define BOZO_DOJOB(fname) \ #define BOZO_DOJOB(fname) \
if(!(i_loop_count & 0xffff)) \ if(!(i_loop_count & 0xffff)) \
fprintf(stdout, "\r iteration count: %22llu [%llu]", \ fprintf(stdout, "\r iteration count: %22llu", i_loop_count); \
i_loop_count, (uint64_t)(-1)); \
i_loop_count++; \ i_loop_count++; \
p_descriptor = dvbpsi_Gen##fname##Dr(&s_decoded, 0); \ p_descriptor = dvbpsi_Gen##fname##Dr(&s_decoded, 0); \
p_new_decoded = dvbpsi_Decode##fname##Dr(p_descriptor); p_new_decoded = dvbpsi_Decode##fname##Dr(p_descriptor);
...@@ -43,34 +42,36 @@ ...@@ -43,34 +42,36 @@
fprintf(stdout, "\"%s\" descriptor check:\n", #name); fprintf(stdout, "\"%s\" descriptor check:\n", #name);
#define BOZO_END(name) \ #define BOZO_END(name) \
fprintf(stdout, "\r iteration count: %22llu [%llu]\n", \
i_loop_count, (uint64_t)(-1)); \
if(i_err) \ if(i_err) \
fprintf(stderr, "\"%s\" descriptor check FAILED\n\n", #name); \ fprintf(stderr, "\"%s\" descriptor check FAILED !!!\n\n", #name); \
else \ else \
fprintf(stdout, "\"%s\" descriptor check succeeded\n\n", #name); fprintf(stdout, "\"%s\" descriptor check succeeded\n\n", #name);
/* integer */ /* integer */
#define BOZO_begin_integer(name, bitcount) \ #define BOZO_init_integer(name, default) \
s_decoded.name = 0; \ s_decoded.name = default;
do \
{ #define BOZO_begin_integer(name, bitcount, min) \
if(!i_err) \
#define BOZO_end_integer(name, bitcount) \ { \
s_decoded.name++; \ fprintf(stdout, " \"%s\" %u bit(s) integer check\n", \
} while(!i_err \ #name, bitcount); \
&& ((s_decoded.name & ((1 << bitcount) - 1)) != 0)); i_loop_count = 0; \
s_decoded.name = min; \
#define BOZO_end_integer32(name, bitcount) \ do \
s_decoded.name++; \ {
} while(!i_err \
&& ((s_decoded.name & 0xffffffff) != 0)); #define BOZO_end_integer(name, bitcount, max, step) \
s_decoded.name += step; \
#define BOZO_end_integer64(name, bitcount) \ } while(!i_err \
s_decoded.name++; \ && (s_decoded.name != max + step)); \
} while(!i_err \ fprintf(stdout, "\r iteration count: %22llu", i_loop_count); \
&& ((s_decoded.name & 0xffffffffffffffff) != 0)); if(i_err) \
fprintf(stdout, " FAILED !!!\n"); \
else \
fprintf(stdout, " Ok.\n"); \
}
#define BOZO_check_integer(name, bitcount) \ #define BOZO_check_integer(name, bitcount) \
if(!i_err && (s_decoded.name != p_new_decoded->name)) \ if(!i_err && (s_decoded.name != p_new_decoded->name)) \
...@@ -119,14 +120,27 @@ ...@@ -119,14 +120,27 @@
/* boolean */ /* boolean */
#define BOZO_init_boolean(name, default) \
s_decoded.name = default;
#define BOZO_begin_boolean(name) \ #define BOZO_begin_boolean(name) \
s_decoded.name = 0; \ if(!i_err) \
do \ { \
{ fprintf(stdout, " \"%s\" boolean check\n", #name); \
i_loop_count = 0; \
s_decoded.name = 0; \
do \
{
#define BOZO_end_boolean(name) \ #define BOZO_end_boolean(name) \
s_decoded.name += 12; \ s_decoded.name += 12; \
} while(!i_err && (s_decoded.name <= 12)); } while(!i_err && (s_decoded.name <= 12)); \
fprintf(stdout, "\r iteration count: %22llu", i_loop_count); \
if(i_err) \
fprintf(stdout, " FAILED !!!\n"); \
else \
fprintf(stdout, " Ok.\n"); \
}
#define BOZO_check_boolean(name) \ #define BOZO_check_boolean(name) \
if( !i_err \ if( !i_err \
......
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