Changeset 1e9a47f315a78b1a3edfca0aa0872808b822652e

Show
Ignore:
Timestamp:
01/29/06 20:13:35 (2 years ago)
Author:
Clément Stenac <zorglub@videolan.org>
git-committer:
Clément Stenac <zorglub@videolan.org> 1138562015 +0000
git-parent:

[4dfa4e633628c251fbd981f0443760fc2edb5477]

git-author:
Clément Stenac <zorglub@videolan.org> 1138562015 +0000
Message:

Test some things

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • test/NativeLibvlcTest.py

    r0638177 r1e9a47f  
    55 
    66class NativeLibvlcTestCase( unittest.TestCase ): 
    7     def testMe( self ): 
    8     native_libvlc_test.create_destroy() 
     7    def testException( self ): 
     8        """Checks libvlc_exception""" 
     9        native_libvlc_test.exception_test() 
     10    def testStartup( self ): 
     11        """Checks creation/destroy of libvlc""" 
     12        native_libvlc_test.create_destroy() 
  • test/TODO

    r96fe8ff r1e9a47f  
     1* Write wrapper with output redirection / use of logger interface + log checker (look for error in log and fail if any) 
     2  - We can use this to test streams 
    13 
    2 * Write wrapper around MediaControl with output redirection / use of logger interface + log checker (look for error in log and fail if any) 
     4* Invent something  for testing streams 
    35 
    4 *  
     6* Test stats 
  • test/native_libvlc/native_libvlc_test.c

    r0638177 r1e9a47f  
    11#include "../pyunit.h" 
     2#include <vlc/libvlc.h> 
     3 
     4static PyObject *exception_test( PyObject *self, PyObject *args ) 
     5{ 
     6     libvlc_exception_t exception; 
     7 
     8     libvlc_exception_init( &exception ); 
     9     ASSERT( !libvlc_exception_raised( &exception) , "Exception raised" ); 
     10     ASSERT( !libvlc_exception_get_message( &exception) , "Exception raised" ); 
     11 
     12     libvlc_exception_raise( &exception, NULL ); 
     13     ASSERT( !libvlc_exception_get_message( &exception), "Unexpected message" ); 
     14     ASSERT( libvlc_exception_raised( &exception), "Exception not raised" ); 
     15 
     16     libvlc_exception_raise( &exception, "test" ); 
     17     ASSERT( libvlc_exception_get_message( &exception), "No Message" ); 
     18     ASSERT( libvlc_exception_raised( &exception), "Exception not raised" ); 
     19 
     20     Py_INCREF( Py_None ); 
     21     return Py_None; 
     22} 
    223 
    324static PyObject *create_destroy( PyObject *self, PyObject *args ) 
    425{ 
    5      /* Test stuff here */ 
     26     libvlc_instance_t *p_instance; 
     27     char *argv[] = {}; 
     28 
     29     libvlc_exception_t exception; 
     30     libvlc_exception_init( &exception ); 
     31 
     32     p_instance = libvlc_new( 0, argv, &exception ); 
     33 
     34     ASSERT( p_instance != NULL, "Instance creation failed" ); 
     35 
     36     ASSERT( !libvlc_exception_raised( &exception ), 
     37             "Exception raised while creating instance" ); 
     38 
     39     libvlc_destroy( p_instance ); 
    640      
    741     Py_INCREF( Py_None ); 
     
    1145static PyMethodDef native_libvlc_test_methods[] = { 
    1246   DEF_METHOD( create_destroy, "Create and destroy" ) 
     47   DEF_METHOD( exception_test, "Test Exception handling" ) 
    1348   { NULL, NULL, 0, NULL } 
    1449}; 
  • test/test.sh

    r0638177 r1e9a47f  
    11#! /bin/sh 
    22 
    3 # FIXME - Get real .so 
    43cd .. 
    54export PYTHONPATH=$PYTHONPATH:bindings/python/build/lib.linux-i686-2.3:test/build/lib.linux-i686-2.3