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
f7c2ff9f
Commit
f7c2ff9f
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
add testcase for service_dr with two names
Signed-off-by:
Jean-Paul Saman
<
jpsaman@videolan.org
>
parent
549a6515
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
78 additions
and
10 deletions
+78
-10
misc/dr.xml
misc/dr.xml
+10
-0
misc/dr.xsl
misc/dr.xsl
+9
-1
misc/test_dr.c
misc/test_dr.c
+57
-7
misc/test_dr.h
misc/test_dr.h
+2
-2
No files found.
misc/dr.xml
View file @
f7c2ff9f
...
...
@@ -156,4 +156,14 @@
<array
name=
"i_service_name"
len_name=
"i_service_name_length"
min_size=
"0"
/>
</descriptor>
<descriptor
name=
"service (both names)"
sname=
"service"
fname=
"Service"
msuffix=
"3"
>
<insert>
<begin>
s_decoded.i_service_provider_name_length = 0;
</begin>
</insert>
<integer
name=
"i_service_type"
bitcount=
"8"
default=
"0"
/>
<array
name=
"i_service_name"
len_name=
"i_service_name_length"
min_size=
"0"
max_size=
"126"
/>
<array
name=
"i_service_provider_name"
len_name=
"i_service_provider_name_length"
min_size=
"0"
max_size=
"126"
/>
</descriptor>
</dr>
misc/dr.xsl
View file @
f7c2ff9f
...
...
@@ -132,7 +132,15 @@ static int main_<xsl:value-of select="@sname" />_<xsl:value-of select="@msuffix"
BOZO_DOJOB(
<xsl:value-of
select=
"../@fname"
/>
);
BOZO_check_array(
<xsl:value-of
select=
"@name"
/>
,
<xsl:value-of
select=
"@len_name"
/>
)
BOZO_CLEAN();
BOZO_end_array(
<xsl:value-of
select=
"@name"
/>
)
<xsl:choose>
<xsl:when
test=
"@max_size"
>
BOZO_end_array(
<xsl:value-of
select=
"@name"
/>
,
<xsl:value-of
select=
"@max_size"
/>
)
</xsl:when>
<xsl:otherwise>
BOZO_end_array(
<xsl:value-of
select=
"@name"
/>
, ARRAY_SIZE(s_decoded.
<xsl:value-of
select=
"@name"
/>
))
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template
match=
"insert"
mode=
"check"
>
...
...
misc/test_dr.c
View file @
f7c2ff9f
...
...
@@ -473,7 +473,8 @@ static int main_ca_(void)
BOZO_DOJOB
(
CA
);
BOZO_check_array
(
i_private_data
,
i_private_length
)
BOZO_CLEAN
();
BOZO_end_array
(
i_private_data
)
BOZO_end_array
(
i_private_data
,
ARRAY_SIZE
(
s_decoded
.
i_private_data
))
BOZO_END
(
conditional
access
);
...
...
@@ -493,7 +494,8 @@ static int main_iso639_(void)
BOZO_DOJOB
(
ISO639
);
BOZO_check_array
(
code
,
i_code_count
)
BOZO_CLEAN
();
BOZO_end_array
(
code
)
BOZO_end_array
(
code
,
ARRAY_SIZE
(
s_decoded
.
code
))
BOZO_END
(
ISO
639
language
);
...
...
@@ -610,7 +612,8 @@ static int main_copyright_(void)
BOZO_DOJOB
(
Copyright
);
BOZO_check_array
(
i_additional_info
,
i_additional_length
)
BOZO_CLEAN
();
BOZO_end_array
(
i_additional_info
)
BOZO_end_array
(
i_additional_info
,
ARRAY_SIZE
(
s_decoded
.
i_additional_info
))
BOZO_END
(
copyright
);
...
...
@@ -824,7 +827,8 @@ static int main_stuffing_(void)
BOZO_DOJOB
(
Stuffing
);
BOZO_check_array
(
i_stuffing_byte
,
i_stuffing_length
)
BOZO_CLEAN
();
BOZO_end_array
(
i_stuffing_byte
)
BOZO_end_array
(
i_stuffing_byte
,
ARRAY_SIZE
(
s_decoded
.
i_stuffing_byte
))
BOZO_END
(
stuffing
);
...
...
@@ -844,7 +848,8 @@ static int main_bouquet_name_(void)
BOZO_DOJOB
(
BouquetName
);
BOZO_check_array
(
i_char
,
i_name_length
)
BOZO_CLEAN
();
BOZO_end_array
(
i_char
)
BOZO_end_array
(
i_char
,
ARRAY_SIZE
(
s_decoded
.
i_char
))
BOZO_END
(
bouquet
name
);
...
...
@@ -875,7 +880,8 @@ static int main_service_1(void)
BOZO_DOJOB
(
Service
);
BOZO_check_array
(
i_service_provider_name
,
i_service_provider_name_length
)
BOZO_CLEAN
();
BOZO_end_array
(
i_service_provider_name
)
BOZO_end_array
(
i_service_provider_name
,
ARRAY_SIZE
(
s_decoded
.
i_service_provider_name
))
BOZO_END
(
service
(
i_service_provider_name
));
...
...
@@ -906,7 +912,8 @@ static int main_service_2(void)
BOZO_DOJOB
(
Service
);
BOZO_check_array
(
i_service_name
,
i_service_name_length
)
BOZO_CLEAN
();
BOZO_end_array
(
i_service_name
)
BOZO_end_array
(
i_service_name
,
ARRAY_SIZE
(
s_decoded
.
i_service_name
))
BOZO_END
(
service
(
i_service_name
));
...
...
@@ -914,6 +921,48 @@ static int main_service_2(void)
return
i_err
;
}
/* service (both names) */
static
int
main_service_3
(
void
)
{
BOZO_VARS
(
service
);
BOZO_START
(
service
(
both
names
));
/* check i_service_type */
s_decoded
.
i_service_provider_name_length
=
0
;
BOZO_init_integer
(
i_service_type
,
0
);
BOZO_begin_integer
(
i_service_type
,
8
)
BOZO_DOJOB
(
Service
);
BOZO_check_integer
(
i_service_type
,
8
)
BOZO_CLEAN
();
BOZO_end_integer
(
i_service_type
,
8
)
/* check i_service_name */
s_decoded
.
i_service_provider_name_length
=
0
;
BOZO_init_integer
(
i_service_type
,
0
);
BOZO_begin_array
(
i_service_name
,
i_service_name_length
,
0
)
BOZO_DOJOB
(
Service
);
BOZO_check_array
(
i_service_name
,
i_service_name_length
)
BOZO_CLEAN
();
BOZO_end_array
(
i_service_name
,
126
)
/* check i_service_provider_name */
s_decoded
.
i_service_provider_name_length
=
0
;
BOZO_init_integer
(
i_service_type
,
0
);
BOZO_begin_array
(
i_service_provider_name
,
i_service_provider_name_length
,
0
)
BOZO_DOJOB
(
Service
);
BOZO_check_array
(
i_service_provider_name
,
i_service_provider_name_length
)
BOZO_CLEAN
();
BOZO_end_array
(
i_service_provider_name
,
126
)
BOZO_END
(
service
(
both
names
));
return
i_err
;
}
/* main function */
int
main
(
void
)
...
...
@@ -945,6 +994,7 @@ int main(void)
i_err
|=
main_bouquet_name_
();
i_err
|=
main_service_1
();
i_err
|=
main_service_2
();
i_err
|=
main_service_3
();
if
(
i_err
)
fprintf
(
stderr
,
"At least one test has FAILED !!!
\n
"
);
...
...
misc/test_dr.h
View file @
f7c2ff9f
...
...
@@ -135,8 +135,8 @@
((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 <
ARRAY_SIZE(s_decoded.name));
\
#define BOZO_end_array(name
, max_len)
\
} while(!i_err && i_loop_count <
max_len);
\
fprintf(stdout, "\r iteration count: %22"PRI64d, i_loop_count); \
if(i_err) \
fprintf(stdout, " FAILED !!!\n"); \
...
...
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