Changeset 1e9a47f315a78b1a3edfca0aa0872808b822652e
- 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
| r0638177 |
r1e9a47f |
|
| 5 | 5 | |
|---|
| 6 | 6 | class 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() |
|---|
| 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 |
|---|
| 1 | 3 | |
|---|
| 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 |
|---|
| 3 | 5 | |
|---|
| 4 | | * |
|---|
| | 6 | * Test stats |
|---|
| r0638177 |
r1e9a47f |
|
| 1 | 1 | #include "../pyunit.h" |
|---|
| | 2 | #include <vlc/libvlc.h> |
|---|
| | 3 | |
|---|
| | 4 | static 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 | } |
|---|
| 2 | 23 | |
|---|
| 3 | 24 | static PyObject *create_destroy( PyObject *self, PyObject *args ) |
|---|
| 4 | 25 | { |
|---|
| 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 ); |
|---|
| 6 | 40 | |
|---|
| 7 | 41 | Py_INCREF( Py_None ); |
|---|
| … | … | |
| 11 | 45 | static PyMethodDef native_libvlc_test_methods[] = { |
|---|
| 12 | 46 | DEF_METHOD( create_destroy, "Create and destroy" ) |
|---|
| | 47 | DEF_METHOD( exception_test, "Test Exception handling" ) |
|---|
| 13 | 48 | { NULL, NULL, 0, NULL } |
|---|
| 14 | 49 | }; |
|---|
| r0638177 |
r1e9a47f |
|
| 1 | 1 | #! /bin/sh |
|---|
| 2 | 2 | |
|---|
| 3 | | # FIXME - Get real .so |
|---|
| 4 | 3 | cd .. |
|---|
| 5 | 4 | export PYTHONPATH=$PYTHONPATH:bindings/python/build/lib.linux-i686-2.3:test/build/lib.linux-i686-2.3 |
|---|