+
/*****************************************************************************
* 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>
{
/* 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;
}
}
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)
};
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 );
/* 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;