Changeset f834305242997bff8e941b4362f147ba2594f4fb

Show
Ignore:
Timestamp:
08/30/06 19:17:11 (2 years ago)
Author:
Clément Stenac <zorglub@videolan.org>
git-committer:
Clément Stenac <zorglub@videolan.org> 1156958231 +0000
git-parent:

[f7f09d38fab255e32b511abe723745c8c781cd06]

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

Port new URL tests to test/
Support Python 2.4

Files:

Legend:

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

    r4db506d rf834305  
    55class NativeURLTestCase( unittest.TestCase ): 
    66    def testurl_decode( self ): 
    7         """[URL] Test url_decode""" 
    8         native_libvlc_test.url_decode_test() 
     7        """[URL] Test url_decode and base64""" 
     8        native_libvlc_test.url_test() 
  • test/native/init.c

    r0fbf13c rf834305  
    1717   DEF_METHOD( timers_test, "Test timers" ) 
    1818   DEF_METHOD( i18n_atof_test, "Test i18n_atof" ) 
    19    DEF_METHOD( url_decode_test, "URL decoding" ) 
     19   DEF_METHOD( url_test, "URL decoding" ) 
    2020   DEF_METHOD( chains_test, "Test building of chains" ) 
    2121   DEF_METHOD( gui_chains_test, "Test interactions between chains and GUI" ) 
  • test/native/tests.h

    r0fbf13c rf834305  
    1010PyObject *timers_test( PyObject *self, PyObject *args ); 
    1111 
    12 PyObject *url_decode_test( PyObject *self, PyObject *args ); 
     12PyObject *url_test( PyObject *self, PyObject *args ); 
    1313 
    1414PyObject *i18n_atof_test( PyObject *self, PyObject *args ); 
  • test/native/url.c

    r0fbf13c rf834305  
    2424#include "vlc_url.h" 
    2525 
    26 PyObject * test_decode (const char *in, const char *out) 
     26typedef char * (*conv_t ) (const char *); 
     27 
     28PyObject * test (conv_t f, const char *in, const char *out) 
    2729{ 
    2830    char *res; 
    2931 
    3032    printf ("\"%s\" -> \"%s\" ?\n", in, out); 
    31     res = decode_URI_duplicate (in); 
    32     ASSERT( res != NULL, "" ); 
    33     if (res == NULL) 
    34         exit (1); 
    35  
     33    res = f(in); 
     34    ASSERT( res != NULL, "NULL result" ); 
    3635    ASSERT( strcmp( res, out ) == NULL, "" ); 
    3736 
     
    4039} 
    4140 
    42 PyObject *url_decode_test( PyObject *self, PyObject *args ) 
     41static inline PyObject * test_decode( const char *in, const char *out) 
     42
     43    return test( decode_URI_duplicate, in, out ); 
     44
     45 
     46static inline PyObject* test_b64( const char *in, const char *out ) 
     47
     48    return test( vlc_b64_encode, in, out ); 
     49
     50 
     51PyObject *url_test( PyObject *self, PyObject *args ) 
    4352{ 
    4453    printf( "\n" ); 
     
    6675                         "??élévision") ) return NULL; /* overlong */ 
    6776 
     77    /* Base 64 tests */ 
     78    test_b64 ("", ""); 
     79    test_b64 ("d", "ZA=="); 
     80    test_b64 ("ab", "YQG="); 
     81    test_b64 ("abc", "YQGI"); 
     82    test_b64 ("abcd", "YQGIZA=="); 
     83 
    6884    Py_INCREF( Py_None); 
    6985    return Py_None; 
  • test/test.sh

    r0fbf13c rf834305  
    22 
    33set -e 
    4 python setup.py build  
     4python setup.py build 
    55 
    66cd .. 
    77# TODO: FIXME !! 
    8 export PYTHONPATH=$PYTHONPATH:bindings/mediacontrol-python/build/lib.linux-i686-2.3:test/build/lib.linux-i686-2.3:test/build/lib.linux-x86_64-2.3 
     8export PYTHONPATH=$PYTHONPATH:bindings/mediacontrol-python/build/lib.linux-i686-2.3:test/build/lib.linux-i686-2.3:test/build/lib.linux-x86_64-2.3:test/build/lib.linux-i686-2.4:test/build/lib.linux-x86_64-2.4 
    99 
    1010export LD_LIBRARY_PATH=src/.libs/