Changeset 940734d9cb1999a247cc4c60b96442c20e804413

Show
Ignore:
Timestamp:
03/29/08 00:38:32 (3 months ago)
Author:
Filippo Carone <littlejohn@videolan.org>
git-committer:
Filippo Carone <littlejohn@videolan.org> 1206747512 +0100
git-parent:

[fea85dea108170c42f126e7937821c074384c8b5]

git-author:
Filippo Carone <littlejohn@videolan.org> 1206747474 +0100
Message:

unit tests update

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • bindings/java/core/src/test/java/org/videolan/jvlc/MediaListTest.java

    r27bee6c r940734d  
    4141    public void setup() 
    4242    { 
    43         jvlc = new JVLC(); 
     43        jvlc = new JVLC("-vvv -I dummy --aout=dummy --vout=dummy"); 
    4444    } 
    4545     
  • bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcCoreTest.java

    r9c24ad3 r940734d  
    4141    { 
    4242        libvlc_exception_t exception = new libvlc_exception_t(); 
    43         LibVlcInstance libvlcInstance = instance.libvlc_new(0, new String[] {}, exception); 
     43        LibVlcInstance libvlcInstance = instance.libvlc_new(0, new String[] {"-I","dummy","--aout=dummy","--vout=dummy"}, exception); 
    4444        Assert.assertNotNull(libvlcInstance); 
    4545        Assert.assertEquals(0, exception.raised); 
  • bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcMediaInstanceTest.java

    rbd2b348 r940734d  
    5151    { 
    5252        exception = new libvlc_exception_t(); 
    53         libvlcInstance = libvlc.libvlc_new(0, new String[]{}, exception); 
     53        libvlcInstance = libvlc.libvlc_new(0, new String[]{"-vvv","-I","dummy","-aout=dummy","-vout=dummy"}, exception); 
    5454        libvlc.libvlc_exception_clear(exception); 
    5555    } 
  • bindings/java/core/src/test/java/org/videolan/jvlc/internal/MediaDescriptorTest.java

    r4459ae4 r940734d  
    4949    { 
    5050        libvlc_exception_t exception = new libvlc_exception_t(); 
    51         libvlcInstance = libvlc.libvlc_new(0, new String[]{}, exception); 
     51        libvlcInstance = libvlc.libvlc_new(0, new String[]{"-I","dummy","--aout=dummy","--vout=dummy"}, exception); 
    5252    } 
    5353 
  • bindings/java/core/src/test/java/org/videolan/jvlc/internal/MediaListPlayerTest.java

    r1ffcf6b r940734d  
    2525 
    2626package org.videolan.jvlc.internal; 
    27  
    28 import java.io.File; 
    2927 
    3028import junit.framework.Assert; 
     
    5452    { 
    5553        libvlc_exception_t exception = new libvlc_exception_t(); 
    56         libvlcInstance = libvlc.libvlc_new(0, new String[]{"-A","file","--audiofile-file=" + File.createTempFile("jvlc", ".wav").getAbsolutePath()}, exception); 
     54        libvlcInstance = libvlc.libvlc_new(0, new String[]{"-vvv","-I","dummy","--aout=dummy","--vout=dummy"}, exception); 
    5755        // use the following line to use your audio card. 
    5856        // libvlcInstance = libvlc.libvlc_new(0, new String[]{}, exception); 
     
    182180            Thread.sleep(150); 
    183181        } 
     182        // FIXME give stats the time to run... there's probably a race condition in misc/stats.c:259 that 
     183        // needs to be fixed 
     184        Thread.sleep(400); 
    184185        libvlc.libvlc_media_list_player_stop(mediaListPlayer, exception); 
     186        libvlc.libvlc_media_list_player_release(mediaListPlayer); 
     187    } 
     188 
     189    @Test 
     190    public void mediaListPlayerGetStateStopped() 
     191    { 
     192        libvlc_exception_t exception = new libvlc_exception_t(); 
     193        LibVlcMediaListPlayer mediaListPlayer = libvlc.libvlc_media_list_player_new(libvlcInstance, exception); 
     194        int state = libvlc.libvlc_media_list_player_get_state(mediaListPlayer, exception); 
     195        Assert.assertEquals(LibVlcState.libvlc_Stopped.ordinal(), state); 
    185196    } 
    186197 
     
    195206        libvlc.libvlc_media_list_player_set_media_list(mediaListPlayer, mediaList, exception); 
    196207        libvlc.libvlc_media_list_player_play_item(mediaListPlayer, mediaDescriptor, exception); 
     208        while (true) 
     209        { 
     210            int playing = libvlc.libvlc_media_list_player_is_playing(mediaListPlayer, exception); 
     211            if (exception.raised == 1) 
     212            { 
     213                throw new RuntimeException("Native exception thrown"); 
     214            }             
     215            if (playing == 1) 
     216            { 
     217                break; 
     218            } 
     219            Thread.sleep(150); 
     220        } 
    197221        libvlc.libvlc_media_list_player_pause(mediaListPlayer, exception); 
    198222        Assert.assertEquals(0, exception.raised); 
     
    213237        Assert.assertEquals("Expected state: " + LibVlcState.libvlc_Paused +".\n", LibVlcState.libvlc_Paused.ordinal(), state); 
    214238        libvlc.libvlc_media_list_player_stop(mediaListPlayer, exception); 
    215     } 
    216  
    217     @Test 
    218     public void mediaListPlayerGetStateStopped() 
    219     { 
    220         libvlc_exception_t exception = new libvlc_exception_t(); 
    221         LibVlcMediaListPlayer mediaListPlayer = libvlc.libvlc_media_list_player_new(libvlcInstance, exception); 
    222         int state = libvlc.libvlc_media_list_player_get_state(mediaListPlayer, exception); 
    223         Assert.assertEquals(LibVlcState.libvlc_Stopped.ordinal(), state); 
    224     } 
     239        libvlc.libvlc_media_list_player_release(mediaListPlayer); 
     240    } 
     241 
    225242     
    226243    @Test 
  • bindings/java/core/src/test/java/org/videolan/jvlc/internal/MediaListTest.java

    r5f584e4 r940734d  
    4848    { 
    4949        libvlc_exception_t exception = new libvlc_exception_t(); 
    50         libvlcInstance = libvlc.libvlc_new(0, new String[]{}, exception); 
     50        libvlcInstance = libvlc.libvlc_new(0, new String[]{"-I","dummy","--aout=dummy","--vout=dummy"}, exception); 
    5151    } 
    5252