1 #include "internal.h"
\r
7 /****************************************************************************/
\r
8 int main( int argc, char **argv )
\r
10 enum lfds601_test_operation
\r
11 operation = UNKNOWN;
\r
17 assert( argc >= 1 );
\r
18 assert( argv != NULL );
\r
20 if( argc == 1 or argc >= 4 )
\r
23 if( operation == UNKNOWN )
\r
25 if( 0 == strcmp(*(argv+1), "test") )
\r
29 // TRD : sscanf() may fail, but iterations is initialised to 1, so it's okay
\r
31 sscanf( *(argv+2), "%u", &iterations );
\r
34 if( 0 == strcmp(*(argv+1), "benchmark") )
\r
35 operation = BENCHMARK;
\r
42 printf( "test [test|benchmark] [iterations]\n"
\r
43 " test : run the test suite\n"
\r
44 " benchmark : run the benchmark suite\n"
\r
45 " iterations : optional, only applies to tests, default is 1\n" );
\r
49 for( loop = 1 ; loop < iterations+1 ; loop++ )
\r
52 "Test Iteration %02u\n"
\r
53 "=================\n", loop );
\r
55 test_lfds601_abstraction();
\r
56 test_lfds601_freelist();
\r
57 test_lfds601_queue();
\r
58 test_lfds601_ringbuffer();
\r
59 test_lfds601_slist();
\r
60 test_lfds601_stack();
\r
65 benchmark_lfds601_freelist();
\r
66 benchmark_lfds601_queue();
\r
67 benchmark_lfds601_ringbuffer();
\r
68 benchmark_lfds601_stack();
\r
72 return( EXIT_SUCCESS );
\r