diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2011-12-31 15:57:30 -0800 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2011-12-31 15:57:30 -0800 |
commit | bef046a51a26b87cb5eb8a6e159b78c931a2e253 (patch) | |
tree | 50e30ebe47c41414b0f394bb966bdfd5443cf237 /fish_tests.cpp | |
parent | 78322a63218e8c66a4788dc79e252db4050bca23 (diff) |
More work to migrate off of ad-hoc data structures
Diffstat (limited to 'fish_tests.cpp')
-rw-r--r-- | fish_tests.cpp | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/fish_tests.cpp b/fish_tests.cpp index d5ed103c..69d0e623 100644 --- a/fish_tests.cpp +++ b/fish_tests.cpp @@ -112,48 +112,6 @@ static int pq_compare( void *e1, void *e2 ) return (intptr_t)e1-(intptr_t)e2; } -/** - Test priority queue functionality -*/ -static void pq_test( int elements ) -{ - int i; - int prev; - - int *count = (int *)calloc( sizeof(int), 100 ); - - priority_queue_t q; - pq_init( &q, pq_compare ); - - - for( i=0; i<elements; i++ ) - { - long foo = rand() % 100; -// printf( "Adding %d\n", foo ); - pq_put( &q, (void *)foo ); - count[foo]++; - } - - prev = 100; - - for( i=0; i<elements; i++ ) - { - long pos = (long)pq_get( &q ); - count[ pos ]--; - if( pos > prev ) - err( L"Wrong order of elements in priority_queue_t" ); - prev = pos; - - } - - for( i=0; i<100; i++ ) - { - if( count[i] != 0 ) - { - err( L"Wrong number of elements in priority_queue_t" ); - } - } -} /** Test stack functionality @@ -379,7 +337,6 @@ static void test_util() for( i=0; i<18; i++ ) { long t1, t2; - pq_test( 1<<i ); stack_test( 1<<i ); t1 = get_time(); hash_test( 1<<i ); |