X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Ftest%2Fdictionary.c;h=7cc3ed387b4bca8ac7e7d3f2aef05adbe8c7fc5d;hb=d2dd502e0a2709f52be26548a3deda5b08db8bb6;hp=81189943a743f2f69a4b39d07eb1e945af4a30a2;hpb=19bdca43c31388bcbd67afc4e0dced93887d418b;p=vlc diff --git a/src/test/dictionary.c b/src/test/dictionary.c index 81189943a7..7cc3ed387b 100644 --- a/src/test/dictionary.c +++ b/src/test/dictionary.c @@ -1,3 +1,4 @@ + /***************************************************************************** * dictionary.c: Tests for vlc_dictionary_t ***************************************************************************** @@ -23,7 +24,10 @@ # include "config.h" #endif -#include +#undef NDEBUG +#include + +#include #include "vlc_arrays.h" #include @@ -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; + intptr_t 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 j, i = 0; + intptr_t 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;