@@ -17,18 +17,18 @@ char *prog_title = "FUNKEY S TESTS";
1717
1818/* Static Variables */
1919static s_prod_test prod_tests [] = {
20- {"FAIL" , launch_prod_screen_fail , 0 },
21- {"WAIT_BATTERY" , launch_prod_screen_waitbattery , 0 },
22- {"DISPLAY" , launch_prod_screen_display , 0 },
23- {"BRIGHTNESS" , launch_prod_screen_brightness , 0 },
24- {"BUTTONS" , launch_prod_screen_buttons , 0 },
25- {"SPEAKER" , launch_prod_screen_speaker , 0 },
26- {"LED" , launch_prod_screen_LED , 0 },
27- {"MAGNET" , launch_prod_screen_magnet , 0 },
28- {"VALIDATE" , launch_prod_screen_validation , 0 },
29- {"SHOW_IMAGE" , launch_prod_screen_showImage , 1 },
30- {"GAMMA" , launch_prod_screen_gamma , 0 },
31- {"TEARING" , launch_prod_screen_tearingtest , 0 }
20+ {"FAIL" , launch_prod_screen_fail , 0 , NULL },
21+ {"WAIT_BATTERY" , launch_prod_screen_waitbattery , 0 , NULL },
22+ {"DISPLAY" , launch_prod_screen_display , 0 , NULL },
23+ {"BRIGHTNESS" , launch_prod_screen_brightness , 0 , NULL },
24+ {"BUTTONS" , launch_prod_screen_buttons , 0 , NULL },
25+ {"SPEAKER" , launch_prod_screen_speaker , 0 , NULL },
26+ {"LED" , launch_prod_screen_LED , 0 , NULL },
27+ {"MAGNET" , launch_prod_screen_magnet , 0 , NULL },
28+ {"VALIDATE" , launch_prod_screen_validation , 0 , NULL },
29+ {"SHOW_IMAGE" , launch_prod_screen_showImage , 1 , "img_path" },
30+ {"GAMMA" , launch_prod_screen_gamma , 0 , NULL },
31+ {"TEARING" , launch_prod_screen_tearingtest , 0 , "(FPS)" }
3232};
3333static int idx_current_prod_test = 0 ;
3434
@@ -65,10 +65,11 @@ void init_libraries(){
6565 exit (EXIT_FAILURE );
6666 }
6767
68-
6968 /// Open HW screen and set video mode 240x240
7069 hw_surface = SDL_SetVideoMode (SCREEN_HORIZONTAL_SIZE , SCREEN_VERTICAL_SIZE ,
7170 32 , SDL_HWSURFACE | SDL_DOUBLEBUF );
71+ /*hw_surface = SDL_SetVideoMode(SCREEN_HORIZONTAL_SIZE, SCREEN_VERTICAL_SIZE,
72+ 32, SDL_HWSURFACE);*/
7273 if (hw_surface == NULL )
7374 {
7475 fprintf (stderr , "ERROR SDL_SetVideoMode: %s\n" , SDL_GetError ());
@@ -95,12 +96,12 @@ void usage(char *progname){
9596 fprintf (stderr , "Usage: %s [prod_test] [optionnal: arg]\n\n" , progname );
9697 fprintf (stderr , "\"prod_tests\" in:\n" );
9798 for (i = 0 ; i < sizeof (prod_tests )/sizeof (prod_tests [0 ]); i ++ ){
98- if (! prod_tests [i ].nb_args_needed ){
99+ if (prod_tests [i ].args_description == NULL ){
99100 fprintf (stderr , " %s\n" , prod_tests [i ].cmd_line_argument );
100101 }
101102 else {
102- fprintf (stderr , " %s [needs %d additional args] \n" ,
103- prod_tests [i ].cmd_line_argument , prod_tests [i ].nb_args_needed );
103+ fprintf (stderr , " %s %s \n" ,
104+ prod_tests [i ].cmd_line_argument , prod_tests [i ].args_description );
104105 }
105106 }
106107 exit (EXIT_FAILURE );
@@ -128,7 +129,7 @@ int main(int argc, char *argv[])
128129 }
129130 }
130131
131- if (test_found && (prod_tests [i ].nb_args_needed + 2 != argc ) ){
132+ if (test_found && (argc < prod_tests [i ].nb_args_needed + 2 ) ){
132133 fprintf (stderr , "ERROR: %s needs %d additional args\n" ,
133134 prod_tests [idx_current_prod_test ].cmd_line_argument ,
134135 prod_tests [idx_current_prod_test ].nb_args_needed );
0 commit comments