]> git.sesse.net Git - vlc/blobdiff - test/src/misc/variables.c
LibVLC core: remove exceptions
[vlc] / test / src / misc / variables.c
index f23cb308ade40a824c1c30e81ad5c16ee736d782..e2524618da8642d59428dd4071a3043f321092d6 100644 (file)
@@ -71,6 +71,12 @@ static void test_booleans( libvlc_int_t *p_libvlc )
     for( i = 0; i < i_var_count; i++ )
         assert( var_GetBool( p_libvlc, psz_var_name[i] ) == var_value[i].b_bool );
 
+    for( i = 0; i < i_var_count; i++ )
+        var_ToggleBool( p_libvlc, psz_var_name[i] );
+
+    for( i = 0; i < i_var_count; i++ )
+        assert( var_GetBool( p_libvlc, psz_var_name[i] ) != var_value[i].b_bool );
+
     for( i = 0; i < i_var_count; i++ )
         var_Destroy( p_libvlc, psz_var_name[i] );
 }
@@ -327,7 +333,6 @@ static void test_change( libvlc_int_t *p_libvlc )
 
 static void test_creation_and_type( libvlc_int_t *p_libvlc )
 {
-    int i_type;
     vlc_value_t val;
     val.i_int = 4212;
 
@@ -388,6 +393,10 @@ static void test_creation_and_type( libvlc_int_t *p_libvlc )
     assert( var_Create( p_libvlc, "bla", VLC_VAR_INTEGER | VLC_VAR_HASCHOICE ) == VLC_SUCCESS );
     assert( var_Type( p_libvlc, "bla" ) == (VLC_VAR_INTEGER | VLC_VAR_ISCOMMAND | VLC_VAR_HASMAX | VLC_VAR_HASSTEP | VLC_VAR_HASCHOICE) );
 
+    var_Destroy( p_libvlc, "bla" );
+    var_Destroy( p_libvlc, "bla" );
+    var_Destroy( p_libvlc, "bla" );
+    assert( var_Get( p_libvlc, "bla", &val ) == VLC_ENOVAR );
 }
 
 static void test_variables( libvlc_instance_t *p_vlc )
@@ -437,9 +446,8 @@ int main( void )
     test_init();
 
     log( "Testing the core variables\n" );
-    libvlc_exception_init( &ex );
-    p_vlc = libvlc_new( test_defaults_nargs, test_defaults_args, &ex );
-    catch();
+    p_vlc = libvlc_new( test_defaults_nargs, test_defaults_args );
+    assert( p_vlc != NULL );
 
     test_variables( p_vlc );