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
e1001cf7
Commit
e1001cf7
authored
Jul 19, 2015
by
Daniel Kamil Kozar
Committed by
Jean-Paul Saman
Jan 12, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add tests for the parental rating descriptor
Signed-off-by:
Jean-Paul Saman
<
jpsaman@videolan.org
>
parent
8c8b1699
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
0 deletions
+39
-0
misc/dr.xml
misc/dr.xml
+4
-0
misc/test_dr.c
misc/test_dr.c
+25
-0
misc/test_dr_cmp.h
misc/test_dr_cmp.h
+10
-0
No files found.
misc/dr.xml
View file @
e1001cf7
...
...
@@ -332,4 +332,8 @@
<array
name=
"p_content"
len_name=
"i_contents_number"
min_size=
"1"
type=
"dvbpsi_content_t"
/>
</descriptor>
<descriptor
name=
"parental rating"
sname=
"parental_rating"
fname=
"ParentalRating"
>
<array
name=
"p_parental_rating"
len_name=
"i_ratings_number"
min_size=
"1"
type=
"dvbpsi_parental_rating_t"
/>
</descriptor>
</dr>
misc/test_dr.c
View file @
e1001cf7
...
...
@@ -2129,6 +2129,30 @@ static int main_content_(void)
return
i_err
;
}
/* parental rating */
static
int
main_parental_rating_
(
void
)
{
BOZO_VARS
(
parental_rating
);
BOZO_START
(
parental
rating
);
/* check p_parental_rating */
BOZO_init_array
(
i_ratings_number
);
BOZO_begin_array
(
p_parental_rating
)
BOZO_loop_array_begin
(
p_parental_rating
,
i_ratings_number
,
1
)
BOZO_DOJOB
(
ParentalRating
);
BOZO_check_array_begin
(
p_parental_rating
,
i_ratings_number
)
BOZO_check_array_cmp
(
p_parental_rating
,
i_ratings_number
,
dvbpsi_parental_rating_t
)
BOZO_CLEAN
();
BOZO_loop_array_end
(
p_parental_rating
,
ARRAY_SIZE
(
s_decoded
.
p_parental_rating
))
BOZO_end_array
BOZO_END
(
parental
rating
);
return
i_err
;
}
/* main function */
int
main
(
void
)
...
...
@@ -2180,6 +2204,7 @@ int main(void)
i_err
|=
main_stream_identifier_
();
i_err
|=
main_ca_identifier_
();
i_err
|=
main_content_
();
i_err
|=
main_parental_rating_
();
if
(
i_err
)
fprintf
(
stderr
,
"At least one test has FAILED !!!
\n
"
);
...
...
misc/test_dr_cmp.h
View file @
e1001cf7
...
...
@@ -46,3 +46,13 @@ static int compare_dvbpsi_content_t(const void *s1, const void *s2)
else
if
(
a
->
i_type
>
b
->
i_type
||
a
->
i_user_byte
>
b
->
i_user_byte
)
return
1
;
else
return
0
;
}
static
int
compare_dvbpsi_parental_rating_t
(
const
void
*
s1
,
const
void
*
s2
)
{
const
dvbpsi_parental_rating_t
*
a
=
s1
,
*
b
=
s2
;
uint32_t
a_cc
=
(
a
->
i_country_code
&
0xffffff
),
b_cc
=
(
b
->
i_country_code
&
0xffffff
);
if
(
a_cc
<
b_cc
||
a
->
i_rating
<
b
->
i_rating
)
return
-
1
;
else
if
(
a_cc
>
b_cc
||
a
->
i_rating
>
b
->
i_rating
)
return
1
;
else
return
0
;
}
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