Show
Ignore:
Timestamp:
11/04/08 19:11:52 (8 months ago)
Author:
Pierre d'Herbemont <pdherbemont@videolan.org>
git-committer:
Pierre d'Herbemont <pdherbemont@videolan.org> 1207933912 +0200
git-parent:

[35dc9b31f0bbf161974366ae1c8a41c4705faaec]

git-author:
Pierre d'Herbemont <pdherbemont@videolan.org> 1207933912 +0200
Message:

test: Get rid of the sleep() that crept in our test code.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • test/libvlc/media_player.c

    r01a95e7 r6d6185f  
    4848    catch (); 
    4949 
    50     /* FIXME: Do something clever */ 
    51     sleep(1); 
     50    /* Wait a correct state */ 
     51    libvlc_state_t state; 
     52    do { 
     53        state = libvlc_media_player_get_state (mi, &ex); 
     54        catch (); 
     55    } while( state != libvlc_Playing && 
     56             state != libvlc_Error && 
     57             state != libvlc_MediaPlayerEndReached ); 
    5258 
    53     assert( libvlc_media_player_get_state (mi, &ex) != libvlc_Error ); 
    54     catch (); 
     59    assert( state == libvlc_Playing || state == libvlc_MediaPlayerEndReached ); 
    5560 
    5661    libvlc_media_player_stop (mi, &ex); 
     
    8893    catch (); 
    8994 
    90     /* FIXME: Do something clever */ 
    91     sleep(1); 
     95    /* Wait a correct state */ 
     96    libvlc_state_t state; 
     97    do { 
     98        state = libvlc_media_player_get_state (mi, &ex); 
     99        catch (); 
     100    } while( state != libvlc_Playing && 
     101             state != libvlc_Error && 
     102             state != libvlc_MediaPlayerEndReached ); 
    92103 
    93     assert( libvlc_media_player_get_state (mi, &ex) == libvlc_Playing ); 
    94     catch (); 
     104    assert( state == libvlc_Playing || state == libvlc_MediaPlayerEndReached ); 
    95105 
    96106    libvlc_media_player_pause (mi, &ex);