* 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 @@
<!ELEMENT check (#PCDATA)>
<!ELEMENT end (#PCDATA)>
<!ATTLIST descriptor name CDATA #IMPLIED>
<!ATTLIST descriptor sname CDATA #IMPLIED>
<!ATTLIST descriptor fname CDATA #IMPLIED>
<!ATTLIST descriptor msuffix CDATA #IMPLIED>
<!ATTLIST integer name 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 default CDATA #IMPLIED>
......@@ -2,37 +2,42 @@
<!DOCTYPE dr SYSTEM "dr.dtd">
<dr>
<descriptor name="video stream" sname="vstream" fname="VStream">
<boolean name="b_multiple_frame_rate" />
<integer name="i_frame_rate_code" bitcount="4" />
<boolean name="b_mpeg2" />
<boolean name="b_constrained_parameter" />
<boolean name="b_still_picture" />
<descriptor name="video stream (b_mpeg2 = false)" sname="vstream" fname="VStream" msuffix="1" >
<boolean name="b_multiple_frame_rate" default="0" />
<integer name="i_frame_rate_code" bitcount="4" default="0" />
<insert>
<check>
if(s_decoded.b_mpeg2)
{</check>
<begin>
s_decoded.b_mpeg2 = 0;</begin>
</insert>
<integer name="i_profile_level_indication" bitcount="8" />
<integer name="i_chroma_format" bitcount="2" />
<boolean name="b_frame_rate_extension" />
<boolean name="b_constrained_parameter" default="0" />
<boolean name="b_still_picture" default="0" />
</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>
<check>
}</check>
<begin>
s_decoded.b_mpeg2 = 12;</begin>
</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 name="audio stream" sname="astream" fname="AStream">
<boolean name="b_free_format" />
<integer name="i_id" bitcount="1" />
<integer name="i_layer" bitcount="2" />
<boolean name="b_free_format" default="0" />
<integer name="i_id" bitcount="1" default="0" />
<integer name="i_layer" bitcount="2" default="0" />
</descriptor>
<descriptor name="hierarchy" sname="hierarchy" fname="Hierarchy">
<integer name="i_h_type" bitcount="4" />
<integer name="i_h_layer_index" bitcount="6" />
<integer name="i_h_embedded_layer" bitcount="6" />
<integer name="i_h_priority" bitcount="6" />
<integer name="i_h_type" bitcount="4" default="0" />
<integer name="i_h_layer_index" bitcount="6" default="0" />
<integer name="i_h_embedded_layer" bitcount="6" default="0" />
<integer name="i_h_priority" bitcount="6" default="0" />
</descriptor>
<descriptor name="registration" sname="registration" fname="Registration">
......@@ -40,23 +45,24 @@
<begin>
s_decoded.i_additional_length = 0;</begin>
</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 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 name="target background grid" sname="target_bg_grid" fname="TargetBgGrid">
<integer name="i_horizontal_size" bitcount="14" />
<integer name="i_vertical_size" bitcount="14" />
<integer name="i_pel_aspect_ratio" bitcount="4" />
<integer name="i_horizontal_size" bitcount="14" default="0" />
<integer name="i_vertical_size" bitcount="14" default="0" />
<integer name="i_pel_aspect_ratio" bitcount="4" default="0" />
</descriptor>
<descriptor name="video window" sname="vwindow" fname="VWindow">
<integer name="i_horizontal_offset" bitcount="14" />
<integer name="i_vertical_offset" bitcount="14" />
<integer name="i_window_priority" bitcount="4" />
<integer name="i_horizontal_offset" bitcount="14" default="0" />
<integer name="i_vertical_offset" bitcount="14" default="0" />
<integer name="i_window_priority" bitcount="4" default="0" />
</descriptor>
<descriptor name="conditional access" sname="ca" fname="CA">
......@@ -64,8 +70,8 @@
<begin>
s_decoded.i_private_length = 0;</begin>
</insert>
<integer name="i_ca_system_id" bitcount="16" />
<integer name="i_ca_pid" bitcount="13" />
<integer name="i_ca_system_id" bitcount="16" default="0" max="0xffff - 1" />
<integer name="i_ca_pid" bitcount="13" default="0" />
</descriptor>
<descriptor name="ISO 639 language" sname="iso639" fname="ISO639">
......@@ -73,6 +79,7 @@
<begin>
s_decoded.i_code_count = 0;</begin>
</insert>
<integer name="i_audio_type" bitcount="8" />
<integer name="i_audio_type" bitcount="8" default="0" max="0xff - 1" />
</descriptor>
</dr>
......@@ -49,25 +49,12 @@ int main()
<xsl:template match="descriptor" mode="code">
/* <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_START(<xsl:value-of select="@name" />);
/* BEGIN start */<xsl:apply-templates mode="begin" />
/* 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 */
<xsl:apply-templates mode="check" />
BOZO_END(<xsl:value-of select="@name" />);
......@@ -78,30 +65,42 @@ int main_<xsl:value-of select="@sname" />()
<xsl:template match="text()" mode="code" priority="-1"/>
<!-- -->
<!-- begin templates -->
<!-- init templates -->
<!-- -->
<xsl:template match="integer" mode="begin">
BOZO_begin_integer(<xsl:value-of select="@name" />, <xsl:value-of select="@bitcount" />)</xsl:template>
<xsl:template match="integer" mode="init">
BOZO_init_integer(<xsl:value-of select="@name" />, <xsl:value-of select="@default" />);</xsl:template>
<xsl:template match="boolean" mode="begin">
BOZO_begin_boolean(<xsl:value-of select="@name" />)</xsl:template>
<xsl:template match="boolean" mode="init">
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:template>
<xsl:template match="text()" mode="begin" priority="-1"/>
<xsl:template match="text()" mode="init" priority="-1"/>
<!-- -->
<!-- check templates -->
<!-- -->
<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">
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:value-of select="check" />
......@@ -109,28 +108,12 @@ int main_<xsl:value-of select="@sname" />()
<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 -->
<!-- -->
<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"/>
......
......@@ -20,84 +20,222 @@
#include "test_dr.h"
/* video stream */
int main_vstream()
/* video stream (b_mpeg2 = false) */
int main_vstream_1()
{
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_integer(i_frame_rate_code, 4)
BOZO_begin_boolean(b_mpeg2)
BOZO_DOJOB(VStream);
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_still_picture)
BOZO_begin_integer(i_profile_level_indication, 8)
BOZO_begin_integer(i_chroma_format, 2)
BOZO_begin_boolean(b_frame_rate_extension)
/* BEGIN end */
BOZO_DOJOB(VStream);
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 = 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_check_boolean(b_still_picture)
BOZO_CLEAN();
BOZO_end_boolean(b_still_picture)
BOZO_END(video stream (b_mpeg2 = false));
/* CHECK start */
return i_err;
}
/* 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_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_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_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)
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_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_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)
}
/* CHECK end */
BOZO_CLEAN();
/* END start */
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;
}
/* audio stream */
int main_astream()
int main_astream_()
{
BOZO_VARS(astream);
BOZO_START(audio stream);
/* BEGIN start */
BOZO_begin_boolean(b_free_format)
BOZO_begin_integer(i_id, 1)
BOZO_begin_integer(i_layer, 2)
/* BEGIN end */
/* 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_DOJOB(AStream);
/* CHECK start */
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_layer, 2)
/* CHECK end */
BOZO_CLEAN();
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_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);
......@@ -105,35 +243,56 @@ int main_astream()
}
/* hierarchy */
int main_hierarchy()
int main_hierarchy_()
{
BOZO_VARS(hierarchy);
BOZO_START(hierarchy);
/* BEGIN start */
BOZO_begin_integer(i_h_type, 4)
BOZO_begin_integer(i_h_layer_index, 6)
BOZO_begin_integer(i_h_embedded_layer, 6)
BOZO_begin_integer(i_h_priority, 6)
/* BEGIN end */
/* check i_h_type */
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_type, 4, 0)
BOZO_DOJOB(Hierarchy);
/* CHECK start */
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_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_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)
/* CHECK end */
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);
......@@ -141,27 +300,32 @@ int main_hierarchy()
}
/* registration */
int main_registration()
int main_registration_()
{
BOZO_VARS(registration);
BOZO_START(registration);
/* BEGIN start */
s_decoded.i_additional_length = 0;
BOZO_begin_integer(i_format_identifier, 32)
/* BEGIN end */
/* 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);
/* CHECK start */
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_end_integer(i_format_identifier, 32, 0xffff0000, 0x10000)
/* END start */
BOZO_end_integer32(i_format_identifier, 32)
/* END end */
BOZO_END(registration);
......@@ -169,26 +333,20 @@ int main_registration()
}
/* data stream alignment */
int main_ds_alignment()
int main_ds_alignment_()
{
BOZO_VARS(ds_alignment);
BOZO_START(data stream alignment);
/* BEGIN start */
BOZO_begin_integer(i_alignment_type, 8)
/* BEGIN end */
/* check i_alignment_type */
BOZO_init_integer(i_alignment_type, 0);
BOZO_begin_integer(i_alignment_type, 8, 0)
BOZO_DOJOB(DSAlignment);
/* CHECK start */
BOZO_check_integer(i_alignment_type, 8)
/* CHECK end */
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);
......@@ -196,32 +354,42 @@ int main_ds_alignment()
}
/* target background grid */
int main_target_bg_grid()
int main_target_bg_grid_()
{
BOZO_VARS(target_bg_grid);
BOZO_START(target background grid);
/* BEGIN start */
BOZO_begin_integer(i_horizontal_size, 14)
BOZO_begin_integer(i_vertical_size, 14)
BOZO_begin_integer(i_pel_aspect_ratio, 4)
/* BEGIN end */
/* check i_horizontal_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_horizontal_size, 14, 0)
BOZO_DOJOB(TargetBgGrid);
/* CHECK start */
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_pel_aspect_ratio, 4)
/* CHECK end */
BOZO_CLEAN();
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_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);
......@@ -229,32 +397,42 @@ int main_target_bg_grid()
}
/* video window */
int main_vwindow()
int main_vwindow_()
{
BOZO_VARS(vwindow);
BOZO_START(video window);
/* BEGIN start */
BOZO_begin_integer(i_horizontal_offset, 14)
BOZO_begin_integer(i_vertical_offset, 14)
BOZO_begin_integer(i_window_priority, 4)
/* BEGIN end */
/* check i_horizontal_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_horizontal_offset, 14, 0)
BOZO_DOJOB(VWindow);
/* CHECK start */
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_window_priority, 4)
/* CHECK end */
BOZO_CLEAN();
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_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);
......@@ -262,30 +440,32 @@ int main_vwindow()
}
/* conditional access */
int main_ca()
int main_ca_()
{
BOZO_VARS(ca);
BOZO_START(conditional access);
/* BEGIN start */
s_decoded.i_private_length = 0;
BOZO_begin_integer(i_ca_system_id, 16)
BOZO_begin_integer(i_ca_pid, 13)
/* BEGIN end */
/* check i_ca_system_id */
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_system_id, 16, 0)
BOZO_DOJOB(CA);
/* CHECK start */
BOZO_check_integer(i_ca_system_id, 16)
BOZO_check_integer(i_ca_pid, 13)
/* CHECK end */
BOZO_CLEAN();
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_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);
......@@ -293,27 +473,21 @@ int main_ca()
}
/* ISO 639 language */
int main_iso639()
int main_iso639_()
{
BOZO_VARS(iso639);
BOZO_START(ISO 639 language);
/* BEGIN start */
s_decoded.i_code_count = 0;
BOZO_begin_integer(i_audio_type, 8)
/* BEGIN end */
/* check i_audio_type */
s_decoded.i_code_count = 0;
BOZO_init_integer(i_audio_type, 0);
BOZO_begin_integer(i_audio_type, 8, 0)
BOZO_DOJOB(ISO639);
/* CHECK start */
BOZO_check_integer(i_audio_type, 8)
/* CHECK end */
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);
......@@ -326,15 +500,16 @@ int main()
{
int i_err = 0;
i_err |= main_vstream();
i_err |= main_astream();
i_err |= main_hierarchy();
i_err |= main_registration();
i_err |= main_ds_alignment();
i_err |= main_target_bg_grid();
i_err |= main_vwindow();
i_err |= main_ca();
i_err |= main_iso639();
i_err |= main_vstream_1();
i_err |= main_vstream_2();
i_err |= main_astream_();
i_err |= main_hierarchy_();
i_err |= main_registration_();
i_err |= main_ds_alignment_();
i_err |= main_target_bg_grid_();
i_err |= main_vwindow_();
i_err |= main_ca_();
i_err |= main_iso639_();
return i_err;
}
......
/*****************************************************************************
* test_dr.h
* (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>
*
......@@ -24,7 +24,7 @@
#define BOZO_VARS(sname) \
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_descriptor_t * p_descriptor;
......@@ -33,8 +33,7 @@
#define BOZO_DOJOB(fname) \
if(!(i_loop_count & 0xffff)) \
fprintf(stdout, "\r iteration count: %22llu [%llu]", \
i_loop_count, (uint64_t)(-1)); \
fprintf(stdout, "\r iteration count: %22llu", i_loop_count); \
i_loop_count++; \
p_descriptor = dvbpsi_Gen##fname##Dr(&s_decoded, 0); \
p_new_decoded = dvbpsi_Decode##fname##Dr(p_descriptor);
......@@ -43,34 +42,36 @@
fprintf(stdout, "\"%s\" descriptor check:\n", #name);
#define BOZO_END(name) \
fprintf(stdout, "\r iteration count: %22llu [%llu]\n", \
i_loop_count, (uint64_t)(-1)); \
if(i_err) \
fprintf(stderr, "\"%s\" descriptor check FAILED\n\n", #name); \
fprintf(stderr, "\"%s\" descriptor check FAILED !!!\n\n", #name); \
else \
fprintf(stdout, "\"%s\" descriptor check succeeded\n\n", #name);
/* integer */
#define BOZO_begin_integer(name, bitcount) \
s_decoded.name = 0; \
#define BOZO_init_integer(name, default) \
s_decoded.name = default;
#define BOZO_begin_integer(name, bitcount, min) \
if(!i_err) \
{ \
fprintf(stdout, " \"%s\" %u bit(s) integer check\n", \
#name, bitcount); \
i_loop_count = 0; \
s_decoded.name = min; \
do \
{
#define BOZO_end_integer(name, bitcount) \
s_decoded.name++; \
} while(!i_err \
&& ((s_decoded.name & ((1 << bitcount) - 1)) != 0));
#define BOZO_end_integer32(name, bitcount) \
s_decoded.name++; \
} while(!i_err \
&& ((s_decoded.name & 0xffffffff) != 0));
#define BOZO_end_integer64(name, bitcount) \
s_decoded.name++; \
#define BOZO_end_integer(name, bitcount, max, step) \
s_decoded.name += step; \
} while(!i_err \
&& ((s_decoded.name & 0xffffffffffffffff) != 0));
&& (s_decoded.name != max + step)); \
fprintf(stdout, "\r iteration count: %22llu", i_loop_count); \
if(i_err) \
fprintf(stdout, " FAILED !!!\n"); \
else \
fprintf(stdout, " Ok.\n"); \
}
#define BOZO_check_integer(name, bitcount) \
if(!i_err && (s_decoded.name != p_new_decoded->name)) \
......@@ -119,14 +120,27 @@
/* boolean */
#define BOZO_init_boolean(name, default) \
s_decoded.name = default;
#define BOZO_begin_boolean(name) \
if(!i_err) \
{ \
fprintf(stdout, " \"%s\" boolean check\n", #name); \
i_loop_count = 0; \
s_decoded.name = 0; \
do \
{
#define BOZO_end_boolean(name) \
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) \
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