]> git.sesse.net Git - vlc/blobdiff - src/test/dictionary.c
test/dictionary: Be nicer on LP64, and avoid a warning.
[vlc] / src / test / dictionary.c
index 62feb36bd15a8c1ef455bff0ff56b7e16c7670d9..cfe632d66ec8c50c9e007ef7a28bd79880fec762 100644 (file)
@@ -1,3 +1,4 @@
+
 /*****************************************************************************
  * dictionary.c: Tests for vlc_dictionary_t
  *****************************************************************************
 # include "config.h"
 #endif
 
-#include <vlc/vlc.h>
+#undef NDEBUG
+#include <assert.h>
+
+#include <vlc_common.h>
 #include "vlc_arrays.h"
 
 #include <stdio.h>
@@ -33,18 +37,18 @@ static void test_dictionary_validity (vlc_dictionary_t * p_dict, const char ** o
 {
     /* Test values and keys now */
     char ** keys = vlc_dictionary_all_keys( p_dict );
-    int i, j;
+    long i, j;
 
     assert( keys );
 
     for( j = 0; keys[j]; j++ )
     {
-        vlc_bool_t found = VLC_FALSE;
+        bool found = false;
         for( i = 0; i < size; i++ )
         {
             if(!strcmp( keys[j], our_keys[i] ))
             {
-                found = VLC_TRUE;
+                found = true;
                 break;
             }
         }
@@ -54,7 +58,7 @@ static void test_dictionary_validity (vlc_dictionary_t * p_dict, const char ** o
     free( keys );
 
     for( i = 0; i < size; i++ )
-        assert( vlc_dictionary_value_for_key( p_dict, our_keys[i] ) == (void*)i );
+        assert( vlc_dictionary_value_for_key( p_dict, our_keys[i] ) == (void *)i );
 }
 
 int main (void)
@@ -64,7 +68,7 @@ int main (void)
     };
     const int size = sizeof(our_keys)/sizeof(our_keys[0]);
     char ** keys;
-    int i = 0;
+    long i = 0;
 
     vlc_dictionary_t dict;
     vlc_dictionary_init( &dict, 0 );
@@ -78,15 +82,15 @@ int main (void)
 
     /* Insert some values */
     for( i = 0; i < size; i++ )
-        vlc_dictionary_insert( &dict, our_keys[i], (void*)i );
+        vlc_dictionary_insert( &dict, our_keys[i], (void *)i );
 
     test_dictionary_validity( &dict, our_keys, size );
 
-    vlc_dictionary_remove_value_for_key( &dict, our_keys[size-1] );
+    vlc_dictionary_remove_value_for_key( &dict, our_keys[size-1], NULL, NULL );
 
     test_dictionary_validity( &dict, our_keys, size-1 );
-    
-    vlc_dictionary_clear( &dict );
+
+    vlc_dictionary_clear( &dict, NULL, NULL );
 
     assert( vlc_dictionary_keys_count( &dict ) == 0 );
     return 0;