]> git.sesse.net Git - vlc/blobdiff - test/native/gc.c
Merge branch 'master' of git://git.videolan.org/vlc
[vlc] / test / native / gc.c
index eaa5ff28206e55405edd433b0cbc712634d088b9..f52263ad6c1025d3631d965935e5834a7d909601 100644 (file)
@@ -1,7 +1,9 @@
 #include "../pyunit.h"
-#include <vlc/vlc.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
 
-#include <vlc_common.h>
+#include <vlc/vlc.h>
 
 struct mygc
 {
@@ -21,9 +23,8 @@ static PyObject *gc_test( PyObject *self, PyObject *args )
 {
      mygc *gc = (mygc *)malloc( sizeof( mygc ) );
 
-     vlc_gc_init( gc, mygc_destructor );
-     gc->i_gc_refcount = 0;
-
+     vlc_gc_init( gc, mygc_destructor, NULL );
+     ASSERT( gc->i_gc_refcount == 0, "Refcount should be 0" );
      vlc_gc_incref( gc );
      ASSERT( gc->i_gc_refcount == 1, "Refcount should be 1" );
      vlc_gc_incref( gc );
@@ -32,7 +33,7 @@ static PyObject *gc_test( PyObject *self, PyObject *args )
      vlc_gc_decref( gc );
      ASSERT( gc->i_gc_refcount == 1, "Refcount should be 1" );
      vlc_gc_decref( gc );
-     
+
      Py_INCREF( Py_None );
      return Py_None;
 };
@@ -42,4 +43,6 @@ static PyMethodDef native_gc_test_methods[] = {
    { NULL, NULL, 0, NULL }
 };
 
+asserts = 0;
+
 DECLARE_MODULE( native_gc_test )