Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
1c5df1f3
Commit
1c5df1f3
authored
Apr 01, 2008
by
Filippo Carone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new (failing) test for libvlc
parent
0bf91678
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
103 additions
and
0 deletions
+103
-0
src/control/testapi.c
src/control/testapi.c
+103
-0
No files found.
src/control/testapi.c
View file @
1c5df1f3
...
...
@@ -67,6 +67,8 @@ static void test_core (const char ** argv, int argc);
static
void
test_media_list
(
const
char
**
argv
,
int
argc
);
static
void
test_events
(
const
char
**
argv
,
int
argc
);
static
void
test_media_player_play_stop
(
const
char
**
argv
,
int
argc
);
static
void
test_media_player_pause_stop
(
const
char
**
argv
,
int
argc
);
static
void
test_media_list_player_pause_stop
(
const
char
**
argv
,
int
argc
);
/* Tests implementations */
static
void
test_core
(
const
char
**
argv
,
int
argc
)
...
...
@@ -356,6 +358,103 @@ static void test_media_player_play_stop(const char** argv, int argc)
#endif
}
static
void
test_media_player_pause_stop
(
const
char
**
argv
,
int
argc
)
{
libvlc_instance_t
*
vlc
;
libvlc_media_t
*
md
;
libvlc_media_player_t
*
mi
;
const
char
*
file
=
"file://../bindings/java/core/src/test/resources/raffa_voice.ogg"
;
log
(
"Testing play and pause of %s
\n
"
,
file
);
libvlc_exception_init
(
&
ex
);
vlc
=
libvlc_new
(
argc
,
argv
,
&
ex
);
catch
();
md
=
libvlc_media_new
(
vlc
,
file
,
&
ex
);
catch
();
mi
=
libvlc_media_player_new_from_media
(
md
,
&
ex
);
catch
();
libvlc_media_release
(
md
);
libvlc_media_player_play
(
mi
,
&
ex
);
catch
();
/* FIXME: Do something clever */
sleep
(
1
);
assert
(
libvlc_media_player_get_state
(
mi
,
&
ex
)
==
libvlc_Playing
);
catch
();
libvlc_media_player_pause
(
mi
,
&
ex
);
assert
(
libvlc_media_player_get_state
(
mi
,
&
ex
)
==
libvlc_Paused
);
catch
();
libvlc_media_player_stop
(
mi
,
&
ex
);
catch
();
libvlc_media_player_release
(
mi
);
catch
();
libvlc_release
(
vlc
);
catch
();
}
static
void
test_media_list_player_pause_stop
(
const
char
**
argv
,
int
argc
)
{
libvlc_instance_t
*
vlc
;
libvlc_media_t
*
md
;
libvlc_media_player_t
*
mi
;
libvlc_media_list_t
*
ml
;
libvlc_media_list_player_t
*
mlp
;
const
char
*
file
=
"file://../bindings/java/core/src/test/resources/raffa_voice.ogg"
;
log
(
"Testing play and pause of %s using the media list.
\n
"
,
file
);
libvlc_exception_init
(
&
ex
);
vlc
=
libvlc_new
(
argc
,
argv
,
&
ex
);
catch
();
md
=
libvlc_media_new
(
vlc
,
file
,
&
ex
);
catch
();
ml
=
libvlc_media_list_new
(
vlc
,
&
ex
);
catch
();
mlp
=
libvlc_media_list_player_new
(
vlc
,
&
ex
);
libvlc_media_list_add_media
(
ml
,
md
,
&
ex
);
catch
();
libvlc_media_list_player_set_media_list
(
mlp
,
ml
,
&
ex
);
libvlc_media_list_player_play_item
(
mlp
,
md
,
&
ex
);
/* FIXME: Do something clever */
sleep
(
1
);
assert
(
libvlc_media_player_get_state
(
mi
,
&
ex
)
==
libvlc_Playing
);
catch
();
libvlc_media_player_pause
(
mi
,
&
ex
);
assert
(
libvlc_media_player_get_state
(
mi
,
&
ex
)
==
libvlc_Paused
);
catch
();
libvlc_media_player_stop
(
mi
,
&
ex
);
catch
();
libvlc_media_player_release
(
mi
);
catch
();
libvlc_release
(
vlc
);
catch
();
}
int
main
(
int
argc
,
char
*
argv
[])
{
const
char
*
args
[
argc
+
5
];
...
...
@@ -380,5 +479,9 @@ int main (int argc, char *argv[])
test_media_player_play_stop
(
args
,
nlibvlc_args
);
test_media_player_pause_stop
(
args
,
nlibvlc_args
);
test_media_list_player_pause_stop
(
args
,
nlibvlc_args
);
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