Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libdvbpsi
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
libdvbpsi
Commits
a46495cd
Commit
a46495cd
authored
Jun 28, 2015
by
Daniel Kamil Kozar
Committed by
Jean-Paul Saman
Jan 12, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
write tests for the ISO 639 descriptor
Signed-off-by:
Jean-Paul Saman
<
jpsaman@videolan.org
>
parent
f11c0a31
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
8 deletions
+38
-8
misc/dr.dtd
misc/dr.dtd
+1
-0
misc/dr.xml
misc/dr.xml
+5
-1
misc/dr.xsl
misc/dr.xsl
+1
-1
misc/test_dr.c
misc/test_dr.c
+22
-1
misc/test_dr.h
misc/test_dr.h
+9
-5
No files found.
misc/dr.dtd
View file @
a46495cd
...
...
@@ -28,3 +28,4 @@
<!ATTLIST array name CDATA #IMPLIED>
<!ATTLIST array len_name CDATA #IMPLIED>
<!ATTLIST array min_size CDATA #IMPLIED>
misc/dr.xml
View file @
a46495cd
...
...
@@ -71,7 +71,11 @@
</insert>
<integer
name=
"i_ca_system_id"
bitcount=
"16"
default=
"0"
/>
<integer
name=
"i_ca_pid"
bitcount=
"13"
default=
"0"
/>
<array
name=
"i_private_data"
len_name=
"i_private_length"
/>
<array
name=
"i_private_data"
len_name=
"i_private_length"
min_size=
"0"
/>
</descriptor>
<descriptor
name=
"ISO 639 language"
sname=
"iso639"
fname=
"ISO639"
>
<array
name=
"code"
len_name=
"i_code_count"
min_size=
"1"
/>
</descriptor>
<descriptor
name=
"system clock"
sname=
"system_clock"
fname=
"SystemClock"
>
...
...
misc/dr.xsl
View file @
a46495cd
...
...
@@ -122,7 +122,7 @@ static int main_<xsl:value-of select="@sname" />_<xsl:value-of select="@msuffix"
<xsl:template
match=
"array"
mode=
"check"
>
/* check
<xsl:value-of
select=
"@name"
/>
*/
<xsl:apply-templates
select=
".."
mode=
"init"
/>
BOZO_begin_array(
<xsl:value-of
select=
"@name"
/>
,
<xsl:value-of
select=
"@len_name"
/>
)
BOZO_begin_array(
<xsl:value-of
select=
"@name"
/>
,
<xsl:value-of
select=
"@len_name"
/>
,
<xsl:value-of
select=
"@min_size"
/>
)
BOZO_DOJOB(
<xsl:value-of
select=
"../@fname"
/>
);
BOZO_check_array(
<xsl:value-of
select=
"@name"
/>
,
<xsl:value-of
select=
"@len_name"
/>
)
BOZO_CLEAN();
...
...
misc/test_dr.c
View file @
a46495cd
...
...
@@ -469,7 +469,7 @@ static int main_ca_(void)
s_decoded
.
i_private_length
=
0
;
BOZO_init_integer
(
i_ca_system_id
,
0
);
BOZO_init_integer
(
i_ca_pid
,
0
);
BOZO_begin_array
(
i_private_data
,
i_private_length
)
BOZO_begin_array
(
i_private_data
,
i_private_length
,
0
)
BOZO_DOJOB
(
CA
);
BOZO_check_array
(
i_private_data
,
i_private_length
)
BOZO_CLEAN
();
...
...
@@ -481,6 +481,26 @@ static int main_ca_(void)
return
i_err
;
}
/* ISO 639 language */
static
int
main_iso639_
(
void
)
{
BOZO_VARS
(
iso639
);
BOZO_START
(
ISO
639
language
);
/* check code */
BOZO_begin_array
(
code
,
i_code_count
,
1
)
BOZO_DOJOB
(
ISO639
);
BOZO_check_array
(
code
,
i_code_count
)
BOZO_CLEAN
();
BOZO_end_array
(
code
)
BOZO_END
(
ISO
639
language
);
return
i_err
;
}
/* system clock */
static
int
main_system_clock_
(
void
)
{
...
...
@@ -670,6 +690,7 @@ int main(void)
i_err
|=
main_target_bg_grid_
();
i_err
|=
main_vwindow_
();
i_err
|=
main_ca_
();
i_err
|=
main_iso639_
();
i_err
|=
main_system_clock_
();
i_err
|=
main_mx_buff_utilization_
();
i_err
|=
main_copyright_
();
...
...
misc/test_dr.h
View file @
a46495cd
...
...
@@ -121,19 +121,22 @@
i_err = 1; \
}
#define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
/* array */
#define BOZO_begin_array(name, len_name
)
\
#define BOZO_begin_array(name, len_name
, min_size)
\
if(!i_err) \
{ \
fprintf(stdout, " \"%s\" array check\n", #name); \
i_loop_count =
0;
\
i_loop_count =
min_size;
\
do \
{ \
for(size_t i = 0 ; i < i_loop_count ; ++i) s_decoded.name[i] = rand(); \
for(size_t i = 0 ; i < sizeof(s_decoded.name) ; ++i) \
((uint8_t*)s_decoded.name)[i] = rand(); \
s_decoded.len_name = i_loop_count;
#define BOZO_end_array(name) \
} while(!i_err && i_loop_count <
sizeof(s_decoded.name));
\
} while(!i_err && i_loop_count <
ARRAY_SIZE(s_decoded.name));
\
fprintf(stdout, "\r iteration count: %22"PRI64d, i_loop_count); \
if(i_err) \
fprintf(stdout, " FAILED !!!\n"); \
...
...
@@ -143,7 +146,8 @@
#define BOZO_check_array(name, len_name) \
if( !i_err \
&& (memcmp(s_decoded.name, p_new_decoded->name, s_decoded.len_name) != 0)) \
&& (memcmp(s_decoded.name, p_new_decoded->name, \
s_decoded.len_name * sizeof(s_decoded.name[0])) != 0)) \
{ \
fprintf(stderr, "\nError: array %s not equal\n", #name); \
i_err = 1; \
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment