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
aefec86e
Commit
aefec86e
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 subtitling descriptor
Signed-off-by:
Jean-Paul Saman
<
jpsaman@videolan.org
>
parent
9ce67f5b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
0 deletions
+44
-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
+15
-0
No files found.
misc/dr.xml
View file @
aefec86e
...
@@ -344,4 +344,8 @@
...
@@ -344,4 +344,8 @@
<array
name=
"p_local_time_offset"
len_name=
"i_local_time_offsets_number"
min_size=
"1"
type=
"dvbpsi_local_time_offset_t"
/>
<array
name=
"p_local_time_offset"
len_name=
"i_local_time_offsets_number"
min_size=
"1"
type=
"dvbpsi_local_time_offset_t"
/>
</descriptor>
</descriptor>
<descriptor
name=
"subtitling"
sname=
"subtitling"
fname=
"Subtitling"
>
<array
name=
"p_subtitle"
len_name=
"i_subtitles_number"
min_size=
"1"
type=
"dvbpsi_subtitle_t"
/>
</descriptor>
</dr>
</dr>
misc/test_dr.c
View file @
aefec86e
...
@@ -2201,6 +2201,30 @@ static int main_local_time_offset_(void)
...
@@ -2201,6 +2201,30 @@ static int main_local_time_offset_(void)
return
i_err
;
return
i_err
;
}
}
/* subtitling */
static
int
main_subtitling_
(
void
)
{
BOZO_VARS
(
subtitling
);
BOZO_START
(
subtitling
);
/* check p_subtitle */
BOZO_init_array
(
i_subtitles_number
);
BOZO_begin_array
(
p_subtitle
)
BOZO_loop_array_begin
(
p_subtitle
,
i_subtitles_number
,
1
)
BOZO_DOJOB
(
Subtitling
);
BOZO_check_array_begin
(
p_subtitle
,
i_subtitles_number
)
BOZO_check_array_cmp
(
p_subtitle
,
i_subtitles_number
,
dvbpsi_subtitle_t
)
BOZO_CLEAN
();
BOZO_loop_array_end
(
p_subtitle
,
ARRAY_SIZE
(
s_decoded
.
p_subtitle
))
BOZO_end_array
BOZO_END
(
subtitling
);
return
i_err
;
}
/* main function */
/* main function */
int
main
(
void
)
int
main
(
void
)
...
@@ -2255,6 +2279,7 @@ int main(void)
...
@@ -2255,6 +2279,7 @@ int main(void)
i_err
|=
main_parental_rating_
();
i_err
|=
main_parental_rating_
();
i_err
|=
main_teletext_
();
i_err
|=
main_teletext_
();
i_err
|=
main_local_time_offset_
();
i_err
|=
main_local_time_offset_
();
i_err
|=
main_subtitling_
();
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 @
aefec86e
...
@@ -95,3 +95,18 @@ static int compare_dvbpsi_local_time_offset_t(const void *s1, const void *s2)
...
@@ -95,3 +95,18 @@ static int compare_dvbpsi_local_time_offset_t(const void *s1, const void *s2)
return
1
;
return
1
;
else
return
0
;
else
return
0
;
}
}
static
int
compare_dvbpsi_subtitle_t
(
const
void
*
s1
,
const
void
*
s2
)
{
const
dvbpsi_subtitle_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
));
if
(
iso_cmp
<
0
||
a
->
i_subtitling_type
<
b
->
i_subtitling_type
||
a
->
i_composition_page_id
<
b
->
i_composition_page_id
||
a
->
i_ancillary_page_id
<
b
->
i_ancillary_page_id
)
return
-
1
;
else
if
(
iso_cmp
>
0
||
a
->
i_subtitling_type
>
b
->
i_subtitling_type
||
a
->
i_composition_page_id
>
b
->
i_composition_page_id
||
a
->
i_ancillary_page_id
>
b
->
i_ancillary_page_id
)
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