break
[vlc/multisubs.git] / test / native / threads.c
blob5220596f690d8ca3e1af8d508ca7dc7867311c78
1 #include "../pyunit.h"
2 #ifdef HAVE_CONFIG_H
3 # include "config.h"
4 #endif
6 #include <vlc/vlc.h>
8 PyObject *threadvar_test( PyObject *self, PyObject *args )
10 void *p_foo = malloc(1);
11 vlc_threadvar_t key, key2;
13 vlc_threadvar_create( NULL, &key );
14 vlc_threadvar_set( &key, p_foo );
15 ASSERT( vlc_threadvar_get( &key ) == p_foo, "key does not match" );
17 vlc_threadvar_create( NULL, &key2 );
18 vlc_threadvar_set( &key2, NULL );
19 ASSERT( vlc_threadvar_get( &key2 ) == NULL, "key2 does not match" );
21 Py_INCREF( Py_None );
22 return Py_None;