1 2 #include "gx_validation_strings.h" 3 4 typedef struct TEST_PARAM_S 5 { 6 7 char *test_name; /* Must be set */ 8 9 10 /* The following parameters defines the screen area to capture. 11 If 0, capture the whole screen. */ 12 13 int x_start; 14 int y_start; 15 int x_end; 16 int y_end; 17 18 } TEST_PARAM; 19 20 /* Define test exit codes */ 21 #define VALIDATION_SUCCESS 0 22 #define VALIDATION_NA 233 23 24 #define CONTROL_STACK_SIZE 4096 25 26 #define CONTROL_THREAD_PRIORITY (GX_SYSTEM_THREAD_PRIORITY + 1) 27 28 VOID gx_validation_application_define(void *); 29 30 /* gx_val_start_test is called in main() to parse argc/argc, and set up file names. */ 31 32 void gx_validation_setup(int argc, char **argv); 33 34 /* gx_validation_create_output_file is called from the validation driver toggle routine 35 to create the output file, and to record the color depth, width, height */ 36 int gx_validation_create_output_file(char *color_depth, int width, int height); 37 38 /* gx_validation_create_frame_buffer is called from the validation driver toggle routine 39 to create a output frame buffer. */ 40 int gx_validation_create_frame_buffer(int frame_size); 41 42 /* gx_validation_write_frame_write is called from the validation driver toggle routine */ 43 void gx_validation_write_frame_buffer(void); 44 45 /* gx_validation_validate_data_frame is called from the frame work to validate the output. 46 It also indicates the beginning of a frame. */ 47 int gx_validation_validate_data_frame(char *golden_file, char *test_output); 48 49 /* gx_validation_close_output_file is called from the framework to close the output file */ 50 void gx_validation_close_output_file(void); 51 52 void gx_validation_watchdog_create(int); 53 54 void gx_validation_end(void); 55 56 void gx_validation_set_frame_id(int frame_id); 57 58 void gx_validation_control_thread_create(void (*func)(ULONG)); 59 60 void gx_validation_screen_refresh(void); 61 62 void gx_validation_set_frame_comment(char *comment); 63 64 void gx_validation_capture_frames(int, int, char**, int, int); 65 66 void gx_validation_capture_frames_wait(); 67 68 void gx_validation_current_frame_id_get(int *current_frame); 69 70 void gx_validation_write_palette(ULONG *palette, int size); 71 72 void gx_validation_system_timer_expiration(ULONG val); 73 74 void gx_validation_print_test_result(int result); 75 76 void gx_validation_extract_path(char *pathname, char *path, int *pathlen); 77 78 extern char *gx_validation_frame_buffer; 79 extern int gx_validation_frame_id; 80 extern int gx_validation_record_frame; 81 extern TEST_PARAM test_parameter; 82 83 #define EXPECT_EQ(expected, actual) \ 84 if((expected) != (actual)) \ 85 { \ 86 printf("\nERROR! File: %s Line: %d\n", __FILE__, __LINE__); \ 87 printf("Expected: 0x%x, (%d) Got: 0x%x (%d)\n", (UINT)(expected), (INT)(expected), (UINT)(actual), (INT)(actual)); \ 88 failed_tests++; \ 89 } 90 91 #define PRINT_ERROR(msg) \ 92 printf("%s\nERROR! File: %s Line: %d\n", msg, __FILE__, __LINE__); 93