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

parent 9d4d880d
......@@ -20,9 +20,6 @@
<!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>
......@@ -22,7 +22,7 @@
</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_profile_level_indication" bitcount="8" default="0" />
<integer name="i_chroma_format" bitcount="2" default="0" />
<boolean name="b_frame_rate_extension" default="0" />
</descriptor>
......@@ -45,12 +45,11 @@
<begin>
s_decoded.i_additional_length = 0;</begin>
</insert>
<integer name="i_format_identifier" bitcount="32" default="0" max="0xffff" />
<integer name="i_format_identifier" bitcount="32" default="0" max="0xffff0000" step="0x10000" />
<integer name="i_format_identifier" bitcount="32" default="0" />
</descriptor>
<descriptor name="data stream alignment" sname="ds_alignment" fname="DSAlignment">
<integer name="i_alignment_type" bitcount="8" default="0" max="0xff - 1" />
<integer name="i_alignment_type" bitcount="8" default="0" />
</descriptor>
<descriptor name="target background grid" sname="target_bg_grid" fname="TargetBgGrid">
......@@ -70,7 +69,7 @@
<begin>
s_decoded.i_private_length = 0;</begin>
</insert>
<integer name="i_ca_system_id" bitcount="16" default="0" max="0xffff - 1" />
<integer name="i_ca_system_id" bitcount="16" default="0" />
<integer name="i_ca_pid" bitcount="13" default="0" />
</descriptor>
......@@ -79,7 +78,7 @@
<begin>
s_decoded.i_code_count = 0;</begin>
</insert>
<integer name="i_audio_type" bitcount="8" default="0" max="0xff - 1" />
<integer name="i_audio_type" bitcount="8" default="0" />
</descriptor>
</dr>
......@@ -36,6 +36,11 @@ int main()
int i_err = 0;
<xsl:apply-templates mode="main" />
if(i_err)
fprintf(stderr, "At least one test has FAILED !!!\n");
else
fprintf(stdout, "All tests succeeded.\n");
return i_err;
}
......@@ -86,11 +91,11 @@ int main_<xsl:value-of select="@sname" />_<xsl:value-of select="@msuffix" />()
<xsl:template match="integer" mode="check">
/* 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_begin_integer(<xsl:value-of select="@name" />, <xsl:value-of select="@bitcount" />)
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_check_integer(<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>)
BOZO_end_integer(<xsl:value-of select="@name" />, <xsl:value-of select="@bitcount" />)
</xsl:template>
<xsl:template match="boolean" mode="check">
......
This diff is collapsed.
/*****************************************************************************
* test_dr.h
* (c)2001-2002 VideoLAN
* $Id: test_dr.h,v 1.2 2002/05/09 19:59:20 bozo Exp $
* $Id: test_dr.h,v 1.3 2002/05/09 20:39:02 bozo Exp $
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
*
......@@ -52,20 +52,21 @@
#define BOZO_init_integer(name, default) \
s_decoded.name = default;
#define BOZO_begin_integer(name, bitcount, min) \
#define BOZO_begin_integer(name, bitcount) \
if(!i_err) \
{ \
unsigned int i = 0; \
fprintf(stdout, " \"%s\" %u bit(s) integer check\n", \
#name, bitcount); \
i_loop_count = 0; \
s_decoded.name = min; \
s_decoded.name = 1; \
do \
{
#define BOZO_end_integer(name, bitcount, max, step) \
s_decoded.name += step; \
#define BOZO_end_integer(name, bitcount) \
s_decoded.name <<= 1; \
} while(!i_err \
&& (s_decoded.name != max + step)); \
&& (++i < bitcount)); \
fprintf(stdout, "\r iteration count: %22llu", i_loop_count); \
if(i_err) \
fprintf(stdout, " FAILED !!!\n"); \
......@@ -79,43 +80,6 @@
fprintf(stderr, "\nError: integer %s %llu -> %llu\n", #name, \
(uint64_t)s_decoded.name, (uint64_t)p_new_decoded->name); \
i_err = 1; \
} \
if(!i_err && (p_new_decoded->name & ~(((uint64_t)1 << bitcount) - 1))) \
{ \
fprintf(stderr, \
"\nError: integer %s has more than %d bits (%llx)\n", \
#name, bitcount, (uint64_t)p_new_decoded->name); \
i_err = 1; \
}
#define BOZO_check_integer32(name, bitcount) \
if(!i_err && (s_decoded.name != p_new_decoded->name)) \
{ \
fprintf(stderr, "\nError: integer %s %llu -> %llu\n", #name, \
(uint64_t)s_decoded.name, (uint64_t)p_new_decoded->name); \
i_err = 1; \
} \
if(!i_err && (p_new_decoded->name & ~0xffffffff)) \
{ \
fprintf(stderr, \
"\nError: integer %s has more than %d bits (%llx)\n", \
#name, bitcount, (uint64_t)p_new_decoded->name); \
i_err = 1; \
}
#define BOZO_check_integer64(name, bitcount) \
if(!i_err && (s_decoded.name != p_new_decoded->name)) \
{ \
fprintf(stderr, "\nError: integer %s %llu -> %llu\n", #name, \
(uint64_t)s_decoded.name, (uint64_t)p_new_decoded->name); \
i_err = 1; \
} \
if(!i_err && (p_new_decoded->name & ~0xffffffffffffffff)) \
{ \
fprintf(stderr, \
"\nError: integer %s has more than %d bits (%llx)\n", \
#name, bitcount, (uint64_t)p_new_decoded->name); \
i_err = 1; \
}
......
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