Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
vlc
Commits
18e24161
Commit
18e24161
authored
Jul 23, 2009
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: add some more tests for vlc variables.
parent
bbeb36cb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
+34
-0
test/src/misc/variables.c
test/src/misc/variables.c
+34
-0
No files found.
test/src/misc/variables.c
View file @
18e24161
...
...
@@ -290,9 +290,40 @@ static void test_choices( libvlc_int_t *p_libvlc )
!
strcmp
(
val2
.
p_list
->
p_values
[
0
].
psz_string
,
"one"
)
);
var_FreeList
(
&
val
,
&
val2
);
var_Change
(
p_libvlc
,
"bla"
,
VLC_VAR_CLEARCHOICES
,
NULL
,
NULL
);
assert
(
var_CountChoices
(
p_libvlc
,
"bla"
)
==
0
);
var_Destroy
(
p_libvlc
,
"bla"
);
}
static
void
test_change
(
libvlc_int_t
*
p_libvlc
)
{
/* Add min, max and step
Yes we can have min > max but we don't really care */
vlc_value_t
val
;
int
i_min
,
i_max
,
i_step
;
var_Create
(
p_libvlc
,
"bla"
,
VLC_VAR_INTEGER
);
val
.
i_int
=
i_min
=
rand
();
var_Change
(
p_libvlc
,
"bla"
,
VLC_VAR_SETMIN
,
&
val
,
NULL
);
val
.
i_int
=
i_max
=
rand
();
var_Change
(
p_libvlc
,
"bla"
,
VLC_VAR_SETMAX
,
&
val
,
NULL
);
val
.
i_int
=
i_step
=
rand
();
var_Change
(
p_libvlc
,
"bla"
,
VLC_VAR_SETSTEP
,
&
val
,
NULL
);
/* Do something */
var_SetInteger
(
p_libvlc
,
"bla"
,
rand
()
);
val
.
i_int
=
var_GetInteger
(
p_libvlc
,
"bla"
);
/* dummy read */
/* Test everything is right */
var_Change
(
p_libvlc
,
"bla"
,
VLC_VAR_GETMIN
,
&
val
,
NULL
);
assert
(
val
.
i_int
=
i_min
);
var_Change
(
p_libvlc
,
"bla"
,
VLC_VAR_GETMAX
,
&
val
,
NULL
);
assert
(
val
.
i_int
=
i_max
);
var_Change
(
p_libvlc
,
"bla"
,
VLC_VAR_GETSTEP
,
&
val
,
NULL
);
assert
(
val
.
i_int
=
i_step
);
}
static
void
test_variables
(
libvlc_instance_t
*
p_vlc
)
{
libvlc_int_t
*
p_libvlc
=
p_vlc
->
p_libvlc_int
;
...
...
@@ -324,6 +355,9 @@ static void test_variables( libvlc_instance_t *p_vlc )
log
(
"Testing choices
\n
"
);
test_choices
(
p_libvlc
);
log
(
"Testing var_Change()
\n
"
);
test_change
(
p_libvlc
);
}
...
...
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