Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
6b8e5d9b
Commit
6b8e5d9b
authored
Mar 15, 2008
by
Filippo Carone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
more media list unit tests
parent
72d14823
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
13 deletions
+46
-13
bindings/java/core/src/test/java/org/videolan/jvlc/internal/MediaListTest.java
...c/test/java/org/videolan/jvlc/internal/MediaListTest.java
+46
-13
No files found.
bindings/java/core/src/test/java/org/videolan/jvlc/internal/MediaListTest.java
View file @
6b8e5d9b
...
...
@@ -36,25 +36,26 @@ import org.videolan.jvlc.internal.LibVlc.LibVlcMediaList;
import
org.videolan.jvlc.internal.LibVlc.libvlc_exception_t
;
public
class
MediaListTest
{
private
LibVlc
libvlc
=
LibVlc
.
INSTANCE
;
private
LibVlcInstance
libvlcInstance
;
@Before
public
void
testSetup
()
{
libvlc_exception_t
exception
=
new
libvlc_exception_t
();
libvlcInstance
=
libvlc
.
libvlc_new
(
0
,
new
String
[]
{},
exception
);
libvlcInstance
=
libvlc
.
libvlc_new
(
0
,
new
String
[]
{},
exception
);
}
@After
public
void
tearDown
()
{
libvlc
.
libvlc_release
(
libvlcInstance
);
}
@Test
public
void
mediaListNew
()
{
...
...
@@ -63,33 +64,65 @@ public class MediaListTest
Assert
.
assertNotNull
(
mediaList
);
Assert
.
assertEquals
(
0
,
exception
.
raised
);
}
@Test
public
void
mediaListAddMediaDescriptor
()
{
libvlc_exception_t
exception
=
new
libvlc_exception_t
();
LibVlcMediaList
mediaList
=
libvlc
.
libvlc_media_list_new
(
libvlcInstance
,
exception
);
String
mrl
=
this
.
getClass
().
getResource
(
"/raffa_voice.ogg"
).
getPath
();
LibVlcMediaDescriptor
libvlc_media_descriptor
=
libvlc
.
libvlc_media_descriptor_new
(
libvlcInstance
,
mrl
,
exception
);
libvlc
.
libvlc_media_list_add_media_descriptor
(
mediaList
,
libvlc_media_descriptor
,
exception
);
LibVlcMediaDescriptor
libvlc_media_descriptor
=
libvlc
.
libvlc_media_descriptor_new
(
libvlcInstance
,
mrl
,
exception
);
libvlc
.
libvlc_media_list_add_media_descriptor
(
mediaList
,
libvlc_media_descriptor
,
exception
);
Assert
.
assertEquals
(
0
,
exception
.
raised
);
}
@Test
public
void
mediaListCountTest
()
{
libvlc_exception_t
exception
=
new
libvlc_exception_t
();
LibVlcMediaList
mediaList
=
libvlc
.
libvlc_media_list_new
(
libvlcInstance
,
exception
);
String
mrl
=
this
.
getClass
().
getResource
(
"/raffa_voice.ogg"
).
getPath
();
LibVlcMediaDescriptor
libvlc_media_descriptor
=
libvlc
.
libvlc_media_descriptor_new
(
libvlcInstance
,
mrl
,
exception
);
libvlc
.
libvlc_media_list_add_media_descriptor
(
mediaList
,
libvlc_media_descriptor
,
exception
);
LibVlcMediaDescriptor
libvlc_media_descriptor
=
libvlc
.
libvlc_media_descriptor_new
(
libvlcInstance
,
mrl
,
exception
);
libvlc
.
libvlc_media_list_add_media_descriptor
(
mediaList
,
libvlc_media_descriptor
,
exception
);
int
result
=
libvlc
.
libvlc_media_list_count
(
mediaList
,
exception
);
Assert
.
assertEquals
(
1
,
result
);
Assert
.
assertEquals
(
0
,
exception
.
raised
);
libvlc
.
libvlc_media_list_add_media_descriptor
(
mediaList
,
libvlc_media_descriptor
,
exception
);
libvlc
.
libvlc_media_list_add_media_descriptor
(
mediaList
,
libvlc_media_descriptor
,
exception
);
result
=
libvlc
.
libvlc_media_list_count
(
mediaList
,
exception
);
Assert
.
assertEquals
(
2
,
result
);
Assert
.
assertEquals
(
0
,
exception
.
raised
);
}
@Test
public
void
mediaListEventManagerTest
()
{
libvlc_exception_t
exception
=
new
libvlc_exception_t
();
LibVlcMediaList
mediaList
=
libvlc
.
libvlc_media_list_new
(
libvlcInstance
,
exception
);
Assert
.
assertNotNull
(
libvlc
.
libvlc_media_list_event_manager
(
mediaList
,
exception
));
Assert
.
assertEquals
(
0
,
exception
.
raised
);
}
@Test
public
void
mediaListIndexOfItemTest
()
{
libvlc_exception_t
exception
=
new
libvlc_exception_t
();
LibVlcMediaList
mediaList
=
libvlc
.
libvlc_media_list_new
(
libvlcInstance
,
exception
);
String
mrl
=
this
.
getClass
().
getResource
(
"/raffa_voice.ogg"
).
getPath
();
LibVlcMediaDescriptor
libvlc_media_descriptor
=
libvlc
.
libvlc_media_descriptor_new
(
libvlcInstance
,
mrl
,
exception
);
libvlc
.
libvlc_media_list_add_media_descriptor
(
mediaList
,
libvlc_media_descriptor
,
exception
);
int
index
=
libvlc
.
libvlc_media_list_index_of_item
(
mediaList
,
libvlc_media_descriptor
,
exception
);
Assert
.
assertEquals
(
0
,
index
);
Assert
.
assertEquals
(
0
,
exception
.
raised
);
}
}
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