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
b03fd26f
Commit
b03fd26f
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 teletext descriptor
Signed-off-by:
Jean-Paul Saman
<
jpsaman@videolan.org
>
parent
e1001cf7
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
0 deletions
+45
-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
+16
-0
No files found.
misc/dr.xml
View file @
b03fd26f
...
@@ -336,4 +336,8 @@
...
@@ -336,4 +336,8 @@
<array
name=
"p_parental_rating"
len_name=
"i_ratings_number"
min_size=
"1"
type=
"dvbpsi_parental_rating_t"
/>
<array
name=
"p_parental_rating"
len_name=
"i_ratings_number"
min_size=
"1"
type=
"dvbpsi_parental_rating_t"
/>
</descriptor>
</descriptor>
<descriptor
name=
"teletext"
sname=
"teletext"
fname=
"Teletext"
>
<array
name=
"p_pages"
len_name=
"i_pages_number"
min_size=
"1"
type=
"dvbpsi_teletextpage_t"
/>
</descriptor>
</dr>
</dr>
misc/test_dr.c
View file @
b03fd26f
...
@@ -2153,6 +2153,30 @@ static int main_parental_rating_(void)
...
@@ -2153,6 +2153,30 @@ static int main_parental_rating_(void)
return
i_err
;
return
i_err
;
}
}
/* teletext */
static
int
main_teletext_
(
void
)
{
BOZO_VARS
(
teletext
);
BOZO_START
(
teletext
);
/* check p_pages */
BOZO_init_array
(
i_pages_number
);
BOZO_begin_array
(
p_pages
)
BOZO_loop_array_begin
(
p_pages
,
i_pages_number
,
1
)
BOZO_DOJOB
(
Teletext
);
BOZO_check_array_begin
(
p_pages
,
i_pages_number
)
BOZO_check_array_cmp
(
p_pages
,
i_pages_number
,
dvbpsi_teletextpage_t
)
BOZO_CLEAN
();
BOZO_loop_array_end
(
p_pages
,
ARRAY_SIZE
(
s_decoded
.
p_pages
))
BOZO_end_array
BOZO_END
(
teletext
);
return
i_err
;
}
/* main function */
/* main function */
int
main
(
void
)
int
main
(
void
)
...
@@ -2205,6 +2229,7 @@ int main(void)
...
@@ -2205,6 +2229,7 @@ int main(void)
i_err
|=
main_ca_identifier_
();
i_err
|=
main_ca_identifier_
();
i_err
|=
main_content_
();
i_err
|=
main_content_
();
i_err
|=
main_parental_rating_
();
i_err
|=
main_parental_rating_
();
i_err
|=
main_teletext_
();
if
(
i_err
)
if
(
i_err
)
fprintf
(
stderr
,
"At least one test has FAILED !!!
\n
"
);
fprintf
(
stderr
,
"At least one test has FAILED !!!
\n
"
);
...
...
misc/test_dr_cmp.h
View file @
b03fd26f
...
@@ -56,3 +56,19 @@ static int compare_dvbpsi_parental_rating_t(const void *s1, const void *s2)
...
@@ -56,3 +56,19 @@ static int compare_dvbpsi_parental_rating_t(const void *s1, const void *s2)
else
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
;
else
return
0
;
}
}
static
int
compare_dvbpsi_teletextpage_t
(
const
void
*
s1
,
const
void
*
s2
)
{
const
dvbpsi_teletextpage_t
*
a
=
s1
,
*
b
=
s2
;
int
iso_cmp
=
memcmp
(
a
->
i_iso6392_language_code
,
b
->
i_iso6392_language_code
,
sizeof
(
a
->
i_iso6392_language_code
));
uint8_t
a_tt
=
(
a
->
i_teletext_type
&
0x1f
),
a_tmn
=
(
a
->
i_teletext_magazine_number
&
0x07
),
b_tt
=
(
b
->
i_teletext_type
&
0x1f
),
b_tmn
=
(
b
->
i_teletext_magazine_number
&
0x07
);
if
(
iso_cmp
<
0
||
a_tt
<
b_tt
||
a_tmn
<
b_tmn
||
a
->
i_teletext_page_number
<
b
->
i_teletext_page_number
)
return
-
1
;
else
if
(
iso_cmp
>
0
||
a_tt
>
b_tt
||
a_tmn
>
b_tmn
||
a
->
i_teletext_page_number
>
b
->
i_teletext_page_number
)
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