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
6d4e2137
Commit
6d4e2137
authored
Feb 12, 2006
by
Clément Stenac
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change some test stuff
parent
702ca6c3
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
39 additions
and
20 deletions
+39
-20
test/NativeLibvlcTest.py
test/NativeLibvlcTest.py
+3
-3
test/PyMediaControlBaseTest.py
test/PyMediaControlBaseTest.py
+1
-5
test/PyMediaControlPlaylistTest.py
test/PyMediaControlPlaylistTest.py
+2
-2
test/PyMediaControlVariablesTest.py
test/PyMediaControlVariablesTest.py
+4
-4
test/native/native_libvlc_test.c
test/native/native_libvlc_test.c
+17
-4
test/setup.py
test/setup.py
+11
-1
test/test.sh
test/test.sh
+1
-1
No files found.
test/NativeLibvlcTest.py
View file @
6d4e2137
...
...
@@ -5,11 +5,11 @@ import native_libvlc_test
class
NativeLibvlcTestCase
(
unittest
.
TestCase
):
def
testException
(
self
):
"""Checks libvlc_exception"""
"""
[LibVLC]
Checks libvlc_exception"""
native_libvlc_test
.
exception_test
()
def
testStartup
(
self
):
"""Checks creation/destroy of libvlc"""
"""
[LibVLC]
Checks creation/destroy of libvlc"""
native_libvlc_test
.
create_destroy
()
def
testPlaylist
(
self
):
"""Checks basic playlist interaction"""
"""
[LibVLC]
Checks basic playlist interaction"""
native_libvlc_test
.
playlist_test
()
test/PyMediaControlBaseTest.py
View file @
6d4e2137
...
...
@@ -3,10 +3,6 @@ import unittest
class
BaseTestCase
(
unittest
.
TestCase
):
def
testStartup
(
self
):
"""
Checks
that VLC starts"""
"""
[PyMC] Check
that VLC starts"""
mc
=
vlc
.
MediaControl
(
[
'--quiet'
])
mc
.
exit
()
# def testHelp(self):
# """Check help string"""
# mc=vlc.MediaControl( [ '--help'] )
test/PyMediaControlPlaylistTest.py
View file @
6d4e2137
...
...
@@ -4,7 +4,7 @@ import unittest
# FIXME: How to avoid creating / killing vlc for each test method ?
class
VariablesTestCase
(
unittest
.
TestCase
):
"""Test misc variables interaction"""
"""
[PyMC]
Test misc variables interaction"""
def
setUp
(
self
):
self
.
mc
=
vlc
.
MediaControl
(
[
'--quiet'
]
)
...
...
@@ -12,7 +12,7 @@ class VariablesTestCase( unittest.TestCase ):
self
.
mc
.
exit
()
def
testSimple
(
self
):
"""
Test simple add/remove
"""
"""
[PyMC] Check simple add
"""
assert
len
(
self
.
mc
.
playlist_get_list
()
)
==
0
self
.
mc
.
playlist_add_item
(
"test"
)
assert
len
(
self
.
mc
.
playlist_get_list
()
)
==
1
test/PyMediaControlVariablesTest.py
View file @
6d4e2137
...
...
@@ -4,7 +4,7 @@ import unittest
# FIXME: How to avoid creating / killing vlc for each test method ?
class
VariablesTestCase
(
unittest
.
TestCase
):
"""Test misc variables interaction"""
"""
[PyMC]
Test misc variables interaction"""
def
setUp
(
self
):
self
.
mc
=
vlc
.
MediaControl
(
[
'--quiet'
]
)
# FIXME ! - Get this through children test
...
...
@@ -18,20 +18,20 @@ class VariablesTestCase( unittest.TestCase ):
# The Python binding can't create variables, so just get default ones
def
testInt
(
self
):
"""Get/Set integer variable"""
"""
[PyMC]
Get/Set integer variable"""
assert
self
.
libvlc
.
get
(
"width"
)
==
0
self
.
libvlc
.
set
(
"width"
,
42
)
assert
self
.
libvlc
.
get
(
'width'
)
==
42
# FIXME: Python binding should listen to return value and raise exception
def
testInvalidInt
(
self
):
"""Get/Set invalid integer"""
"""
[PyMC]
Get/Set invalid integer"""
self
.
libvlc
.
set
(
"width"
,
5
)
self
.
libvlc
.
set
(
"width"
,
"foo"
)
assert
self
.
libvlc
.
get
(
"width"
)
==
-
1
def
testString
(
self
):
"""Get/Set string variable"""
"""
[PyMC]
Get/Set string variable"""
assert
self
.
libvlc
.
get
(
"open"
)
==
''
self
.
libvlc
.
set
(
"open"
,
"foo"
)
assert
self
.
libvlc
.
get
(
"open"
)
==
"foo"
...
...
test/native
_libvlc
/native_libvlc_test.c
→
test/native/native_libvlc_test.c
View file @
6d4e2137
...
...
@@ -46,24 +46,37 @@ static PyObject *playlist_test( PyObject *self, PyObject *args )
{
libvlc_instance_t
*
p_instance
;
char
*
argv
[]
=
{
"vlc"
,
"--quiet"
};
int
i_id
;
int
i_id
,
i_playing
,
i_items
;
libvlc_exception_t
exception
;
libvlc_exception_init
(
&
exception
);
p_instance
=
libvlc_new
(
2
,
argv
,
&
exception
);
/* Initial status */
libvlc_playlist_play
(
p_instance
,
0
,
0
,
argv
,
&
exception
);
ASSERT
(
libvlc_exception_raised
(
&
exception
),
"Playlist empty and exception not raised"
);
i_playing
=
libvlc_playlist_isplaying
(
p_instance
,
&
exception
);
ASSERT_EXCEPTION
;
ASSERT
(
i_playing
==
0
,
"Playlist shouldn't be running"
);
i_items
=
libvlc_playlist_items_count
(
p_instance
,
&
exception
);
ASSERT_EXCEPTION
;
ASSERT
(
i_items
==
0
,
"Playlist should be empty"
);
/* Add 1 item */
libvlc_exception_clear
(
&
exception
);
i_id
=
libvlc_playlist_add
(
p_instance
,
"test"
,
NULL
,
&
exception
);
ASSERT_EXCEPTION
;
ASSERT
(
i_id
>
0
,
"Returned identifier is <= 0"
);
i_items
=
libvlc_playlist_items_count
(
p_instance
,
&
exception
);
ASSERT_EXCEPTION
;
ASSERT
(
i_items
==
1
,
"Playlist should have 1 item"
);
i_playing
=
libvlc_playlist_isplaying
(
p_instance
,
&
exception
);
ASSERT_EXCEPTION
;
ASSERT
(
i_playing
==
0
,
"Playlist shouldn't be running"
);
/* */
Py_INCREF
(
Py_None
);
return
Py_None
;
...
...
test/setup.py
View file @
6d4e2137
...
...
@@ -39,11 +39,21 @@ def get_ldflags():
# To compile in a local vlc tree
native_libvlc_test
=
Extension
(
'native_libvlc_test'
,
sources
=
[
'native
_libvlc/native_libvlc_test
.c'
],
sources
=
[
'native
/libvlc
.c'
],
include_dirs
=
[
'../include'
,
'../'
,
'/usr/win32/include'
],
extra_objects
=
[
'../lib/libvlc_pic.a'
],
extra_compile_args
=
get_cflags
(),
extra_link_args
=
[
'-L../..'
]
+
get_ldflags
(),
)
native_stats_test
=
Extension
(
'native_stats_test'
,
sources
=
[
'native/stats.c'
],
include_dirs
=
[
'../include'
,
'../'
,
'/usr/win32/include'
],
extra_objects
=
[
'../lib/libvlc_pic.a'
],
extra_compile_args
=
get_cflags
(),
extra_link_args
=
[
'-L../..'
]
+
get_ldflags
(),
)
setup
(
name
=
'native_libvlc_test'
,
version
=
'1242'
,
ext_modules
=
[
native_libvlc_test
]
)
setup
(
name
=
'native_stats_test'
,
version
=
'1242'
,
ext_modules
=
[
native_stats_test
]
)
test/test.sh
View file @
6d4e2137
#! /bin/sh
cd
..
export
PYTHONPATH
=
$PYTHONPATH
:bindings/python/build/lib.linux-i686-2.3:test/build/lib.linux-i686-2.3
export
PYTHONPATH
=
$PYTHONPATH
:bindings/
mediacontrol-
python/build/lib.linux-i686-2.3:test/build/lib.linux-i686-2.3
python
test
/test.py
-v
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