diff options
author | axel <axel@liljencrantz.se> | 2006-10-22 08:59:00 +1000 |
---|---|---|
committer | axel <axel@liljencrantz.se> | 2006-10-22 08:59:00 +1000 |
commit | da81328d7548e13a0f0bd4babf9f1bc5f80a9ffc (patch) | |
tree | 73e9432dea298d7adb436684e06a772d026c4c69 /fish_tests.c | |
parent | 5ae4306418ff7e553b4a2b07f80a7db6e7655037 (diff) |
Fix warning messages in fish_tests
darcs-hash:20061021225900-ac50b-992edf0914250ae090ef952717ef3a05cb9cfa6e.gz
Diffstat (limited to 'fish_tests.c')
-rw-r--r-- | fish_tests.c | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/fish_tests.c b/fish_tests.c index e0a23d6f..31ea2b04 100644 --- a/fish_tests.c +++ b/fish_tests.c @@ -89,14 +89,6 @@ static void err( wchar_t *blah, ... ) } /** - Print ok message -*/ -static void ok() -{ - wprintf( L"OK\n" ); -} - -/** Compare two pointers */ static int pq_compare( void *e1, void *e2 ) @@ -120,7 +112,7 @@ static void pq_test( int elements ) for( i=0; i<elements; i++ ) { - int foo = rand() % 100; + long foo = rand() % 100; // printf( "Adding %d\n", foo ); pq_put( &q, (void *)foo ); count[foo]++; @@ -130,7 +122,7 @@ static void pq_test( int elements ) for( i=0; i<elements; i++ ) { - int pos = (int)pq_get( &q ); + long pos = (long)pq_get( &q ); count[ pos ]--; if( pos > prev ) err( L"Wrong order of elements in priority_queue_t" ); @@ -201,7 +193,7 @@ static int hash_func( void *data ) /* srand( (int)data ); return rand(); */ - int foo = (int)data; + int foo = (int)(long)data; return 127*((foo^0xefc7e214)) ^(foo<<11); } @@ -217,9 +209,9 @@ static int compare_func( void *key1, void *key2 ) /** Hashtable test */ -static int hash_test( int elements ) +static int hash_test( long elements ) { - int i; + long i; int res=1; hash_table_t h; @@ -228,17 +220,17 @@ static int hash_test( int elements ) for( i=1; i< elements+1; i++ ) { - hash_put( &h, (void*)i, (void*)100-i ); + hash_put( &h, (void*)i, (void*)100l-i ); } for( i=1; i< elements+1; i++ ) { - if( (int)hash_get( &h, (void*)i ) != (100-i) ) + if( (long)hash_get( &h, (void*)i ) != (100l-i) ) { err( L"Key %d gave data %d, expected data %d", i, - (int)hash_get( &h, (void*)i ), - 100-i ); + (long)hash_get( &h, (void*)i ), + 100l-i ); res = 0; break; @@ -271,7 +263,7 @@ static int hash_test( int elements ) for( i=1; i<elements+1; i++ ) { - if( hash_contains( &h, (void*)i) != (i+1)%2 ) + if( hash_contains( &h, (void*)i) != (i+1l)%2l ) { if( i%2 ) err( L"Key %d remains, should be deleted", @@ -553,7 +545,11 @@ static int expand_test( const wchar_t *in, int flags, ... ) wchar_t *arg; al_init( &out ); - expand_string( 0, wcsdup(in), &out, flags); + if( expand_string( 0, wcsdup(in), &out, flags) ) + { + + } + va_start( va, flags ); |