7 /****************************************************************************/
8 int main( int argc, char **argv )
10 enum lfds600_test_operation
18 assert( argv != NULL );
20 if( argc == 1 or argc >= 4 )
23 if( operation == UNKNOWN )
25 if( 0 == strcmp(*(argv+1), "test") )
29 // TRD : sscanf() may fail, but iterations is initialised to 1, so it's okay
31 sscanf( *(argv+2), "%u", &iterations );
34 if( 0 == strcmp(*(argv+1), "benchmark") )
35 operation = BENCHMARK;
42 printf( "test [test|benchmark] [iterations]\n"
43 " test : run the test suite\n"
44 " benchmark : run the benchmark suite\n"
45 " iterations : optional, only applies to tests, default is 1\n" );
49 for( loop = 1 ; loop < iterations+1 ; loop++ )
52 "Test Iteration %02u\n"
53 "=================\n", loop );
55 test_lfds600_abstraction();
56 test_lfds600_freelist();
58 test_lfds600_ringbuffer();
65 benchmark_lfds600_freelist();
66 benchmark_lfds600_queue();
67 benchmark_lfds600_ringbuffer();
68 benchmark_lfds600_stack();
72 return( EXIT_SUCCESS );