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
9ce67f5b
Commit
9ce67f5b
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 local time offset descriptor
Signed-off-by:
Jean-Paul Saman
<
jpsaman@videolan.org
>
parent
b03fd26f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
0 deletions
+52
-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
+23
-0
No files found.
misc/dr.xml
View file @
9ce67f5b
...
@@ -340,4 +340,8 @@
...
@@ -340,4 +340,8 @@
<array
name=
"p_pages"
len_name=
"i_pages_number"
min_size=
"1"
type=
"dvbpsi_teletextpage_t"
/>
<array
name=
"p_pages"
len_name=
"i_pages_number"
min_size=
"1"
type=
"dvbpsi_teletextpage_t"
/>
</descriptor>
</descriptor>
<descriptor
name=
"local time offset"
sname=
"local_time_offset"
fname=
"LocalTimeOffset"
>
<array
name=
"p_local_time_offset"
len_name=
"i_local_time_offsets_number"
min_size=
"1"
type=
"dvbpsi_local_time_offset_t"
/>
</descriptor>
</dr>
</dr>
misc/test_dr.c
View file @
9ce67f5b
...
@@ -2177,6 +2177,30 @@ static int main_teletext_(void)
...
@@ -2177,6 +2177,30 @@ static int main_teletext_(void)
return
i_err
;
return
i_err
;
}
}
/* local time offset */
static
int
main_local_time_offset_
(
void
)
{
BOZO_VARS
(
local_time_offset
);
BOZO_START
(
local
time
offset
);
/* check p_local_time_offset */
BOZO_init_array
(
i_local_time_offsets_number
);
BOZO_begin_array
(
p_local_time_offset
)
BOZO_loop_array_begin
(
p_local_time_offset
,
i_local_time_offsets_number
,
1
)
BOZO_DOJOB
(
LocalTimeOffset
);
BOZO_check_array_begin
(
p_local_time_offset
,
i_local_time_offsets_number
)
BOZO_check_array_cmp
(
p_local_time_offset
,
i_local_time_offsets_number
,
dvbpsi_local_time_offset_t
)
BOZO_CLEAN
();
BOZO_loop_array_end
(
p_local_time_offset
,
ARRAY_SIZE
(
s_decoded
.
p_local_time_offset
))
BOZO_end_array
BOZO_END
(
local
time
offset
);
return
i_err
;
}
/* main function */
/* main function */
int
main
(
void
)
int
main
(
void
)
...
@@ -2230,6 +2254,7 @@ int main(void)
...
@@ -2230,6 +2254,7 @@ int main(void)
i_err
|=
main_content_
();
i_err
|=
main_content_
();
i_err
|=
main_parental_rating_
();
i_err
|=
main_parental_rating_
();
i_err
|=
main_teletext_
();
i_err
|=
main_teletext_
();
i_err
|=
main_local_time_offset_
();
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 @
9ce67f5b
...
@@ -72,3 +72,26 @@ static int compare_dvbpsi_teletextpage_t(const void *s1, const void *s2)
...
@@ -72,3 +72,26 @@ static int compare_dvbpsi_teletextpage_t(const void *s1, const void *s2)
a
->
i_teletext_page_number
>
b
->
i_teletext_page_number
)
return
1
;
a
->
i_teletext_page_number
>
b
->
i_teletext_page_number
)
return
1
;
else
return
0
;
else
return
0
;
}
}
static
int
compare_dvbpsi_local_time_offset_t
(
const
void
*
s1
,
const
void
*
s2
)
{
const
dvbpsi_local_time_offset_t
*
a
=
s1
,
*
b
=
s2
;
int
iso_cmp
=
memcmp
(
a
->
i_country_code
,
b
->
i_country_code
,
sizeof
(
a
->
i_country_code
));
uint8_t
a_cr_id
=
(
a
->
i_country_region_id
&
0x3f
),
a_ltop
=
(
a
->
i_local_time_offset_polarity
&
1
),
b_cr_id
=
(
b
->
i_country_region_id
&
0x3f
),
b_ltop
=
(
b
->
i_local_time_offset_polarity
&
1
);
uint64_t
a_toc
=
(
a
->
i_time_of_change
&
0xffffffffff
),
b_toc
=
(
b
->
i_time_of_change
&
0xffffffffff
);
if
(
iso_cmp
<
0
||
a_cr_id
<
b_cr_id
||
a_ltop
<
b_ltop
||
a
->
i_local_time_offset
<
b
->
i_local_time_offset
||
a_toc
<
b_toc
||
a
->
i_next_time_offset
<
b
->
i_next_time_offset
)
return
-
1
;
else
if
(
iso_cmp
>
0
||
a_cr_id
>
b_cr_id
||
a_ltop
>
b_ltop
||
a
->
i_local_time_offset
>
b
->
i_local_time_offset
||
a_toc
>
b_toc
||
a
->
i_next_time_offset
>
b
->
i_next_time_offset
)
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